Skip to content

Commit 332d604

Browse files
committed
Added the option to keep the current version, to the build tool
1 parent 1c22342 commit 332d604

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

.nuke/build.schema.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"DoxygenBin": {
1414
"type": "string",
15-
"description": "[Optional] The path of the doxygen bin directory (Default: C:\\Program Files\\doxygen\\bin)"
15+
"description": "The path of the doxygen bin directory (Default: C:\\Program Files\\doxygen\\bin)"
1616
},
1717
"Help": {
1818
"type": "boolean",
@@ -39,13 +39,17 @@
3939
"VSCode"
4040
]
4141
},
42+
"KeepVersion": {
43+
"type": "boolean",
44+
"description": "Don't update the version (Default: Minor version will be updated)"
45+
},
4246
"Major": {
4347
"type": "boolean",
44-
"description": "[Optional] Update the major version (Default: Minor version will be updated)"
48+
"description": "Update the major version (Default: Minor version will be updated)"
4549
},
4650
"NoDocs": {
4751
"type": "boolean",
48-
"description": "[Optional] Sets that no docs should be created"
52+
"description": "Sets that no docs should be created (Default: Automatically updating the version from the build config)"
4953
},
5054
"NoLogo": {
5155
"type": "boolean",
@@ -57,7 +61,7 @@
5761
},
5862
"Patch": {
5963
"type": "boolean",
60-
"description": "[Optional] Update the patch version (Default: Minor version will be updated)"
64+
"description": "Update the patch version (Default: Minor version will be updated)"
6165
},
6266
"Plan": {
6367
"type": "boolean",
@@ -122,7 +126,7 @@
122126
},
123127
"Version": {
124128
"type": "string",
125-
"description": "[Optional] Provide a new version for the package"
129+
"description": "Provide a new version for the package"
126130
}
127131
}
128132
}

src/build.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"currentVersion": "3.2.0"
2+
"currentVersion": "3.2.0"
33
}

src/build/Build.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ internal class Build : NukeBuild
2121
[Parameter("Update the patch version (Default: Minor version will be updated)")]
2222
public bool Patch = false;
2323

24+
[Parameter("Don't update the version (Default: Minor version will be updated)")]
25+
public bool KeepVersion = false;
26+
2427
[Parameter("Provide a new version for the package")]
2528
public readonly string? Version = null;
2629

2730
[Parameter("The path of the doxygen bin directory (Default: C:\\Program Files\\doxygen\\bin)")]
2831
public readonly string DoxygenBin = "C:\\Program Files\\doxygen\\bin";
2932

30-
[Parameter("Sets that no docs should be created (Default: Automaticly updating the version from the build config)")]
33+
[Parameter("Sets that no docs should be created (Default: Automatically updating the version from the build config)")]
3134
public readonly bool NoDocs = false;
3235

3336
[Solution]
@@ -108,13 +111,19 @@ internal class Build : NukeBuild
108111
return;
109112
}
110113

114+
if (KeepVersion)
115+
{
116+
_workingVersion = version.ToString();
117+
return;
118+
}
119+
111120
if (Major && Patch)
112121
{
113122
// Cancel the build process
114123
Assert.Fail("Can't update major and patch at the same time");
115124
}
116125

117-
if (Major || Patch)
126+
if ((Major || Patch))
118127
{
119128
if (Major)
120129
{

0 commit comments

Comments
 (0)