XdtTransformationAlias.

XdtTransformConfigWithLogger(ICakeContext, FilePath, FilePath, FilePath, IXmlTransformationLogger) Method

Summary

Transforms configuration files using XDT Transform library, allows you to pass a custom logger

Syntax

public static void XdtTransformConfigWithLogger(this ICakeContext context, FilePath sourceFile, FilePath transformFile, FilePath targetFile, IXmlTransformationLogger logger)

Examples

 var target = Argument("target", "Default");

 Task("TransformConfig")
   .Does(() => {
 
     DotNet.Xdt.IXmlTransformationLogger logger = GetLogger();
 
     var sourceFile = File("web.config");
     var transformFile = File("web.release.config");
     var targetFile = File("web.target.config");
     XdtTransformConfigWithLogger(sourceFile, transformFile, targetFile, logger);
     
     AnalyzeLog(logger);
 });

 RunTarget(target);

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The context.
sourceFile FilePath Source file to be transformed.
transformFile FilePath Transformation file.
targetFile FilePath Output file name for the transformed file.
logger IXmlTransformationLogger Logger for the transformation process

Return Value

Type Description
void