Commit 69cc38c
committed
Re-run WriteVerifyAttributes when the values change
The up-to-date check compared only $(MSBuildAllProjects) timestamps against the
generated file, but the content comes from $(SolutionDir), $(SolutionName) and
$(TargetFrameworks). So rebuilding with a different /p:SolutionDir or
/p:SolutionName, which is exactly what the DiscoverSolutionInfo warnings tell
users to pass, or building the same project from another solution, skipped the
target and CoreCompile and left stale metadata in the assembly for AttributeReader
and DerivePaths to read at test time. Only a full Rebuild or touching the csproj
cleared it.
The values are now written to a cache file with WriteOnlyWhenDifferent, and that
file is an input, so its timestamp moves only on a real change. Same pattern as
the SDK's GenerateAssemblyInfo.
Verified by building, then rebuilding with /p:SolutionName=OtherSolution: before
this the emitted Verify.SolutionName stayed at the old value, now it updates.1 parent d731cfb commit 69cc38c
1 file changed
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
135 | 157 | | |
136 | 158 | | |
137 | 159 | | |
| |||
0 commit comments