Skip to content

Commit ad52bec

Browse files
committed
update to better property name per review
1 parent 119c2a5 commit ad52bec

File tree

8 files changed

+21
-23
lines changed

8 files changed

+21
-23
lines changed

docs/input/docs/usage/msbuild.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,24 @@ variables: `Version`, `VersionPrefix`, `VersionSuffix`, `PackageVersion`,
260260

261261
### Namespace generation
262262

263-
You can configure GitVersion to generate the `GitVersionInformation` class in a namespace that matches the current assembly. By default this class is created in the global namespace. If `GenerateGitVersionInformationInUniqueNamespace` is set to true, the `GitVersionInfomation` class will instead be generated in a namespace matching the current project. If the property `<RootNamespace>` is set that value will be used, otherwise the name of the project file is used.
263+
You can configure GitVersion to generate the `GitVersionInformation` class in a namespace that matches the current assembly. By default this class is created in the global namespace. If `UseProjectNamespaceForGitVersionInformation` is set to true, the `GitVersionInfomation` class will instead be generated in a namespace matching the current project. If the property `<RootNamespace>` is set that value will be used, otherwise the name of the project file is used.
264264

265265
```xml
266266
<PropertyGroup>
267267
...
268-
<GenerateGitVersionInformationInUniqueNamespace>true</GenerateGitVersionInformationInUniqueNamespace>
268+
<UseProjectNamespaceForGitVersionInformation>true</UseProjectNamespaceForGitVersionInformation>
269269
...
270270
</PropertyGroup>
271271
```
272272

273273
## Extra properties
274274

275-
There are properties that correspont to certain
275+
There are properties that correspont to certain
276276
[command line arguments](/docs/usage/cli/arguments) for GetVersion task.
277-
In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch`
278-
during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables
277+
In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch`
278+
during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables
279279
normalize step on a build server, setting `GitVersion_NoCacheEnabled` to `true`
280-
makes GetVersion ignore cache. All the rest command line arguments can be passed via
280+
makes GetVersion ignore cache. All the rest command line arguments can be passed via
281281
`GitVersion_CommandLineArguments` variable.
282282

283283
## My Git repository requires authentication. What should I do?

src/GitVersion.Core/Options/GitVersionOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class GitVersionOptions
1313
public WixInfo WixInfo { get; } = new();
1414
public Settings Settings { get; } = new();
1515

16-
public bool UniqueNamespace { get; set; }
16+
1717

1818
public bool Init;
1919
public bool Diag;

src/GitVersion.Core/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,5 +943,3 @@ virtual GitVersion.Agents.BuildAgentBase.IsDefault.get -> bool
943943
virtual GitVersion.Agents.BuildAgentBase.PreventFetch() -> bool
944944
virtual GitVersion.Agents.BuildAgentBase.ShouldCleanUpRemotes() -> bool
945945
virtual GitVersion.Agents.BuildAgentBase.WriteIntegration(System.Action<string?>! writer, GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber = true) -> void
946-
GitVersion.GitVersionOptions.UniqueNamespace.get -> bool
947-
GitVersion.GitVersionOptions.UniqueNamespace.set -> void

src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA
219219
}
220220

221221
[TestCaseSource(nameof(Languages))]
222-
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUniqueNamespaceIsSpecifiedAndRootNamespaceIsSet(string language)
222+
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUseProjectNamespaceIsSpecifiedAndRootNamespaceIsSet(string language)
223223
{
224224
const string taskName = nameof(GenerateGitVersionInformation);
225225
const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath);
@@ -229,7 +229,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA
229229
using var result = ExecuteMsBuildExe(project =>
230230
{
231231
var intermediateOutputPath = Path.Combine("$(MSBuildProjectDirectory)", randDir);
232-
AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("GenerateGitVersionInformationInUniqueNamespace", "True").Property("RootNamespace", "Test.Root");
232+
AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("UseProjectNamespaceForGitVersionInformation", "True").Property("RootNamespace", "Test.Root");
233233
}, language);
234234

235235
result.ProjectPath.ShouldNotBeNullOrWhiteSpace();
@@ -253,7 +253,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA
253253
}
254254

255255
[TestCaseSource(nameof(Languages))]
256-
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUniqueNamespaceIsSpecifiedAndRootNamespaceIsNotSet(string language)
256+
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUseProjectNamespaceIsSpecifiedAndRootNamespaceIsNotSet(string language)
257257
{
258258
const string taskName = nameof(GenerateGitVersionInformation);
259259
const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath);
@@ -263,7 +263,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA
263263
using var result = ExecuteMsBuildExeInAzurePipeline(project =>
264264
{
265265
var intermediateOutputPath = Path.Combine("$(MSBuildProjectDirectory)", randDir);
266-
AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("GenerateGitVersionInformationInUniqueNamespace", "True");
266+
AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("UseProjectNamespaceForGitVersionInformation", "True");
267267
}, language);
268268

269269
result.ProjectPath.ShouldNotBeNullOrWhiteSpace();
@@ -285,13 +285,13 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA
285285
}
286286

287287
[TestCaseSource(nameof(Languages))]
288-
public void GenerateGitVersionInformationTaskShouldCreateFileWithUniqueNamespaceSetAndRootNamespaceUnSet(string language)
288+
public void GenerateGitVersionInformationTaskShouldCreateFileWithUseProjectNamespaceSetAndRootNamespaceUnSet(string language)
289289
{
290290
var extension = FileHelper.GetFileExtension(language);
291291
var task = new GenerateGitVersionInformation
292292
{
293293
Language = language,
294-
GenerateGitVersionInformationInUniqueNamespace = "true",
294+
UseProjectNamespaceForGitVersionInformation = "true",
295295
ProjectFile = "App.Project.csproj",
296296
};
297297
using var result = ExecuteMsBuildTask(task);
@@ -311,14 +311,14 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWithUniqueNamespace
311311
}
312312

313313
[TestCaseSource(nameof(Languages))]
314-
public void GenerateGitVersionInformationTaskShouldCreateFileWithUniqueNamespaceSetAndRootNamespaceIsSet(string language)
314+
public void GenerateGitVersionInformationTaskShouldCreateFileWithUseProjectNamespaceSetAndRootNamespaceIsSet(string language)
315315
{
316316

317317
var extension = FileHelper.GetFileExtension(language);
318318
var task = new GenerateGitVersionInformation
319319
{
320320
Language = language,
321-
GenerateGitVersionInformationInUniqueNamespace = "true",
321+
UseProjectNamespaceForGitVersionInformation = "true",
322322
ProjectFile = "App.Project.csproj",
323323
RootNamespace = "App.Project.RootNamespace",
324324
};
@@ -356,7 +356,7 @@ private static ProjectCreator AddGenerateGitVersionInformationTask(ProjectCreato
356356
{ "ProjectFile", "$(MSBuildProjectFullPath)" },
357357
{ "Language", "$(Language)" },
358358
{ "IntermediateOutputPath", intermediateOutputPath },
359-
{ "GenerateGitVersionInformationInUniqueNamespace", "$(GenerateGitVersionInformationInUniqueNamespace)" },
359+
{ "UseProjectNamespaceForGitVersionInformation", "$(UseProjectNamespaceForGitVersionInformation)" },
360360
{ "RootNamespace", "$(RootNamespace)" },
361361
})
362362
.TaskOutputProperty(outputProperty, outputProperty)

src/GitVersion.MsBuild/GitVersionTaskExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void GenerateGitVersionInformation(GenerateGitVersionInformation task)
7878
static string? getTargetNamespace(GenerateGitVersionInformation task)
7979
{
8080
string? targetNamespace = null;
81-
if (string.Equals(task.GenerateGitVersionInformationInUniqueNamespace, "true", StringComparison.OrdinalIgnoreCase))
81+
if (string.Equals(task.UseProjectNamespaceForGitVersionInformation, "true", StringComparison.OrdinalIgnoreCase))
8282
{
8383
targetNamespace = task.RootNamespace;
8484
if (string.IsNullOrWhiteSpace(targetNamespace))

src/GitVersion.MsBuild/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ override GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.OnExecute() -> b
9898
override GitVersion.MsBuild.Tasks.GetVersion.OnExecute() -> bool
9999
override GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.OnExecute() -> bool
100100
override GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog.OnExecute() -> bool
101-
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GenerateGitVersionInformationInUniqueNamespace.get -> string?
102-
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GenerateGitVersionInformationInUniqueNamespace.set -> void
101+
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.UseProjectNamespaceForGitVersionInformation.get -> string?
102+
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.UseProjectNamespaceForGitVersionInformation.set -> void
103103
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.RootNamespace.get -> string!
104104
GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.RootNamespace.set -> void

src/GitVersion.MsBuild/Tasks/GenerateGitVersionInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class GenerateGitVersionInformation : GitVersionTaskBase
1313
[Required]
1414
public string Language { get; set; } = "C#";
1515

16-
public string? GenerateGitVersionInformationInUniqueNamespace { get; set; }
16+
public string? UseProjectNamespaceForGitVersionInformation { get; set; }
1717

1818
public string RootNamespace { get; set; }
1919

src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
ProjectFile="$(MSBuildProjectFullPath)"
102102
IntermediateOutputPath="$(IntermediateOutputPath)"
103103
Language="$(Language)"
104-
GenerateGitVersionInformationInUniqueNamespace="$(GenerateGitVersionInformationInUniqueNamespace)"
104+
UseProjectNamespaceForGitVersionInformation="$(UseProjectNamespaceForGitVersionInformation)"
105105
RootNamespace="$(RootNamespace)">
106106

107107
<Output TaskParameter="GitVersionInformationFilePath" PropertyName="GitVersionInformationFilePath" />

0 commit comments

Comments
 (0)