Repository navigation
Incrementality for CoreGenerateAssemblyInfo - #276
Conversation
Fixes (the first part of) #275. The CoreGenerateAssemblyInfo target was always executing and always writing code to the assemblyinfo source file, causing unnecessary rebuilds. Since this solution adopts the standard "all relevant imported projects" approach to did-a-property-change, I also made sure the GenerateAssemblyInfo.targets file used that pattern--but I did not check for that pattern elsewhere.
| <Target Name="CoreGenerateAssemblyInfo" | ||
| Condition="'$(Language)'=='VB' or '$(Language)'=='C#'"> | ||
| Condition="'$(Language)'=='VB' or '$(Language)'=='C#'" | ||
| Inputs="$(MSBuildAllProjects)" |
There was a problem hiding this comment.
Should the Inputs/Outputs get removed from GenerateAssemblyInfo?
There was a problem hiding this comment.
They are indeed irrelevant there since it doesn't do anything.
There was a problem hiding this comment.
Another silly question - since this is the target that depends on PrepareForBuild;GetAssemblyVersion, shouldn't the dependencies go here? And then if you do that, should the whole GenerateAssemblyInfo and CoreGenerateAssemblyInfo be collapsed?
There was a problem hiding this comment.
Or is this how you get GetAssemblyVersion to run all the time, even if it isn't needed?
There was a problem hiding this comment.
@nguerrera do you remember why it's structured this way? it does force GetAssemblyVersion to run which is probably desirable.
There was a problem hiding this comment.
IIRC, I structured it this way so a new language, say F# could override only CoreGenerate. I misunderstood how inputs/outputs work with respect to DependsOnTargets. I wanted it to take care of as much as I could in non-core and let the overrides handle the rest. Maybe that's not worth it now that it doesn't work as I thought it did. (I thought if inputs and outputs were up to date, it wouldn't run its dependencies.)
There was a problem hiding this comment.
I thought if inputs and outputs were up to date, it wouldn't run its dependencies.
Me too! learn something new everyday
There was a problem hiding this comment.
I think it is desirable for GetAssemblyVersion to run always though that wasn't actually my primary objective, I was trying to make it so overrides don't have to repeat what happens before/after core. This is still the case so I think we should keep the split.
|
This shaves off almost a second on my machine! |
|
What's the second part of #275 |
|
No specific second part @nguerrera, I'm just leery of saying an incrementality problem is fixed: it's almost always an onion-peeling exercise. |
|
On my machine (with @rainersigwald fix), incremental builds are down to half a second: |
|
Thanks, @rainersigwald for the quick diagnosis and contributing the fix! |
Add SHA*CryptoServiceProvider APIs to .NET Standard
Fixes (the first part of) #275.
The CoreGenerateAssemblyInfo target was always executing and always
writing code to the assemblyinfo source file, causing unnecessary
rebuilds.
Since this solution adopts the standard "all relevant imported projects"
approach to did-a-property-change, I also made sure the
GenerateAssemblyInfo.targets file used that pattern--but I did not check
for that pattern elsewhere.