Skip to content
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

Update to support submodule builds #1498

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" Condition="Exists($([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')))" />

<!-- Building both in the WinUI repo and standalone, WinUIGallery's dependencies now require latest SDKs -->
<PropertyGroup>
<SamplesTargetFrameworkMoniker>net8.0-windows10.0.22621.0</SamplesTargetFrameworkMoniker>
<WindowsSdkTargetPlatformVersion>10.0.22621.756</WindowsSdkTargetPlatformVersion>
<WindowsAppSdkTargetPlatformVersion>10.0.17763.0</WindowsAppSdkTargetPlatformVersion>
<MicrosoftWindowsSDKBuildToolsNugetPackageVersion>10.0.22621.756</MicrosoftWindowsSDKBuildToolsNugetPackageVersion>
</PropertyGroup>

<!-- If we aren't building in the WinUI repo, import the necessary missing props we'd normally pick up from its Directory.Build.props hierarchy -->
<!-- The UseStandalone property allows this to be overridden, in order to buildSamples to build without changing the entire repo -->
<Import Project="Standalone.props" Condition="'$(IsInWinUIRepo)' != 'true' OR '$(UseStandalone)' == 'true'"/>

<!-- Temporary workaround until WinAppSDK 1.5.2 provides fix -->
<Target Name="RemoveConflictingDepsJsonFiles" AfterTargets="GetPackagingOutputs">
<!-- If conflicting build and publish deps.json files exist in this or referenced projects,
use only the publish deps.json files, and remove the corresponding build deps.json files. -->
<ItemGroup>
<_PublishPackagingOutputs Include="@(PackagingOutputs->HasMetadata('CopyToPublishDirectory'))"/>
<_PublishDepsJsonFiles Include="@(_PublishPackagingOutputs)"
Condition="'@(_PublishPackagingOutputs)' != '' and $([System.String]::Copy(%(FileName)%(Extension)).EndsWith('.deps.json'))" />
<PackagingOutputs Remove="@(_PublishDepsJsonFiles)" MatchOnMetadata="TargetPath"/>
<PackagingOutputs Include="@(_PublishDepsJsonFiles)"/>
</ItemGroup>
</Target>

</Project>
4 changes: 0 additions & 4 deletions WinUIGallery/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@
<PropertyGroup Condition="'$(IsInWinUIRepo)' != 'true' AND '$(BuildAllAppFlavors)' == ''">
<BuildAllAppFlavors>true</BuildAllAppFlavors>
</PropertyGroup>

<!-- If we aren't building in the WinUI repo, import the necessary missing props we'd normally pick up from its Directory.Build.props hierarchy -->
<!-- The UseStandalone property allows this to be overridden, in order to buildReleaseSamples to build without changing the entire repo -->
<Import Project="Standalone.props" Condition="'$(IsInWinUIRepo)' != 'true' OR '$(UseStandalone)' == 'true'"/>
</Project>
4 changes: 2 additions & 2 deletions WinUIGalleryUnitTests/WinUIGalleryUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\WinUIGallery\standalone.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>$(SamplesTargetFrameworkMoniker)</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformVersion>$(WindowsSdkTargetPlatformVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(WindowsAppSdkTargetPlatformVersion)</TargetPlatformMinVersion>
<RootNamespace>WinUIGalleryUnitTests</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
Expand Down
4 changes: 0 additions & 4 deletions WinUIGallery/standalone.props → standalone.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<Project>
<PropertyGroup>
<!-- The NuGet versions of dependencies to build against. -->
<SamplesTargetFrameworkMoniker>net8.0-windows10.0.22621.0</SamplesTargetFrameworkMoniker>
<WindowsAppSdkPackageVersion>1.5.240227000</WindowsAppSdkPackageVersion>
<MicrosoftNETCoreUniversalWindowsPlatformVersion>6.2.11</MicrosoftNETCoreUniversalWindowsPlatformVersion>
<GraphicsWin2DVersion>1.0.4</GraphicsWin2DVersion>
<ColorCodeVersion>2.0.13</ColorCodeVersion>
<CommunityToolkitWinUIVersion>8.0.230907</CommunityToolkitWinUIVersion>
<WindowsSdkTargetPlatformVersion>10.0.22621.756</WindowsSdkTargetPlatformVersion>
<MicrosoftWindowsSDKBuildToolsNugetPackageVersion>10.0.22621.756</MicrosoftWindowsSDKBuildToolsNugetPackageVersion>
<WindowsAppSdkTargetPlatformVersion>10.0.17763.0</WindowsAppSdkTargetPlatformVersion>
<MicrosoftCsWinRTPackageVersion>2.0.3</MicrosoftCsWinRTPackageVersion>
<!-- We have multiple projects in the same directory, which means we need to separate their output paths-->
<BaseIntermediateOutputPath>obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
Expand Down