diff --git a/GitVersionTask/AssemblyInfoBuilder/UpdateAssemblyInfo.cs b/GitVersionTask/AssemblyInfoBuilder/UpdateAssemblyInfo.cs index 14ed69be2f..91bfd32352 100644 --- a/GitVersionTask/AssemblyInfoBuilder/UpdateAssemblyInfo.cs +++ b/GitVersionTask/AssemblyInfoBuilder/UpdateAssemblyInfo.cs @@ -27,10 +27,7 @@ public class UpdateAssemblyInfo : Task public string ProjectFile { get; set; } [Required] - public string ProjectDir { get; set; } - - [Required] - public string Configuration { get; set; } + public string IntermediateOutputPath { get; set; } [Required] public ITaskItem[] CompileFiles { get; set; } @@ -138,14 +135,14 @@ void CreateTempAssemblyInfo(CachedVersion semanticVersion, Config configuration) var assemblyInfo = assemblyInfoBuilder.GetAssemblyInfoText(configuration); string tempFileName, tempDir; - if (string.IsNullOrEmpty(ProjectDir) || string.IsNullOrWhiteSpace(ProjectDir)) + if (IntermediateOutputPath == null) { tempDir = TempFileTracker.TempPath; tempFileName = string.Format("AssemblyInfo_{0}_{1}.g.cs", Path.GetFileNameWithoutExtension(ProjectFile), Path.GetRandomFileName()); } else { - tempDir = Path.Combine(ProjectDir, "obj", Configuration); + tempDir = Path.Combine(IntermediateOutputPath, "obj", assemblyInfo); Directory.CreateDirectory(tempDir); tempFileName = string.Format("GitVersionTaskAssemblyInfo.g.cs"); } @@ -154,4 +151,4 @@ void CreateTempAssemblyInfo(CachedVersion semanticVersion, Config configuration) File.WriteAllText(AssemblyInfoTempFilePath, assemblyInfo); } } -} \ No newline at end of file +} diff --git a/GitVersionTask/NugetAssets/GitVersionTask.targets b/GitVersionTask/NugetAssets/GitVersionTask.targets index 75f4f3b558..fefc9f7fd9 100644 --- a/GitVersionTask/NugetAssets/GitVersionTask.targets +++ b/GitVersionTask/NugetAssets/GitVersionTask.targets @@ -2,8 +2,7 @@ $(MSBuildProjectDirectory)..\ - - + $(MSBuildProjectDirectory)obj\$(Configuration)\ @@ -24,9 +23,8 @@ />