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 all 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>
2 changes: 1 addition & 1 deletion UITests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The easiest way to deploy the WinUI 3 Gallery for unit test execution is to simp
1. Build and publish the WinUI 3 Gallery from the command line, e.g.:

```shell
>dotnet.exe publish WinUIGallery\WinUIGallery.sln /p:AppxPackageDir=AppxPackages\ /p:platform=x64 /p:PublishProfile=./WinUIGallery/Properties/PublishProfiles/win10-x64.pubxml
>dotnet.exe publish WinUIGallery\WinUIGallery.sln /p:AppxPackageDir=AppxPackages\ /p:platform=x64 /p:PublishProfile=./WinUIGallery/Properties/PublishProfiles/win-x64.pubxml
```

1. Locate the WinUI 3 Gallery package output folder from above and deploy for testing:
Expand Down
16 changes: 6 additions & 10 deletions UITests/UITests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
</PropertyGroup>

<!-- Build output related paths -->
<PropertyGroup>
<ProjectRoot>$(MSBuildThisFileDirectory)..\</ProjectRoot>
<ArtifactsBinRoot>$(MSBuildThisFileDirectory)\bin\</ArtifactsBinRoot>
<TestBinplaceDestinationPath>\$(Platform)\$(Configuration)\$(TargetFramework)</TestBinplaceDestinationPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="4.4.0" />
<PackageReference Include="Axe.Windows" Version="2.1.0" />
Expand All @@ -23,7 +16,10 @@
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
</ItemGroup>

<Target Name="CopyControlInfoData" AfterTargets="AfterBuild">
<Copy SourceFiles="$(ProjectRoot)\WinUIGallery\DataModel\ControlInfoData.json" DestinationFiles="$(ArtifactsBinRoot)\$(TestBinplaceDestinationPath)\ControlInfoData.json" />
</Target>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\WinUIGallery\DataModel\ControlInfoData.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</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