zarro 1.136.0 → 1.136.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gulp-tasks/build.js +1 -3
- package/gulp-tasks/clean.js +6 -3
- package/gulp-tasks/modules/dotnet-cli.js +163 -89
- package/gulp-tasks/modules/gulp-dotnet-cli.js +19 -11
- package/gulp-tasks/modules/spawn.js +16 -6
- package/package.json +1 -1
- package/types.d.ts +33 -3
package/gulp-tasks/build.js
CHANGED
|
@@ -5,8 +5,6 @@ const
|
|
|
5
5
|
gulp = requireModule("gulp"),
|
|
6
6
|
debug = require("debug")("build"),
|
|
7
7
|
promisifyStream = requireModule("promisify"),
|
|
8
|
-
dotnetCli = require("gulp-dotnet-cli"),
|
|
9
|
-
dotnetBuild = dotnetCli.build,
|
|
10
8
|
throwIfNoFiles = requireModule("throw-if-no-files"),
|
|
11
9
|
xbuild = requireModule("gulp-xbuild"),
|
|
12
10
|
gutil = requireModule("gulp-util"),
|
|
@@ -90,7 +88,7 @@ function buildForNetCore(solutions) {
|
|
|
90
88
|
const options = {
|
|
91
89
|
target: "[not set]",
|
|
92
90
|
verbosity: env.resolve("BUILD_VERBOSITY"),
|
|
93
|
-
configuration,
|
|
91
|
+
configurations: configuration,
|
|
94
92
|
additionalArguments: msbuildArgs
|
|
95
93
|
};
|
|
96
94
|
return promisifyStream(
|
package/gulp-tasks/clean.js
CHANGED
|
@@ -5,7 +5,7 @@ const
|
|
|
5
5
|
debug = require("debug")("clean"),
|
|
6
6
|
throwIfNoFiles = requireModule("throw-if-no-files"),
|
|
7
7
|
msbuild = require("gulp-msbuild"),
|
|
8
|
-
dotnetClean =
|
|
8
|
+
dotnetClean = requireModule("gulp-dotnet-cli").clean,
|
|
9
9
|
resolveMasks = requireModule("resolve-masks"),
|
|
10
10
|
env = requireModule("env");
|
|
11
11
|
const chalk = require("ansi-colors");
|
|
@@ -19,7 +19,8 @@ const myVars = [
|
|
|
19
19
|
"BUILD_PLATFORM",
|
|
20
20
|
"BUILD_ARCHITECTURE",
|
|
21
21
|
"BUILD_MSBUILD_NODE_REUSE",
|
|
22
|
-
"BUILD_RETRIES"
|
|
22
|
+
"BUILD_RETRIES",
|
|
23
|
+
"BUILD_TARGETS"
|
|
23
24
|
];
|
|
24
25
|
env.associate(myVars, "clean");
|
|
25
26
|
|
|
@@ -49,9 +50,11 @@ function clean() {
|
|
|
49
50
|
async function cleanWithDotnet() {
|
|
50
51
|
const
|
|
51
52
|
configuration = env.resolve("BUILD_CONFIGURATION"),
|
|
52
|
-
slnMasks = resolveBuildSolutionMasks()
|
|
53
|
+
slnMasks = resolveBuildSolutionMasks(),
|
|
54
|
+
targets = env.resolveArray("BUILD_TARGETS");
|
|
53
55
|
debug({
|
|
54
56
|
slnMasks,
|
|
57
|
+
targets,
|
|
55
58
|
cwd: process.cwd()
|
|
56
59
|
});
|
|
57
60
|
const solutions = gulp
|
|
@@ -1,9 +1,137 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
(function () {
|
|
3
|
-
// TODO: perhaps one day, this should become an npm module of its own
|
|
4
4
|
const spawn = requireModule("spawn");
|
|
5
|
+
const { isSpawnError } = spawn;
|
|
5
6
|
const q = requireModule("quote-if-required");
|
|
6
7
|
let defaultNugetSource;
|
|
8
|
+
async function clean(opts) {
|
|
9
|
+
return runOnAllConfigurations(opts, configuration => {
|
|
10
|
+
const args = [
|
|
11
|
+
"clean",
|
|
12
|
+
q(opts.target)
|
|
13
|
+
];
|
|
14
|
+
pushFramework(args, opts);
|
|
15
|
+
pushRuntime(args, opts);
|
|
16
|
+
pushConfiguration(args, configuration);
|
|
17
|
+
pushVerbosity(args, opts);
|
|
18
|
+
pushOutput(args, opts);
|
|
19
|
+
return runDotNetWith(args, opts);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function build(opts) {
|
|
23
|
+
return runOnAllConfigurations(opts, configuration => {
|
|
24
|
+
const args = [
|
|
25
|
+
"build",
|
|
26
|
+
q(opts.target)
|
|
27
|
+
];
|
|
28
|
+
pushCommonBuildArgs(args, opts, configuration);
|
|
29
|
+
pushFlag(args, opts.disableBuildServers, "--disable-build-servers");
|
|
30
|
+
pushFlag(args, opts.noIncremental, "--no-incremental");
|
|
31
|
+
pushFlag(args, opts.noDependencies, "--no-dependencies");
|
|
32
|
+
pushFlag(args, opts.noRestore, "--no-restore");
|
|
33
|
+
pushFlag(args, opts.selfContained, "--self-contained");
|
|
34
|
+
pushVersionSuffix(args, opts);
|
|
35
|
+
pushMsbuildProperties(args, opts);
|
|
36
|
+
pushAdditionalArgs(args, opts);
|
|
37
|
+
return runDotNetWith(args, opts);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function test(opts) {
|
|
41
|
+
return runOnAllConfigurations(opts, configuration => {
|
|
42
|
+
const args = [
|
|
43
|
+
"test",
|
|
44
|
+
q(opts.target)
|
|
45
|
+
];
|
|
46
|
+
pushCommonBuildArgs(args, opts, configuration);
|
|
47
|
+
pushIfSet(args, opts.settingsFile, "--settings");
|
|
48
|
+
pushIfSet(args, opts.filter, "--filter");
|
|
49
|
+
pushIfSet(args, opts.diagnostics, "--diag");
|
|
50
|
+
pushNoBuild(args, opts);
|
|
51
|
+
pushNoRestore(args, opts);
|
|
52
|
+
pushLoggers(args, opts.loggers);
|
|
53
|
+
pushMsbuildProperties(args, opts);
|
|
54
|
+
pushEnvVars(args, opts.env);
|
|
55
|
+
pushAdditionalArgs(args, opts);
|
|
56
|
+
// there's a lot of stdio/stderr from tests, and it
|
|
57
|
+
// should be shown already - including it in the
|
|
58
|
+
// error dump is not only unnecessary, it confuses
|
|
59
|
+
// the test handler wrt quackers output handling
|
|
60
|
+
opts.suppressStdIoInErrors = true;
|
|
61
|
+
return runDotNetWith(args, opts);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async function pack(opts) {
|
|
65
|
+
return runOnAllConfigurations(opts, configuration => {
|
|
66
|
+
const copy = Object.assign(Object.assign({}, opts), { msbuildProperties: Object.assign({}, opts.msbuildProperties) });
|
|
67
|
+
const args = [
|
|
68
|
+
"pack",
|
|
69
|
+
q(copy.target)
|
|
70
|
+
];
|
|
71
|
+
pushConfiguration(args, configuration);
|
|
72
|
+
pushVerbosity(args, copy);
|
|
73
|
+
pushOutput(args, copy);
|
|
74
|
+
pushNoBuild(args, copy);
|
|
75
|
+
pushFlag(args, copy.includeSymbols, "--include-symbols");
|
|
76
|
+
pushFlag(args, copy.includeSource, "--include-source");
|
|
77
|
+
pushNoRestore(args, copy);
|
|
78
|
+
pushVersionSuffix(args, copy);
|
|
79
|
+
if (copy.nuspec) {
|
|
80
|
+
copy.msbuildProperties = copy.msbuildProperties || {};
|
|
81
|
+
copy.msbuildProperties["NuspecFile"] = copy.nuspec;
|
|
82
|
+
}
|
|
83
|
+
pushMsbuildProperties(args, copy);
|
|
84
|
+
return runDotNetWith(args, copy);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async function nugetPush(opts) {
|
|
88
|
+
validate(opts);
|
|
89
|
+
if (!opts.apiKey) {
|
|
90
|
+
throw new Error("apiKey was not specified");
|
|
91
|
+
}
|
|
92
|
+
const args = [
|
|
93
|
+
"nuget",
|
|
94
|
+
"push",
|
|
95
|
+
opts.target,
|
|
96
|
+
"--api-key",
|
|
97
|
+
opts.apiKey
|
|
98
|
+
];
|
|
99
|
+
if (!opts.source) {
|
|
100
|
+
// dotnet core _demands_ that the source be set.
|
|
101
|
+
opts.source = await determineDefaultNugetSource();
|
|
102
|
+
}
|
|
103
|
+
pushIfSet(args, opts.source, "--source");
|
|
104
|
+
pushIfSet(args, opts.symbolApiKey, "--symbol-api-key");
|
|
105
|
+
pushIfSet(args, opts.symbolSource, "--symbol-source");
|
|
106
|
+
pushIfSet(args, opts.timeout, "--timeout");
|
|
107
|
+
pushFlag(args, opts.disableBuffering, "--disable-buffering");
|
|
108
|
+
pushFlag(args, opts.noSymbols, "--no-symbols");
|
|
109
|
+
pushFlag(args, opts.skipDuplicate, "--skip-duplicate");
|
|
110
|
+
pushFlag(args, opts.noServiceEndpoint, "--no-service-endpoint");
|
|
111
|
+
pushFlag(args, opts.forceEnglishOutput, "--force-english-output");
|
|
112
|
+
return runDotNetWith(args, opts);
|
|
113
|
+
}
|
|
114
|
+
async function runOnAllConfigurations(opts, toRun) {
|
|
115
|
+
validate(opts);
|
|
116
|
+
let configurations = resolveConfigurations(opts);
|
|
117
|
+
if (configurations.length < 1) {
|
|
118
|
+
configurations = [...defaultConfigurations];
|
|
119
|
+
}
|
|
120
|
+
let lastResult;
|
|
121
|
+
for (const configuration of configurations) {
|
|
122
|
+
const thisResult = await toRun(configuration);
|
|
123
|
+
if (isSpawnError(thisResult)) {
|
|
124
|
+
return thisResult;
|
|
125
|
+
}
|
|
126
|
+
lastResult = thisResult;
|
|
127
|
+
}
|
|
128
|
+
// for simplicity: return the last spawn result (at least for now, until there's a reason to get clever)
|
|
129
|
+
if (lastResult === undefined) {
|
|
130
|
+
// this is really here for TS
|
|
131
|
+
throw new Error(`No build configurations could be determined, which is odd, because there's even a fallback.`);
|
|
132
|
+
}
|
|
133
|
+
return lastResult;
|
|
134
|
+
}
|
|
7
135
|
async function determineDefaultNugetSource() {
|
|
8
136
|
if (defaultNugetSource) {
|
|
9
137
|
return defaultNugetSource;
|
|
@@ -42,95 +170,42 @@
|
|
|
42
170
|
}
|
|
43
171
|
return result;
|
|
44
172
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
173
|
+
// this is actually a viable configuration... but we're going to use
|
|
174
|
+
// it as a flag to not put in -c at all
|
|
175
|
+
const defaultConfigurations = ["default"];
|
|
176
|
+
function resolveConfigurations(opts) {
|
|
177
|
+
if (!opts.configuration) {
|
|
178
|
+
return defaultConfigurations;
|
|
49
179
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
opts.target,
|
|
54
|
-
"--api-key",
|
|
55
|
-
opts.apiKey
|
|
56
|
-
];
|
|
57
|
-
if (!opts.source) {
|
|
58
|
-
// dotnet core _demands_ that the source be set.
|
|
59
|
-
opts.source = await determineDefaultNugetSource();
|
|
60
|
-
}
|
|
61
|
-
pushIfSet(args, opts.source, "--source");
|
|
62
|
-
pushIfSet(args, opts.symbolApiKey, "--symbol-api-key");
|
|
63
|
-
pushIfSet(args, opts.symbolSource, "--symbol-source");
|
|
64
|
-
pushIfSet(args, opts.timeout, "--timeout");
|
|
65
|
-
pushFlag(args, opts.disableBuffering, "--disable-buffering");
|
|
66
|
-
pushFlag(args, opts.noSymbols, "--no-symbols");
|
|
67
|
-
pushFlag(args, opts.skipDuplicate, "--skip-duplicate");
|
|
68
|
-
pushFlag(args, opts.noServiceEndpoint, "--no-service-endpoint");
|
|
69
|
-
pushFlag(args, opts.forceEnglishOutput, "--force-english-output");
|
|
70
|
-
return runDotNetWith(args, opts);
|
|
71
|
-
}
|
|
72
|
-
async function build(opts) {
|
|
73
|
-
validate(opts);
|
|
74
|
-
const args = [
|
|
75
|
-
"build",
|
|
76
|
-
q(opts.target)
|
|
77
|
-
];
|
|
78
|
-
pushCommonBuildArgs(args, opts);
|
|
79
|
-
pushFlag(args, opts.disableBuildServers, "--disable-build-servers");
|
|
80
|
-
pushFlag(args, opts.noIncremental, "--no-incremental");
|
|
81
|
-
pushFlag(args, opts.noDependencies, "--no-dependencies");
|
|
82
|
-
pushFlag(args, opts.noRestore, "--no-restore");
|
|
83
|
-
pushFlag(args, opts.selfContained, "--self-contained");
|
|
84
|
-
pushVersionSuffix(args, opts);
|
|
85
|
-
pushMsbuildProperties(args, opts);
|
|
86
|
-
pushAdditionalArgs(args, opts);
|
|
87
|
-
return runDotNetWith(args, opts);
|
|
88
|
-
}
|
|
89
|
-
async function test(opts) {
|
|
90
|
-
const args = [
|
|
91
|
-
"test",
|
|
92
|
-
q(opts.target)
|
|
93
|
-
];
|
|
94
|
-
pushCommonBuildArgs(args, opts);
|
|
95
|
-
pushIfSet(args, opts.settingsFile, "--settings");
|
|
96
|
-
pushIfSet(args, opts.filter, "--filter");
|
|
97
|
-
pushIfSet(args, opts.diagnostics, "--diag");
|
|
98
|
-
pushNoBuild(args, opts);
|
|
99
|
-
pushNoRestore(args, opts);
|
|
100
|
-
pushLoggers(args, opts.loggers);
|
|
101
|
-
pushMsbuildProperties(args, opts);
|
|
102
|
-
pushEnvVars(args, opts.env);
|
|
103
|
-
pushAdditionalArgs(args, opts);
|
|
104
|
-
return runDotNetWith(args, opts);
|
|
180
|
+
return Array.isArray(opts.configuration)
|
|
181
|
+
? opts.configuration
|
|
182
|
+
: [opts.configuration];
|
|
105
183
|
}
|
|
106
|
-
|
|
107
|
-
validate(opts);
|
|
108
|
-
const copy = Object.assign(Object.assign({}, opts), { msbuildProperties: Object.assign({}, opts.msbuildProperties) });
|
|
109
|
-
const args = [
|
|
110
|
-
"pack",
|
|
111
|
-
q(copy.target)
|
|
112
|
-
];
|
|
113
|
-
pushVerbosity(args, copy);
|
|
114
|
-
pushOutput(args, copy);
|
|
115
|
-
pushConfiguration(args, copy);
|
|
116
|
-
pushNoBuild(args, copy);
|
|
117
|
-
pushFlag(args, copy.includeSymbols, "--include-symbols");
|
|
118
|
-
pushFlag(args, copy.includeSource, "--include-source");
|
|
119
|
-
pushNoRestore(args, copy);
|
|
120
|
-
pushVersionSuffix(args, copy);
|
|
121
|
-
if (copy.nuspec) {
|
|
122
|
-
copy.msbuildProperties = copy.msbuildProperties || {};
|
|
123
|
-
copy.msbuildProperties["NuspecFile"] = copy.nuspec;
|
|
124
|
-
}
|
|
125
|
-
pushMsbuildProperties(args, copy);
|
|
126
|
-
return runDotNetWith(args, copy);
|
|
127
|
-
}
|
|
128
|
-
function pushCommonBuildArgs(args, opts) {
|
|
129
|
-
pushVerbosity(args, opts);
|
|
130
|
-
pushConfiguration(args, opts);
|
|
184
|
+
function pushFramework(args, opts) {
|
|
131
185
|
pushIfSet(args, opts.framework, "--framework");
|
|
186
|
+
}
|
|
187
|
+
function pushRuntime(args, opts) {
|
|
132
188
|
pushIfSet(args, opts.runtime, "--runtime");
|
|
189
|
+
}
|
|
190
|
+
function pushArch(args, opts) {
|
|
133
191
|
pushIfSet(args, opts.arch, "--arch");
|
|
192
|
+
}
|
|
193
|
+
function pushConfiguration(args, configuration) {
|
|
194
|
+
debugger;
|
|
195
|
+
if (!configuration) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (configuration.toLowerCase() === "default") {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
args.push.call(args, "--configuration", configuration);
|
|
202
|
+
}
|
|
203
|
+
function pushCommonBuildArgs(args, opts, configuration) {
|
|
204
|
+
pushVerbosity(args, opts);
|
|
205
|
+
pushConfiguration(args, configuration);
|
|
206
|
+
pushFramework(args, opts);
|
|
207
|
+
pushRuntime(args, opts);
|
|
208
|
+
pushArch(args, opts);
|
|
134
209
|
pushIfSet(args, opts.os, "--os");
|
|
135
210
|
pushOutput(args, opts);
|
|
136
211
|
}
|
|
@@ -157,9 +232,6 @@
|
|
|
157
232
|
function pushVerbosity(args, opts) {
|
|
158
233
|
pushIfSet(args, opts.verbosity, "--verbosity");
|
|
159
234
|
}
|
|
160
|
-
function pushConfiguration(args, opts) {
|
|
161
|
-
pushIfSet(args, opts.configuration, "--configuration");
|
|
162
|
-
}
|
|
163
235
|
function pushAdditionalArgs(args, opts) {
|
|
164
236
|
if (opts.additionalArguments) {
|
|
165
237
|
args.push.apply(args, opts.additionalArguments);
|
|
@@ -169,7 +241,8 @@
|
|
|
169
241
|
try {
|
|
170
242
|
return await spawn("dotnet", args, {
|
|
171
243
|
stdout: opts.stdout,
|
|
172
|
-
stderr: opts.stderr
|
|
244
|
+
stderr: opts.stderr,
|
|
245
|
+
suppressStdIoInErrors: opts.suppressStdIoInErrors
|
|
173
246
|
});
|
|
174
247
|
}
|
|
175
248
|
catch (e) {
|
|
@@ -224,6 +297,7 @@
|
|
|
224
297
|
test,
|
|
225
298
|
build,
|
|
226
299
|
pack,
|
|
300
|
+
clean,
|
|
227
301
|
nugetPush
|
|
228
302
|
};
|
|
229
303
|
})();
|
|
@@ -14,24 +14,19 @@
|
|
|
14
14
|
// otherwise, discard the result
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return streamify(wrap(dotnetCli.
|
|
17
|
+
function build(opts) {
|
|
18
|
+
return streamify(wrap(dotnetCli.build), f => {
|
|
19
19
|
const copy = Object.assign({}, opts);
|
|
20
20
|
copy.target = f.path;
|
|
21
|
-
const containingFolder = path.dirname(f.path);
|
|
22
|
-
const supplementaryNuspec = path.resolve(path.join(containingFolder, env.resolve(env.PACK_SUPPLEMENTARY_NUSPEC)));
|
|
23
|
-
if (await fileExists(supplementaryNuspec)) {
|
|
24
|
-
copy.nuspec = supplementaryNuspec;
|
|
25
|
-
}
|
|
26
21
|
return copy;
|
|
27
|
-
}, "gulp-dotnet-cli-
|
|
22
|
+
}, "gulp-dotnet-cli-build", "building project or solution");
|
|
28
23
|
}
|
|
29
|
-
function
|
|
30
|
-
return streamify(wrap(dotnetCli.
|
|
24
|
+
function clean(opts) {
|
|
25
|
+
return streamify(wrap(dotnetCli.clean), f => {
|
|
31
26
|
const copy = Object.assign({}, opts);
|
|
32
27
|
copy.target = f.path;
|
|
33
28
|
return copy;
|
|
34
|
-
}, "gulp-dotnet-cli-
|
|
29
|
+
}, "gulp-dotnet-cli-clean", "cleaning project or solution");
|
|
35
30
|
}
|
|
36
31
|
function test(opts) {
|
|
37
32
|
return streamify(wrap(dotnetCli.test), f => {
|
|
@@ -40,6 +35,18 @@
|
|
|
40
35
|
return copy;
|
|
41
36
|
}, "gulp-dotnet-cli-pack", "creating nuget package");
|
|
42
37
|
}
|
|
38
|
+
function pack(opts) {
|
|
39
|
+
return streamify(wrap(dotnetCli.pack), async (f) => {
|
|
40
|
+
const copy = Object.assign({}, opts);
|
|
41
|
+
copy.target = f.path;
|
|
42
|
+
const containingFolder = path.dirname(f.path);
|
|
43
|
+
const supplementaryNuspec = path.resolve(path.join(containingFolder, env.resolve(env.PACK_SUPPLEMENTARY_NUSPEC)));
|
|
44
|
+
if (await fileExists(supplementaryNuspec)) {
|
|
45
|
+
copy.nuspec = supplementaryNuspec;
|
|
46
|
+
}
|
|
47
|
+
return copy;
|
|
48
|
+
}, "gulp-dotnet-cli-pack", "creating nuget package");
|
|
49
|
+
}
|
|
43
50
|
function nugetPush(opts) {
|
|
44
51
|
return streamify(wrap(dotnetCli.nugetPush), f => {
|
|
45
52
|
const copy = Object.assign({}, opts);
|
|
@@ -49,6 +56,7 @@
|
|
|
49
56
|
}
|
|
50
57
|
module.exports = {
|
|
51
58
|
build,
|
|
59
|
+
clean,
|
|
52
60
|
test,
|
|
53
61
|
pack,
|
|
54
62
|
nugetPush
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
this._args = args;
|
|
10
10
|
this._exe = exe;
|
|
11
11
|
this._exitCode = exitCode;
|
|
12
|
-
this._stderr = [...stderr];
|
|
13
|
-
this._stdout = [...stdout];
|
|
12
|
+
this._stderr = stderr ? [...stderr] : null;
|
|
13
|
+
this._stdout = stdout ? [...stdout] : null;
|
|
14
14
|
}
|
|
15
15
|
get args() {
|
|
16
16
|
return this._args;
|
|
@@ -22,16 +22,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
return this._exitCode;
|
|
23
23
|
}
|
|
24
24
|
get stdout() {
|
|
25
|
-
return [...this._stdout];
|
|
25
|
+
return this._stdout ? [...this._stdout] : [];
|
|
26
26
|
}
|
|
27
27
|
get stderr() {
|
|
28
|
-
return [...this._stderr];
|
|
28
|
+
return this._stderr ? [...this._stderr] : [];
|
|
29
29
|
}
|
|
30
30
|
toString() {
|
|
31
31
|
const lines = [
|
|
32
32
|
`${this.exe} ${this.args.join(" ")}`,
|
|
33
33
|
`Process exited with code: ${this.exitCode}`,
|
|
34
34
|
];
|
|
35
|
+
if (this._stderr === null && this._stdout === null) {
|
|
36
|
+
// io has been suppressed;
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
35
39
|
const hasStdOut = this.stdout && this.stdout.length > 0;
|
|
36
40
|
const hasStdErr = this.stderr && this.stderr.length > 0;
|
|
37
41
|
const hasOutput = hasStdErr || hasStdOut;
|
|
@@ -156,7 +160,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
156
160
|
child.on("error", (err) => {
|
|
157
161
|
debug(`child error: ${err}`);
|
|
158
162
|
destroyPipesOn(child);
|
|
159
|
-
const e = new SpawnError(`"${[executable].concat(args).join(" ")}" failed with "${err}"`, executable, quotedArgs, -1, stderr, stdout);
|
|
163
|
+
const e = new SpawnError(`"${[executable].concat(args).join(" ")}" failed with "${err}"`, executable, quotedArgs, -1, opts.suppressStdIoInErrors ? null : stderr, opts.suppressStdIoInErrors ? null : stdout);
|
|
160
164
|
reject(e);
|
|
161
165
|
});
|
|
162
166
|
let exited = false;
|
|
@@ -181,7 +185,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
181
185
|
else {
|
|
182
186
|
const err = new SpawnError(`"${[executable]
|
|
183
187
|
.concat(args)
|
|
184
|
-
.join(" ")}" failed with exit code ${code}`, executable, args, code, stdout, stderr);
|
|
188
|
+
.join(" ")}" failed with exit code ${code}`, executable, args, code, opts.suppressStdIoInErrors ? null : stdout, opts.suppressStdIoInErrors ? null : stderr);
|
|
185
189
|
reject(err);
|
|
186
190
|
}
|
|
187
191
|
};
|
|
@@ -239,5 +243,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
239
243
|
}
|
|
240
244
|
spawn.SpawnError = SpawnError;
|
|
241
245
|
spawn.SpawnResult = SpawnResult;
|
|
246
|
+
spawn.isSpawnError = function (o) {
|
|
247
|
+
return o instanceof SpawnError;
|
|
248
|
+
};
|
|
249
|
+
spawn.isSpawnResult = function (o) {
|
|
250
|
+
return o instanceof SpawnResult;
|
|
251
|
+
};
|
|
242
252
|
module.exports = spawn;
|
|
243
253
|
})();
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare global {
|
|
|
32
32
|
(() => Promise<any> | NodeJS.EventEmitter) | ((done: VoidVoid) => Promise<any> | NodeJS.EventEmitter)
|
|
33
33
|
type TryDo<T> = (logic: AsyncVoidFunc<T>, retries: number | string, onTransientError?: ErrorReporter, onFinalFailure?: VoidVoid) => Promise<void>;
|
|
34
34
|
type Optional<T> = T | undefined;
|
|
35
|
+
type Nullable<T> = T | null;
|
|
35
36
|
type ResolveNuget = (nugetPath: Optional<string>, errorOnMissing: boolean) => string;
|
|
36
37
|
type FindLocalNuget = () => Promise<string>;
|
|
37
38
|
|
|
@@ -516,6 +517,7 @@ declare global {
|
|
|
516
517
|
* collection is done as the IO is left as "inherit"
|
|
517
518
|
*/
|
|
518
519
|
interactive?: boolean;
|
|
520
|
+
suppressStdIoInErrors?: boolean
|
|
519
521
|
}
|
|
520
522
|
|
|
521
523
|
interface SpawnError extends Error {
|
|
@@ -539,6 +541,8 @@ declare global {
|
|
|
539
541
|
interface Spawn extends SpawnFunction {
|
|
540
542
|
SpawnResult: Function;
|
|
541
543
|
SpawnError: Function;
|
|
544
|
+
isSpawnError: (o: any) => o is SpawnError;
|
|
545
|
+
isSpawnResult: (o: any) => o is SpawnResult;
|
|
542
546
|
}
|
|
543
547
|
|
|
544
548
|
type AskOptions = {}
|
|
@@ -568,11 +572,12 @@ declare global {
|
|
|
568
572
|
verbosity?: DotNetVerbosity;
|
|
569
573
|
// when set, errors are returned instead of thrown
|
|
570
574
|
suppressErrors?: boolean;
|
|
575
|
+
suppressStdIoInErrors?: boolean;
|
|
571
576
|
}
|
|
572
577
|
|
|
573
578
|
interface DotNetCommonBuildOptions extends DotNetBaseOptions {
|
|
574
579
|
target: string;
|
|
575
|
-
configuration?: string;
|
|
580
|
+
configuration?: string | string[];
|
|
576
581
|
framework?: string;
|
|
577
582
|
runtime?: string;
|
|
578
583
|
output?: string;
|
|
@@ -583,7 +588,7 @@ declare global {
|
|
|
583
588
|
interface DotNetPackOptions extends DotNetBaseOptions {
|
|
584
589
|
target: string;
|
|
585
590
|
output?: string;
|
|
586
|
-
configuration?: string;
|
|
591
|
+
configuration?: string | string[];
|
|
587
592
|
noBuild?: boolean;
|
|
588
593
|
includeSymbols?: boolean;
|
|
589
594
|
includeSource?: boolean;
|
|
@@ -601,6 +606,14 @@ declare global {
|
|
|
601
606
|
versionSuffix?: string;
|
|
602
607
|
}
|
|
603
608
|
|
|
609
|
+
interface DotNetCleanOptions extends DotNetBaseOptions {
|
|
610
|
+
target: string;
|
|
611
|
+
framework?: string;
|
|
612
|
+
runtime?: string;
|
|
613
|
+
configuration?: string | string[],
|
|
614
|
+
output?: string;
|
|
615
|
+
}
|
|
616
|
+
|
|
604
617
|
interface DotNetNugetPushOptions extends DotNetBaseOptions {
|
|
605
618
|
target: string;
|
|
606
619
|
apiKey: string;
|
|
@@ -634,14 +647,31 @@ declare global {
|
|
|
634
647
|
type DotNetBuildFunction = (opts: DotNetBuildOptions) => Promise<SpawnResult | SpawnError>;
|
|
635
648
|
type DotNetPackFunction = (opts: DotNetPackOptions) => Promise<SpawnResult | SpawnError>;
|
|
636
649
|
type DotNetNugetPushFunction = (opts: DotNetNugetPushOptions) => Promise<SpawnResult | SpawnError>;
|
|
650
|
+
type DotNetCleanFunction = (opts: DotNetCleanOptions) => Promise<SpawnResult | SpawnError>;
|
|
637
651
|
|
|
638
652
|
interface DotNetCli {
|
|
639
|
-
|
|
653
|
+
clean: DotNetCleanFunction;
|
|
640
654
|
build: DotNetBuildFunction;
|
|
655
|
+
test: DotNetTestFunction;
|
|
641
656
|
pack: DotNetPackFunction;
|
|
642
657
|
nugetPush: DotNetNugetPushFunction;
|
|
643
658
|
}
|
|
644
659
|
|
|
660
|
+
type TransformFunction<T> = (opts: T) => Transform;
|
|
661
|
+
type GulpDotNetTestFunction = TransformFunction<DotNetTestOptions>;
|
|
662
|
+
type GulpDotNetBuildFunction = TransformFunction<DotNetBuildOptions>;
|
|
663
|
+
type GulpDotNetPackFunction = TransformFunction<DotNetPackOptions>;
|
|
664
|
+
type GulpDotNetNugetPushFunction = TransformFunction<DotNetNugetPushOptions>;
|
|
665
|
+
type GulpDotNetCleanFunction = TransformFunction<DotNetCleanOptions>;
|
|
666
|
+
|
|
667
|
+
interface GulpDotNetCli {
|
|
668
|
+
build: GulpDotNetBuildFunction;
|
|
669
|
+
clean: GulpDotNetCleanFunction;
|
|
670
|
+
test: GulpDotNetTestFunction;
|
|
671
|
+
pack: GulpDotNetPackFunction;
|
|
672
|
+
nugetPush: GulpDotNetNugetPushFunction;
|
|
673
|
+
}
|
|
674
|
+
|
|
645
675
|
// scraped from https://spdx.org/licenses/
|
|
646
676
|
// with the following fragment from FF dev console
|
|
647
677
|
// copy(Array.from(document.querySelector("table").querySelectorAll("tr")).map(tr => {
|