如果我指定“OutputType”与省略此设置,GitVersion 别名返回的对象不同是否正常?
如果我指定输出类型,则返回对象的属性都是“空”,但是当我省略设置时,属性被设置为预期值
例如:
Task("Version")
.Does(() =>
{
var versionInfo = GitVersion(new GitVersionSettings()
{
UpdateAssemblyInfo = true,
OutputType = GitVersionOutput.BuildServer
});
Information("MajorMinorPatch: {0}", versionInfo.MajorMinorPatch);
Information("FullSemVer: {0}", versionInfo.FullSemVer);
Information("InformationalVersion: {0}", versionInfo.InformationalVersion);
Information("LegacySemVer: {0}", versionInfo.LegacySemVer);
Information("Nuget v1 version: {0}", versionInfo.NuGetVersion);
Information("Nuget v2 version: {0}", versionInfo.NuGetVersionV2);
});
输出是:
MajorMinorPatch: [NULL]
FullSemVer: [NULL]
InformationalVersion: [NULL]
LegacySemVer: [NULL]
Nuget v1 version: [NULL]
Nuget v2 version: [NULL]
如果我像这样改变我的任务:
Task("Version")
.Does(() =>
{
var versionInfo = GitVersion(new GitVersionSettings()
{
UpdateAssemblyInfo = false
});
Information("MajorMinorPatch: {0}", versionInfo.MajorMinorPatch);
Information("FullSemVer: {0}", versionInfo.FullSemVer);
Information("InformationalVersion: {0}", versionInfo.InformationalVersion);
Information("LegacySemVer: {0}", versionInfo.LegacySemVer);
Information("Nuget v1 version: {0}", versionInfo.NuGetVersion);
Information("Nuget v2 version: {0}", versionInfo.NuGetVersionV2);
});
输出是:
MajorMinorPatch: 0.1.0
FullSemVer: 0.1.0+1
InformationalVersion: 0.1.0+1.Branch.master.Sha.5b2
LegacySemVer: 0.1.0
Nuget v1 version: 0.1.0
Nuget v2 version: 0.1.0