-
Notifications
You must be signed in to change notification settings - Fork 655
Use defined project intermediate directory if it exists #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…jectDir)/obj/$(Configuration)
@SimonCropp when you have a second, can you take a look at this one? Thanks! |
I think you have deleted some code that checks if the ProjectDir (now IntermediateOutputPath) is null and tracks the temporary file. In the tests a Mock is used so the variables are not set. Think it should be void CreateTempAssemblyInfo(CachedVersion semanticVersion, Config configuration)
{
var assemblyInfoBuilder = new AssemblyInfoBuilder
{
CachedVersion = semanticVersion
};
var assemblyInfo = assemblyInfoBuilder.GetAssemblyInfoText(configuration);
string tempFileName, tempDir;
if (string.IsNullOrEmpty(IntermediateOutputPath) || string.IsNullOrWhiteSpace(IntermediateOutputPath))
{
tempDir = TempFileTracker.TempPath;
tempFileName = string.Format("AssemblyInfo_{0}_{1}.g.cs", Path.GetFileNameWithoutExtension(ProjectFile), Path.GetRandomFileName());
}
else
{
tempDir = Path.Combine(IntermediateOutputPath, "obj", Configuration);
Directory.CreateDirectory(tempDir);
tempFileName = string.Format("GitVersionTaskAssemblyInfo.g.cs");
}
AssemblyInfoTempFilePath = Path.Combine(tempDir, tempFileName);
File.WriteAllText(AssemblyInfoTempFilePath, assemblyInfo);
} Thanks |
Sorry about that, and for the delay getting back to this. |
This looks ok to me, but looks like a breaking change. @SimonCropp thoughts? |
Yeah in the strict sense this is breaking change |
Do we care? Should we take this into v3 which has the config changes and other breaking stuff. Or just merge and put into next minor release? |
i think next minor is OK. i doubt many people are using the task on its own. and even if they do it will fail at buid time |
Use defined project intermediate directory if it exists
Fixes #332