Skip to content

Commit c2c6c4b

Browse files
kboomSanju Yadav
authored andcommitted
working version
1 parent f63358b commit c2c6c4b

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

BuildConfigGen/Debugging/VsCodeLaunchConfigGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ public void AddForTask(string taskConfigPath)
4242
int major = versionNode["Major"]!.GetValue<int>();
4343
int minor = versionNode["Minor"]!.GetValue<int>();
4444
int patch = versionNode["Patch"]!.GetValue<int>();
45+
string? build = versionNode["Build"]?.GetValue<string>() ?? null;
4546

46-
var version = new TaskVersion(major, minor, patch);
47+
var version = new TaskVersion(major, minor, patch, build);
4748

4849
LaunchConfig.AddConfigForTask(
4950
taskId: taskConfig["id"]!.GetValue<string>(),

BuildConfigGen/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,13 +1147,13 @@ private static void WriteTaskJsonWithSemverConfig(string taskPath,
11471147
string outputTaskPath = Path.Combine(taskPath, fileName);
11481148
JsonNode outputTaskNode = JsonNode.Parse(ensureUpdateModeVerifier!.FileReadAllText(outputTaskPath))!;
11491149

1150-
outputTaskNode["version"]!["Major"] = taskState.configTaskVersionMapping[defaultConfig].Major;
1151-
outputTaskNode["version"]!["Minor"] = taskState.configTaskVersionMapping[defaultConfig].Minor;
1152-
outputTaskNode["version"]!["Patch"] = taskState.configTaskVersionMapping[defaultConfig].Patch;
1150+
outputTaskNode["version"]!["Major"] = taskState.configTaskVersionMapping[config].Major;
1151+
outputTaskNode["version"]!["Minor"] = taskState.configTaskVersionMapping[config].Minor;
1152+
outputTaskNode["version"]!["Patch"] = taskState.configTaskVersionMapping[config].Patch;
11531153

11541154
if (defaultConfig != config)
11551155
{
1156-
outputTaskNode["version"]!["Build"] = config.name;
1156+
outputTaskNode["version"]!["Build"] = config.constMappingKey;
11571157
}
11581158

11591159
var outputTaskNodeObject = outputTaskNode.AsObject();

BuildConfigGen/TaskVersion.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public TaskVersion(string version)
3434
throw new ArgumentException("semVer");
3535
}
3636
}
37-
public TaskVersion(int major, int minor, int overidePatch)
37+
public TaskVersion(int major, int minor, int overidePatch, string? build = null)
3838
{
3939
if (overidePatch < 0)
4040
{
@@ -44,6 +44,7 @@ public TaskVersion(int major, int minor, int overidePatch)
4444
Major = major;
4545
Minor = minor;
4646
Patch = overidePatch;
47+
Build = build;
4748
}
4849

4950
private TaskVersion(TaskVersion taskVersionToClone)
@@ -92,17 +93,17 @@ public TaskVersion Clone()
9293

9394
public TaskVersion CloneWithMinorAndPatch(int minor, int overridePatch)
9495
{
95-
return new TaskVersion(Major, minor, overridePatch);
96+
return new TaskVersion(Major, minor, overridePatch, Build);
9697
}
9798

9899
public TaskVersion CloneWithPatch(int overridePatch)
99100
{
100-
return new TaskVersion(Major, Minor, overridePatch);
101+
return new TaskVersion(Major, Minor, overridePatch, Build);
101102
}
102103

103104
public TaskVersion CloneWithMajor(int major)
104105
{
105-
return new TaskVersion(major, Minor, Patch);
106+
return new TaskVersion(major, Minor, Patch, Build);
106107
}
107108

108109
public static implicit operator String(TaskVersion version)

make-util.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,8 +1840,9 @@ exports.ensureBuildConfigGeneratorPrereqs = ensureBuildConfigGeneratorPrereqs;
18401840
* @param {Number} sprintNumber Sprint number option to pass in the BuildConfigGenerator tool
18411841
* @param {String} debugAgentDir When set to local agent root directory, the BuildConfigGenerator tool will generate launch configurations for the task(s)
18421842
* @param {Boolean} includeLocalPackagesBuildConfig When set to true, generate LocalPackages BuildConfig
1843+
* @param {Boolean} useSemverBuildConfig When set to true, use semver build config and A/B releases
18431844
*/
1844-
var processGeneratedTasks = function(baseConfigToolPath, taskList, makeOptions, writeUpdates, sprintNumber, debugAgentDir, includeLocalPackagesBuildConfig) {
1845+
var processGeneratedTasks = function (baseConfigToolPath, taskList, makeOptions, writeUpdates, sprintNumber, debugAgentDir, includeLocalPackagesBuildConfig, useSemverBuildConfig) {
18451846
if (!makeOptions) fail("makeOptions is not defined");
18461847
if (sprintNumber && !Number.isInteger(sprintNumber)) fail("Sprint is not a number");
18471848

@@ -1870,6 +1871,10 @@ var processGeneratedTasks = function(baseConfigToolPath, taskList, makeOptions,
18701871
writeUpdateArg += " --include-local-packages-build-config";
18711872
}
18721873

1874+
if (useSemverBuildConfig) {
1875+
writeUpdateArg += " --use-semver-build-config";
1876+
}
1877+
18731878
var debugAgentDirArg = "";
18741879
if(debugAgentDir) {
18751880
debugAgentDirArg += ` --debug-agent-dir ${debugAgentDir}`;

make.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ CLI.serverBuild = async function(/** @type {{ task: string }} */ argv) {
256256
{
257257
const makeOptions = fileToJson(makeOptionsPath);
258258

259+
console.log("Hello " + argv)
260+
259261
// Verify generated files across tasks are up-to-date
260-
util.processGeneratedTasks(baseConfigToolPath, taskList, makeOptions, writeUpdatedsFromGenTasks, argv.sprint, argv['debug-agent-dir'], argv.includeLocalPackagesBuildConfig);
262+
util.processGeneratedTasks(baseConfigToolPath, taskList, makeOptions, writeUpdatedsFromGenTasks, argv.sprint, argv['debug-agent-dir'], argv.includeLocalPackagesBuildConfig, argv.useSemverBuildConfig);
261263
}
262264

263265
if (argv.includeLocalPackagesBuildConfig)

0 commit comments

Comments
 (0)