deg-engine-apply-xml-transform
This is an engine which can be used in conjunction with [BGTM](https://www.npmjs.com/package/bgtm).
Last updated a year ago by deepend .
MIT · Original npm · Tarball · package.json
$ cnpm install deg-engine-apply-xml-transform 
SYNC missed versions from official npm registry.

Deepend Group - Engine for applying XML transforms from within Gulp.

This is an engine which can be used in conjunction with BGTM.

How to use

Read the how to section for BGTM.

Run:

npm install --save-dev deg-engine-apply-xml-transform

In your gulpfile add the following dependency:

var xmlTransform = require('deg-engine-apply-xml-transform');

Then add the following task.

tm.add('transform', {
    runOnBuild: true,
    watch: false,
    watchSource: [],
    liveReload: false,
    engine: xmlTransform,
    engineOptions: {
        transformTargetsFile: './build-scripts/resources/targets/applytransforms.targets',
        buildConfiguration: '',
        buildToolsVersion: 15.0,
        buildVerbosity: 'minimal',
        buildMaxCpuCount: 0,
        buildPlatform: 'Any CPU',
        websiteRoot: ''
    }
});

Engine Options

Defaults

{
    transformTargetsFile: './build-scripts/resources/targets/applytransforms.targets',
    buildConfiguration: '',
    buildToolsVersion: 15.0,
    buildVerbosity: 'minimal',
    buildMaxCpuCount: 0,
    buildPlatform: 'Any CPU',
    websiteRoot: ''
}

Options

Option Mandatory Description
transformTargetsFile Yes The targets file location (see below code block for the targets file contents).
buildConfiguration Yes The build configuration to perform the transforms for.
buildToolsVersion Yes The build tools version, by default this is set to MS Build 15.0.
buildVerbosity Yes The verbosity for the build output.
buildMaxCpuCount Yes The maximum number of CPU's to use for the build.
buildPlatform Yes The platform for the build.
websiteRoot Yes Please use absolute paths (e.g. __dirname + '\build\Website').

Targets File Contents

<Project ToolsVersion="14.0" DefaultTargets="ApplyTransform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(MSBuildToolsVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
  <Target Name="ApplyTransform">
    <ItemGroup>
      <Transform Include="$(TransformFile)" />

      <ConfigsToTransform Include="$(FileToTransform)" Condition="Exists(@(Transform))">
        <TransformPath>%(Transform.Identity)</TransformPath>
      </ConfigsToTransform>
    </ItemGroup>
    <Message Text="@(ConfigsToTransform)"></Message>
    <Message Text="@(Transform)"></Message>

    <TransformXml Source="$(WebConfigToTransform)\%(ConfigsToTransform.Identity)"
                  Transform="%(ConfigsToTransform.TransformPath)"
                  Destination="$(WebConfigToTransform)\%(ConfigsToTransform.Identity)"
                  Condition="Exists(@(Transform))"/>
  </Target>
</Project>

License

MIT

Copyright 2017 Deepend Sydney Pty Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 2.0.3                                ...           latest (a year ago)

6 Versions

  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |