'OutputType'とこの設定を省略した場合、GitVersionエイリアスによって返されるオブジェクトが異なるのは正常ですか?GitVersionから返されたオブジェクトに一貫性がありません
Iは、出力タイプを指定すると、返されたオブジェクトのプロパティは全て「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
これは「設計上の」ものですが、私には少なくとも驚きの原則に違反しているようです。 – Schneider
私は同意しません。ここでの "デザイン"は、GitVersionで最初に変更を加えずに、Cakeで行うことができることはまったくないということです。これが完了すると、Cakeは新しい機能を利用し、必要に応じて変数を返します。 –