|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
| 2 | +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="NBGV_SetDefaults"> |
3 | 3 | <PropertyGroup> |
4 | 4 | <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> |
5 | 5 |
|
6 | | - <PrepareForBuildDependsOn> |
7 | | - GenerateNativeVersionInfo; |
8 | | - $(PrepareForBuildDependsOn); |
9 | | - </PrepareForBuildDependsOn> |
10 | | - |
11 | | - <PrepareResourcesDependsOn> |
12 | | - GenerateAssemblyVersionInfo; |
13 | | - $(PrepareResourcesDependsOn) |
14 | | - </PrepareResourcesDependsOn> |
15 | | - |
16 | | - <CoreCompileDependsOn> |
17 | | - GenerateAssemblyVersionInfo; |
18 | | - $(CoreCompileDependsOn) |
19 | | - </CoreCompileDependsOn> |
20 | | - |
21 | 6 | <VersionDependsOn> |
22 | 7 | GetNuPkgVersion; |
23 | 8 | $(VersionDependsOn) |
|
33 | 18 | $(GetPackageVersionDependsOn) |
34 | 19 | </GetPackageVersionDependsOn> |
35 | 20 |
|
36 | | - <!-- Suppress assembly version info generation if not obviously compiling an assembly. --> |
37 | | - <GenerateAssemblyVersionInfo Condition=" '$(GenerateAssemblyVersionInfo)' == '' and '$(TargetExt)' != '.dll' and '$(TargetExt)' != '.exe'">false</GenerateAssemblyVersionInfo> |
38 | | - |
39 | 21 | <!-- Suppress version attribute generation in Microsoft.NET.Sdk projects to avoid build failures |
40 | 22 | when two sets of attributes are emitted. --> |
41 | 23 | <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute> |
|
53 | 35 | <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.GetBuildVersion"/> |
54 | 36 | <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.CompareFiles"/> |
55 | 37 |
|
| 38 | + <Target Name="NBGV_SetDefaults"> |
| 39 | + <!-- Workarounds for https://github.com/AArnott/Nerdbank.GitVersioning/issues/404 --> |
| 40 | + <PropertyGroup> |
| 41 | + <!-- $(TargetExt) isn't set at evaluation time for us when built in wpftmp.csproj with manual imports --> |
| 42 | + <!-- Suppress assembly version info generation if not obviously compiling an assembly. --> |
| 43 | + <GenerateAssemblyVersionInfo Condition=" '$(GenerateAssemblyVersionInfo)' == '' and '$(TargetExt)' != '.dll' and '$(TargetExt)' != '.exe'">false</GenerateAssemblyVersionInfo> |
| 44 | + |
| 45 | + <!-- Workaround the property stomping that msbuild does (see https://github.com/microsoft/msbuild/pull/4922) with manual imports. --> |
| 46 | + <PrepareForBuildDependsOn> |
| 47 | + GenerateNativeVersionInfo; |
| 48 | + $(PrepareForBuildDependsOn); |
| 49 | + </PrepareForBuildDependsOn> |
| 50 | + |
| 51 | + <PrepareResourcesDependsOn> |
| 52 | + GenerateAssemblyVersionInfo; |
| 53 | + $(PrepareResourcesDependsOn) |
| 54 | + </PrepareResourcesDependsOn> |
| 55 | + |
| 56 | + <CoreCompileDependsOn> |
| 57 | + GenerateAssemblyVersionInfo; |
| 58 | + $(CoreCompileDependsOn) |
| 59 | + </CoreCompileDependsOn> |
| 60 | + |
| 61 | + </PropertyGroup> |
| 62 | + </Target> |
| 63 | + |
56 | 64 | <PropertyGroup> |
57 | 65 | <!-- Consider building a tag to be more precise than the branch we're building. --> |
58 | 66 | <_NBGV_BuildingRef>$(_NBGV_BuildingTag)</_NBGV_BuildingRef> |
|
0 commit comments