ics-builder 4.2.1 → 4.2.4
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/package.json
CHANGED
|
@@ -47,16 +47,20 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
|
|
|
47
47
|
};
|
|
48
48
|
Net5ApiBuilder.prototype._build = function () {
|
|
49
49
|
var _this = this;
|
|
50
|
-
var _a;
|
|
51
|
-
|
|
50
|
+
var _a, _b;
|
|
51
|
+
if (this.modules.length == 0) {
|
|
52
|
+
utils_1.Logger.warn("Api layer not found, skipping.");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
var coreModule = (_a = this.modules.find(function (m) { return m.IsCoreModule; })) !== null && _a !== void 0 ? _a : this.modules[0];
|
|
52
56
|
var slnName = "Mdt";
|
|
53
57
|
var slnDir = path.dirname(coreModule.Project);
|
|
54
|
-
var configuration = ((
|
|
58
|
+
var configuration = ((_b = this.config.api) === null || _b === void 0 ? void 0 : _b.configuration) || "Debug";
|
|
55
59
|
var tempSlnPath = path.join(slnDir, slnName + ".sln");
|
|
56
60
|
try {
|
|
57
61
|
dotnetUtils_1.DotnetUtils.createTempSln(slnDir, slnName);
|
|
58
|
-
for (var _i = 0,
|
|
59
|
-
var m =
|
|
62
|
+
for (var _i = 0, _c = this.modules; _i < _c.length; _i++) {
|
|
63
|
+
var m = _c[_i];
|
|
60
64
|
var csproj = new csprojFile_1.CsprojFile(m.Project);
|
|
61
65
|
csproj.setPublishPath(m.OutputPath);
|
|
62
66
|
csproj.save(m.Project);
|
|
@@ -37,10 +37,15 @@ var CustomUiBuilder = /** @class */ (function (_super) {
|
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
CustomUiBuilder.prototype.prepareEnvArgs = function () {
|
|
40
|
+
var _this = this;
|
|
40
41
|
var env = this.config.ui.env || {};
|
|
41
42
|
return Object.keys(env).map(function (k) {
|
|
42
43
|
var v = env[k];
|
|
43
|
-
|
|
44
|
+
var splitters = {
|
|
45
|
+
space: " ",
|
|
46
|
+
dot: "."
|
|
47
|
+
};
|
|
48
|
+
return "--env" + (splitters[_this.config.ui.envSplitter] || ".") + k + "=" + (v instanceof Array ? v.toString() : v);
|
|
44
49
|
});
|
|
45
50
|
};
|
|
46
51
|
CustomUiBuilder.prototype.prepareCmd = function (cmd, args) {
|
|
@@ -6,8 +6,8 @@ var GitScmProvider = /** @class */ (function () {
|
|
|
6
6
|
function GitScmProvider(options) {
|
|
7
7
|
this.options = options;
|
|
8
8
|
}
|
|
9
|
-
GitScmProvider.prototype.exec = function (cmd, targetDir) {
|
|
10
|
-
return utils_1.Utils.exec("git " + cmd, { silent: true, cwd: targetDir || "" });
|
|
9
|
+
GitScmProvider.prototype.exec = function (cmd, targetDir, skipError) {
|
|
10
|
+
return utils_1.Utils.exec("git " + cmd, { silent: true, cwd: targetDir || "", skipError: skipError });
|
|
11
11
|
};
|
|
12
12
|
GitScmProvider.prototype.clone = function (config) {
|
|
13
13
|
utils_1.Logger.info("Cloning repository " + config.package.name + " in " + config.paths.source + ", please wait...");
|
|
@@ -19,8 +19,11 @@ var GitScmProvider = /** @class */ (function () {
|
|
|
19
19
|
};
|
|
20
20
|
GitScmProvider.prototype.update = function (config, version) {
|
|
21
21
|
var update = this.exec("checkout " + version.branch + " --force", config.paths.source);
|
|
22
|
-
if (!version.isTag)
|
|
23
|
-
this.exec("merge", config.paths.source);
|
|
22
|
+
if (!version.isTag) {
|
|
23
|
+
var result = this.exec("merge", config.paths.source, true);
|
|
24
|
+
if (result.code !== 0)
|
|
25
|
+
throw result.stderr || result.stdout;
|
|
26
|
+
}
|
|
24
27
|
utils_1.Logger.info(config.package.name + " updated to " + version.branch + " (rev. " + version.revision + ")");
|
|
25
28
|
return update;
|
|
26
29
|
};
|
|
@@ -29,16 +29,39 @@ var SourceManager = /** @class */ (function () {
|
|
|
29
29
|
var scmProvider = sourceType === "git" ? new gitScmProvider_1.GitScmProvider(scmOptions) : new hgScmProvider_1.HgScmProvider(scmOptions);
|
|
30
30
|
var version;
|
|
31
31
|
if (!skipLoad) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
try {
|
|
33
|
+
utils_1.Utils.ensurePath(path.join(sourceConfig.paths.source, "." + sourceType.toLowerCase()))
|
|
34
|
+
? scmProvider.pull(sourceConfig)
|
|
35
|
+
: scmProvider.clone(sourceConfig);
|
|
36
|
+
version = this.update(scmProvider, sourceConfig, true);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
if (e.includes("Merge conflict")) {
|
|
40
|
+
utils_1.Logger.warn("Merge conflict, retrying");
|
|
41
|
+
utils_1.Utils.prepareDir(sourceConfig.paths.source);
|
|
42
|
+
scmProvider.clone(sourceConfig);
|
|
43
|
+
version = this.update(scmProvider, sourceConfig, false);
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
throw e;
|
|
47
|
+
}
|
|
37
48
|
}
|
|
38
49
|
else
|
|
39
50
|
version = scmProvider.getVersion(sourceConfig);
|
|
40
51
|
return version;
|
|
41
52
|
};
|
|
53
|
+
SourceManager.prototype.update = function (scmProvider, sourceConfig, throwError) {
|
|
54
|
+
try {
|
|
55
|
+
var version = scmProvider.getVersion(sourceConfig);
|
|
56
|
+
scmProvider.update(sourceConfig, version);
|
|
57
|
+
return version;
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
if (throwError)
|
|
61
|
+
throw e;
|
|
62
|
+
utils_1.Logger.error(e);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
42
65
|
return SourceManager;
|
|
43
66
|
}());
|
|
44
67
|
exports.SourceManager = SourceManager;
|