@node-sitecore/cli
Advanced tools
Comparing version 1.4.1 to 1.5.0
#!/usr/bin/env node | ||
const commander = require('commander'); | ||
const config = require('../src/config'); | ||
const buildSolution = require('../src/build-solution'); | ||
const targets = config.runCleanBuilds ? [ 'Clean', 'Build' ] : [ 'Build' ]; | ||
commander | ||
.alias('nsc build') | ||
.usage('[options]') | ||
.option( | ||
' -a, --architecture <arch>', | ||
'Specify the Architecture (Auto-detected, x86, x84)' | ||
) | ||
.option( | ||
'-c, --configuration <config>', | ||
'Specify Build Configuration (Release or Debug)', | ||
/^(Release|Debug)$/ | ||
) | ||
.option( | ||
'-t, --targets <targets>', | ||
'Specify Build Targets (Clean,Build,Rebuild)', | ||
(v) => v.split(',') | ||
) | ||
.option( | ||
'-n, --tools-version <version>', | ||
'Specify the .NET Tools-Version (1.0, 1.1, 2.0, 3.5, 4.0, 12.0, 14.0, 15.0, auto)' | ||
) | ||
.option( | ||
'-p, --solution-platform <plateform>', | ||
'Specify the Solution Platform (e.g. x86, x64, AnyCPU)' | ||
) | ||
.option( | ||
'-v, --verbosity <level>', | ||
'Specify the amount of information to display in the build output (quiet, minimal, normal, detailed, diagnostic)', | ||
/^(quiet|minimal|normal|detailed|diagnostic)$/ | ||
) | ||
.option( | ||
'--nologo', | ||
'Suppress Startup Banner and Copyright Message of MSBuild', | ||
(v) => v + 1 | ||
) | ||
.option( | ||
'-m, --maxcpucount <cpuNb>', | ||
'Specify Maximal CPU-Count to use', | ||
parseInt | ||
) | ||
.option( | ||
'-r, --node-reuse <boolean>', | ||
'Specify whether to enable or disable the re-use of MSBuild nodes', | ||
(v) => v === 'false' | ||
) | ||
.option( | ||
'-l, --log-command', | ||
'Logs the msbuild command that will be executed.', | ||
(v) => v + 1 | ||
) | ||
.parse(process.argv); | ||
buildSolution(config.solutionPath, { | ||
const { | ||
configuration, | ||
targets = config.get('buildTargets'), | ||
maxcpucount = config.get('buildMaxCpuCount'), | ||
verbosity = config.get('buildVerbosity'), | ||
logCommand = config.get('buildLogCommand'), | ||
nodeReuse = config.get('buildNodeReuse'), | ||
toolsVersion = config.get('buildToolsVersion'), | ||
solutionPlatform = config.get('buildPlatform'), | ||
nologo | ||
} = commander; | ||
const options = { | ||
targets, | ||
configuration: config.get('buildConfiguration'), | ||
logCommand: false, | ||
verbosity: config.get('buildVerbosity'), | ||
configuration, | ||
logCommand, | ||
verbosity, | ||
stdout: true, | ||
errorOnFail: true, | ||
maxcpucount: config.get('buildMaxCpuCount'), | ||
nodeReuse: false, | ||
toolsVersion: config.get('buildToolsVersion'), | ||
maxcpucount, | ||
nodeReuse, | ||
toolsVersion, | ||
nologo, | ||
properties: { | ||
Platform: config.get('buildPlatform') | ||
} | ||
}); | ||
Platform: solutionPlatform | ||
}, | ||
customArgs: commander.args | ||
}; | ||
buildSolution(config.solutionPath, options); |
{ | ||
"name": "@node-sitecore/cli", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "A node Sitecore cli", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -44,1 +44,22 @@ # node-sitecore-cli | ||
``` | ||
### Build command options | ||
Option | Default value | Description | ||
---|---|--- | ||
`--log-command, -l` | `false` | Logs the msbuild command that will be executed. | ||
`--targets, -t <list>` | `Build` | Specify Build Targets. | ||
`--configuration, -c <config>` | `Debug` | Specify Build Configuration (Release or Debug). | ||
`--solution-platform, -p <plateform>` | `AnyCPU` | Specify the Solution Platform (e.g. x86, x64, AnyCPU). | ||
`--tools-version, -n <version>` | `15.0` | Specify the .NET Tools-Version (1.0, 1.1, 2.0, 3.5, 4.0, 12.0, 14.0, 15.0, auto). | ||
`--architecture, -a <arch>` | `Auto-detected` | Specify the Architecture (x86, x64). | ||
`--verbosity, -v <level>` | `minimal` | Specify the amount of information to display in the build output (quiet, minimal, normal, detailed, diagnostic). | ||
`--maxcpucount, -m <cpunb>` | `0` | Specify Maximal CPU-Count to use. (`-1`: MSBuild Default, `0`: Automatic selection, `> 0`: Concrete value). | ||
`--node-reuse, -r <boolean>` | `true` | Specify whether to enable or disable the re-use of MSBuild nodes (true or false). | ||
`--nologo` | | Suppress Startup Banner and Copyright Message of MSBuild. | ||
> It also possible to give additional arguments to the msBuild command directly. Just use `--` after the command line. | ||
```bash | ||
nsc build --targets Clean,Build -- /noautoresponse | ||
``` |
@@ -7,3 +7,2 @@ const gulp = require('gulp'); | ||
log.info('Build solution =>', solutionPath); | ||
return gulp | ||
@@ -10,0 +9,0 @@ .src(solutionPath) |
@@ -125,9 +125,10 @@ const path = require('path'); | ||
this.set('buildConfiguration', 'Debug'); | ||
this.set('buildToolsVersion', 15.0); | ||
this.set('buildToolsVersion', '15.0'); | ||
this.set('buildMaxCpuCount', 0); | ||
this.set('buildVerbosity', 'minimal'); | ||
this.set('buildPlatform', 'Any CPU'); | ||
this.set('publishPlatform', 'AnyCpu'); | ||
this.set('runCleanBuilds', 'false'); | ||
this.set('excludeFilesFromDeployment', [ 'packages.config' ]); | ||
this.set('buildPlatform', 'AnyCPU'); | ||
this.set('buildNodeReuse', false); | ||
this.set('buildLogCommand', false); | ||
this.set('buildTargets', ['Build']); | ||
this.set('excludeFilesFromDeployment', ['packages.config']); | ||
@@ -146,3 +147,3 @@ this.readConfiguration(); | ||
Object.keys(conf).forEach((key) => { | ||
this.set(key, conf[ key ]); | ||
this.set(key, conf[key]); | ||
}); | ||
@@ -162,3 +163,3 @@ | ||
Object.keys(conf).forEach((key) => { | ||
this._config.set(key, conf[ key ]); | ||
this._config.set(key, conf[key]); | ||
}); | ||
@@ -202,3 +203,3 @@ | ||
this._config.forEach((value, key) => { | ||
conf[ key ] = value; | ||
conf[key] = value; | ||
}); | ||
@@ -205,0 +206,0 @@ |
49164
907
64