public override bool Execute()
{
try
{
string text = SimpleRepositoryInfo.FormatAssemblyVersionAttributesFile(MajorMinor, AssemblyFileVersionInfo, SemVer, "SimpleGitVersionTask", AssemblyInformationalVersionInfo);
this.LogInfo(string.Format("SimpleGitVersionTask ({3}): AssemblyVersion = '{0}', AssemblyFileVersion = '{1}', AssemblyInformationalVersion = '{2}'.", MajorMinor, AssemblyFileVersionInfo, AssemblyInformationalVersionInfo, SimpleRepositoryInfo.SGVSemVer));
if (!Directory.Exists(IntermediateOutputPath))
{
this.LogInfo(string.Format("Creating IntermediateOutputPath='{0}' directory.", IntermediateOutputPath));
Directory.CreateDirectory(IntermediateOutputPath);
}
AssemblyInfoTempFilePath = Path.Combine(IntermediateOutputPath, "SimpleGitVersionTaskAssemblyInfo.g.cs");
File.WriteAllText(AssemblyInfoTempFilePath, text);
return(true);
}
catch (Exception exception)
{
this.LogError("Error occurred: " + exception);
return(false);
}
}