Skip to content

Commit 3d907bf

Browse files
committed
Consolidate Build logic — Design projects only
Rename Platform version to revision — after all that's what it is! Introduce PlatformBaseVersion to hold '10.0' Move UWP specific logic to its own targets
1 parent abcc0e1 commit 3d907bf

File tree

7 files changed

+50
-58
lines changed

7 files changed

+50
-58
lines changed

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
1515
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
1616
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
17-
<DefaultTargetPlatformVersion>18362</DefaultTargetPlatformVersion>
18-
<DefaultTargetPlatformMinVersion>16299</DefaultTargetPlatformMinVersion>
17+
<TargetPlatformBaseVersion>10.0</TargetPlatformBaseVersion>
18+
<TargetPlatformRevision>18362</TargetPlatformRevision>
19+
<TargetPlatformMinRevision>16299</TargetPlatformMinRevision>
1920
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
2021
</PropertyGroup>
2122

Directory.Build.targets

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
11
<Project>
2-
<Choose>
3-
<When Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.16299' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">
4-
<!-- UAP versions for uap10.0 where TPMV isn't implied -->
5-
<PropertyGroup>
6-
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
7-
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
8-
</PropertyGroup>
92

10-
<PropertyGroup Condition="'$(DebugType)' == ''">
11-
<DebugType>Portable</DebugType>
12-
</PropertyGroup>
3+
<PropertyGroup>
4+
<UseUWP Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.16299' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">true</UseUWP>
5+
</PropertyGroup>
136

14-
<ItemGroup>
15-
<SDKReference Condition="'$(UseWindowsDesktopSdk)' == 'true' " Include="WindowsDesktop, Version=$(TargetPlatformVersion)">
16-
<Name>Windows Desktop Extensions for the UWP</Name>
17-
</SDKReference>
18-
<SDKReference Condition="'$(UseWindowsMobileSdk)' == 'true' " Include="WindowsMobile, Version=$(TargetPlatformVersion)">
19-
<Name>Windows Mobile Extensions for the UWP</Name>
20-
</SDKReference>
21-
</ItemGroup>
22-
</When>
23-
</Choose>
24-
257
<Choose>
268
<When Condition="'$(TargetFramework.Contains(`uap10.0`))' == 'false' and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
279
<PropertyGroup>
@@ -31,6 +13,8 @@
3113
</When>
3214
</Choose>
3315

16+
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.Uwp.Build.targets" Condition="'$(UseUWP)' == 'true'"/>
17+
3418
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
3519
<ItemGroup>
3620
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
@@ -39,4 +23,5 @@
3923
</AssemblyAttribute>
4024
</ItemGroup>
4125
</Target>
26+
4227
</Project>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.Design/Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.Design.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
1111
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.Design</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1312
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
15-
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
16-
</PropertyGroup>
17-
<PropertyGroup>
1813
<TargetPlatformVersion>8.1</TargetPlatformVersion>
14+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15+
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
1916
</PropertyGroup>
2017
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2118
<DebugSymbols>true</DebugSymbols>
2219
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\bin\Debug\uap10.0.16299\Design\</OutputPath>
2320
<DebugType>full</DebugType>
2421
<Optimize>false</Optimize>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<DefineConstants>TRACE;DEBUG</DefineConstants>
2623
<PlatformTarget>x86</PlatformTarget>
2724
</PropertyGroup>
2825
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
@@ -33,7 +30,7 @@
3330
<DefineConstants>TRACE</DefineConstants>
3431
</PropertyGroup>
3532
<PropertyGroup>
36-
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
33+
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
3734
</PropertyGroup>
3835
<ItemGroup>
3936
<Reference Include="System.Runtime" />
@@ -110,7 +107,6 @@
110107
</EmbeddedResource>
111108
</ItemGroup>
112109
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
113-
<Target Name="Pack">
114-
<!-- No-op to avoid build error when packing solution from commandline -->
115-
</Target>
110+
<!-- No-op to avoid build error when packing solution from commandline -->
111+
<Target Name="Pack" />
116112
</Project>

