-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CoreResGen should use Inputs in Microsoft.Common.CurrentVersion.targets #365
Comments
The reason is obliquely hidden in the doc comment for that method: /// <summary>
/// Determines if the given output file is up to date with respect to the
/// the given input file by comparing timestamps of the two files as well as
/// (if the source is a .resx) the linked files inside the .resx file itself
/// </summary>
/// <param name="sourceFilePath"></param>
/// <param name="outputFilePath"></param>
/// <returns></returns>
private bool ShouldRebuildResgenOutputFile(string sourceFilePath, string outputFilePath) Because the Since the linked files are listed in the @tverboon can you elaborate on what difficulties you're having as a result of this? |
Thank you for response. I realized this when I was trying to customize a target in MSBuild and I was figuring out what the inputs should be. Some background on what I am trying to accomplish. We have a build consisting of hundreds of projects, we can already successfully build these incrementally, but a build of a project that is referenced by other projects will cause a chain reaction in builds, because the referenced assembly has changed. I am trying to prevent this by analyzing the assembly in a custom task after build for the public methods and writing this to a file based on target path. I am using these files in the next build as Input for a custom CoreCompile. Instead of the References, I use my generated files. This works, but then the GenerateResources task is using the References to determine if it should rebuild resgen output file and it should because the reference is updated. Because the Resgen output is updated, this again causes a rebuild of the project because the inputs of the resource is newer. Obviously this is right, because in my scenario the build won’t be 100% correct in all cases, but a simple rebuild of the referenced project will fix this. We still have to investigate if performance gains are big enough to take the initial penalty and the fact that it won’t be correct with resources. Thanks again.
|
@tverboon I'm going to close this since I don't think we can do any better in the core MSBuild engine. However, you may be interested in some work that Roslyn is doing to produce deterministic outputs from the compiler (dotnet/roslyn#372) and explicit reference assemblies from the compiler (dotnet/roslyn#2184). Those changes, with restructured C# targets that use them, will enable stopping the rebuilt-reference cascade. |
…0312.2 (dotnet#365) - Microsoft.Dotnet.Toolset.Internal - 3.1.201-servicing.20162.2 Dependency coherency updates - Microsoft.DotNet.Cli.Runtime - 3.1.201-servicing.20162.1 (parent: Microsoft.Dotnet.Toolset.Internal) Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
CoreResGen Target in Microsoft.Common.CurrentVersion.targets doesn't use inputs, but the timestamps of references are checked in GenerateResource.cs -> ShouldRebuildResgenOutputFile
Why? Targets like CoreCompile also have a huge list of inputs and outputs.
Because this is part of the task, it makes it harder and to extend / override this part of the build.
The text was updated successfully, but these errors were encountered: