「OutputType」を指定した場合と、この設定を省略した場合で、GitVersion エイリアスによって返されるオブジェクトが異なるのは正常ですか?
出力タイプを指定すると、返されるオブジェクトのプロパティはすべて「null」になりますが、設定を省略すると、プロパティは期待値に設定されます
例えば:
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