Microsoft.Toolkit.Uwp.UI.Controls.Design/Microsoft.Toolkit.Uwp.UI.Controls.Design.csproj

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,17 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
1111
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.Design</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1312
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
15-
<NoWarn>$(NoWarn);0618</NoWarn>
16-
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
17-
</PropertyGroup>
18-
<PropertyGroup>
1913
<TargetPlatformVersion>8.1</TargetPlatformVersion>
14+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15+
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
2016
</PropertyGroup>
2117
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2218
<DebugSymbols>true</DebugSymbols>
2319
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls\bin\Debug\uap10.0.16299\Design\</OutputPath>
2420
<DebugType>full</DebugType>
2521
<Optimize>false</Optimize>
26-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<DefineConstants>TRACE;DEBUG</DefineConstants>
2723
<PlatformTarget>x86</PlatformTarget>
2824
</PropertyGroup>
2925
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
@@ -34,7 +30,8 @@
3430
<DefineConstants>TRACE</DefineConstants>
3531
</PropertyGroup>
3632
<PropertyGroup>
37-
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
33+
<NoWarn>$(NoWarn);0618</NoWarn>
34+
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
3835
</PropertyGroup>
3936
<ItemGroup>
4037
<Reference Include="System.Runtime" />
@@ -137,7 +134,6 @@
137134
<EmbeddedResource Include="Icons\Microsoft.Toolkit.Uwp.UI.Controls.RotatorTile.icon.png" />
138135
</ItemGroup>
139136
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
140-
<Target Name="Pack">
141-
<!-- No-op to avoid build error when packing solution from commandline -->
142-
</Target>
137+
<!-- No-op to avoid build error when packing solution from commandline -->
138+
<Target Name="Pack" />
143139
</Project>

Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Design/Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Design.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,17 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Design</RootNamespace>
1111
<AssemblyName>Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Design</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1312
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
15-
<NoWarn>$(NoWarn);0618</NoWarn>
16-
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
17-
</PropertyGroup>
18-
<PropertyGroup>
1913
<TargetPlatformVersion>8.1</TargetPlatformVersion>
14+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15+
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
2016
</PropertyGroup>
2117
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2218
<DebugSymbols>true</DebugSymbols>
2319
<OutputPath>..\Microsoft.Toolkit.Uwp.UI.Controls.Markdown\bin\Debug\uap10.0.16299\Design\</OutputPath>
2420
<DebugType>full</DebugType>
2521
<Optimize>false</Optimize>
26-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<DefineConstants>TRACE;DEBUG</DefineConstants>
2723
<PlatformTarget>x86</PlatformTarget>
2824
</PropertyGroup>
2925
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
@@ -34,7 +30,7 @@
3430
<DefineConstants>TRACE</DefineConstants>
3531
</PropertyGroup>
3632
<PropertyGroup>
37-
<ValidateFrameworkCompatibility>false</ValidateFrameworkCompatibility>
33+
<AssetTargetFallback>$(AssetTargetFallback);uap10.0.16299</AssetTargetFallback>
3834
</PropertyGroup>
3935
<ItemGroup>
4036
<Reference Include="System.Runtime" />
@@ -111,7 +107,6 @@
111107
</EmbeddedResource>
112108
</ItemGroup>
113109
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114-
<Target Name="Pack">
115-
<!-- No-op to avoid build error when packing solution from commandline -->
116-
</Target>
110+
<!-- No-op to avoid build error when packing solution from commandline -->
111+
<Target Name="Pack" />
117112
</Project>

build/Find-WindowsSDKVersions.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ function Get-SdkVersion
5757
$versions.Add($version) | Out-Null
5858

5959
# Versions may also be specified without the 10.0.xxxxx.0 format in the
60-
# PropertyGroup/DefaultTargetPlatformVersion and PropertyGroup/DefaultTargetPlatformMinVersion
60+
# PropertyGroup/TargetPlatformRevision and PropertyGroup/TargetPlatformMinRevision
6161

6262
# If you want a complete set of SDKs that are required, uncomment the following
63-
# $version = Get-NodeValue $xml 'PropertyGroup/DefaultTargetPlatformMinVersion'
63+
# $version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformMinRevision'
6464
# $versions.Add("10.0." + $version + ".0") | Out-Null
6565

66-
$version = Get-NodeValue $xml 'PropertyGroup/DefaultTargetPlatformVersion'
66+
$version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformRevision'
6767
$versions.Add("10.0." + $version + ".0") | Out-Null
6868
}
6969

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
3+
<!-- 'TargetPlatform*Version' for uap10.0 where TPMV isn't implied -->
4+
<PropertyGroup>
5+
<TargetPlatformVersion>$(TargetPlatformBaseVersion).$(TargetPlatformRevision).0</TargetPlatformVersion>
6+
<TargetPlatformMinVersion>$(TargetPlatformBaseVersion).$(TargetPlatformMinRevision).0</TargetPlatformMinVersion>
7+
<DebugType Condition="'$(DebugType)' == ''">Portable</DebugType>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<SDKReference Include="WindowsDesktop, Version=$(TargetPlatformVersion)" Condition="'$(UseWindowsDesktopSdk)' == 'true'">
12+
<Name>Windows Desktop Extensions for the UWP</Name>
13+
</SDKReference>
14+
<SDKReference Include="WindowsMobile, Version=$(TargetPlatformVersion)" Condition="'$(UseWindowsMobileSdk)' == 'true'">
15+
<Name>Windows Mobile Extensions for the UWP</Name>
16+
</SDKReference>
17+
</ItemGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)