Skip to content

Commit 01984d3

Browse files
committed
Merge
2 parents bd6ec8a + d71b08b commit 01984d3

File tree

10 files changed

+65
-45
lines changed

10 files changed

+65
-45
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,12 @@ jobs:
283283
- name: Generate solution
284284
shell: pwsh
285285
working-directory: ./
286-
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
286+
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -MultiTargets wasm
287287

288-
# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
289-
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
290288
- name: dotnet build
291-
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
292-
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
289+
shell: pwsh
290+
working-directory: ./
291+
run: ./tooling/Build-Toolkit-Components.ps1 -Release -MultiTargets wasm ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -BinlogOutput ./ -EnableBinLogs' || '' }}
293292

294293
# TODO: Do we want to run tests here? Can we do that on linux easily?
295294

Build-Toolkit-Components.ps1

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,21 @@ function Invoke-MSBuildWithBinlog {
124124
)
125125

126126
# Reset build args to default
127-
$msbuildArgs = @("-r", "-m", "/p:DebugType=Portable")
127+
$msbuildArgs = @("/p:DebugType=Portable")
128+
129+
# Add "-r" parameter if not running on linux
130+
if ($($PSVersionTable.Platform) -ne "Unix") {
131+
$msbuildArgs += "-r"
132+
}
133+
# Otherwise, add "-restore" parameter
134+
else {
135+
$msbuildArgs += "-restore"
136+
}
137+
138+
# Add "-m" parameter if not running on linux
139+
if ($($PSVersionTable.Platform) -ne "Unix") {
140+
$msbuildArgs += "-m"
141+
}
128142

129143
# Add packing to the msbuild arguments if NupkgOutput is supplied
130144
if ($NupkgOutput) {
@@ -170,7 +184,13 @@ function Invoke-MSBuildWithBinlog {
170184
$msbuildArgs += "/v:detailed"
171185
}
172186

173-
msbuild $msbuildArgs $TargetHeadPath
187+
# If platform is linux, use dotnet instead of msbuild
188+
if ($($PSVersionTable.Platform) -eq "Unix") {
189+
dotnet build $msbuildArgs $TargetHeadPath
190+
}
191+
else {
192+
msbuild $msbuildArgs $TargetHeadPath
193+
}
174194
}
175195

176196
# Components are built individually
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<Project>
22
<PropertyGroup>
3-
<UwpTargetFramework>uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>
4-
<WinAppSdkTargetFramework>net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0;</WinAppSdkTargetFramework>
3+
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == ''">uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>
4+
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0;</WinAppSdkTargetFramework>
55

6-
<WasmHeadTargetFramework>net8.0</WasmHeadTargetFramework>
7-
<LinuxHeadTargetFramework>net8.0</LinuxHeadTargetFramework>
8-
<WpfHeadTargetFramework>net8.0</WpfHeadTargetFramework>
6+
<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0</WasmHeadTargetFramework>
7+
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0</LinuxHeadTargetFramework>
8+
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0</WpfHeadTargetFramework>
99

10-
<AndroidLibTargetFramework>net8.0-android34.0</AndroidLibTargetFramework>
11-
<MacOSLibTargetFramework>net8.0-maccatalyst</MacOSLibTargetFramework>
12-
<iOSLibTargetFramework>net8.0-ios</iOSLibTargetFramework>
10+
<AndroidLibTargetFramework Condition="'$(AndroidLibTargetFramework)' == ''">net8.0-android34.0</AndroidLibTargetFramework>
11+
<MacOSLibTargetFramework Condition="'$(MacOSLibTargetFramework)' == ''">net8.0-maccatalyst</MacOSLibTargetFramework>
12+
<iOSLibTargetFramework Condition="'$(iOSLibTargetFramework)' == ''">net8.0-ios</iOSLibTargetFramework>
1313

1414
<!-- Used for comparison to current TargetFramework -->
15-
<LinuxLibTargetFramework>net8.0</LinuxLibTargetFramework>
16-
<WasmLibTargetFramework>net8.0</WasmLibTargetFramework>
17-
<WpfLibTargetFramework>net8.0</WpfLibTargetFramework>
15+
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0</LinuxLibTargetFramework>
16+
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0</WasmLibTargetFramework>
17+
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0</WpfLibTargetFramework>
1818

1919
<!-- Used for defining TargetFramework under platforms that need it -->
20-
<DotnetStandardCommonTargetFramework>netstandard2.0</DotnetStandardCommonTargetFramework>
21-
<DotnetCommonTargetFramework>net8.0</DotnetCommonTargetFramework>
20+
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0</DotnetStandardCommonTargetFramework>
21+
<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net8.0</DotnetCommonTargetFramework>
2222
</PropertyGroup>
2323
</Project>
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<Project>
22
<PropertyGroup>
3-
<UwpTargetFramework>uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>
4-
<WinAppSdkTargetFramework>net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0;</WinAppSdkTargetFramework>
3+
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == ''">uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>
54

6-
<WasmHeadTargetFramework>net8.0</WasmHeadTargetFramework>
7-
<LinuxHeadTargetFramework>net8.0</LinuxHeadTargetFramework>
8-
<WpfHeadTargetFramework>net8.0</WpfHeadTargetFramework>
5+
6+
<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0</WasmHeadTargetFramework>
7+
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0</LinuxHeadTargetFramework>
8+
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0</WpfHeadTargetFramework>
99

1010

1111

1212

1313

1414
<!-- Used for comparison to current TargetFramework -->
15-
<LinuxLibTargetFramework>net8.0</LinuxLibTargetFramework>
16-
<WasmLibTargetFramework>net8.0</WasmLibTargetFramework>
17-
<WpfLibTargetFramework>net8.0</WpfLibTargetFramework>
15+
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0</LinuxLibTargetFramework>
16+
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0</WasmLibTargetFramework>
17+
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0</WpfLibTargetFramework>
1818

1919
<!-- Used for defining TargetFramework under platforms that need it -->
20-
<DotnetStandardCommonTargetFramework>netstandard2.0</DotnetStandardCommonTargetFramework>
21-
<DotnetCommonTargetFramework>net8.0</DotnetCommonTargetFramework>
20+
21+
2222
</PropertyGroup>
2323
</Project>

MultiTarget/MultiTargetIdentifiers.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
This property is only for changing the version used by Uno.
5858
Force the version to 2 for UWP and 3 for WinAppSDK.
5959
-->
60-
<WinUIMajorVersion Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true'">2</WinUIMajorVersion>
61-
<WinUIMajorVersion Condition="'$(HasWinUI)' == 'true' AND '$(IsWinAppSdk)' == 'true'">3</WinUIMajorVersion>
60+
<WinUIMajorVersion Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true' AND $(WinUIMajorVersion) == ''">2</WinUIMajorVersion>
61+
<WinUIMajorVersion Condition="'$(HasWinUI)' == 'true' AND '$(IsWinAppSdk)' == 'true' AND $(WinUIMajorVersion) == ''">3</WinUIMajorVersion>
6262

6363
<UseUwp Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true' AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true</UseUwp>
6464
<UseUwpTools Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true' AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true</UseUwpTools>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<Project>
22
<ItemGroup>
3-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />
4-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
5-
</ItemGroup>
6-
<ItemGroup>
7-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.1" />
3+
<PackageReference Condition="'$(HasWinUI)' == 'true'" Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
4+
<PackageReference Condition="'$(HasWinUI)' == 'true'" Include="Microsoft.Web.WebView2" Version="1.0.2792.45" PrivateAssets="all" />
85
</ItemGroup>
96
</Project>

MultiTarget/UseTargetFrameworks.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $DroidTfm = "AndroidLibTargetFramework";
4242
$NetstandardTfm = "DotnetStandardCommonTargetFramework";
4343

4444
$fileContents = Get-Content -Path $PSScriptRoot/AvailableTargetFrameworks.props
45+
$newFileContents = $fileContents;
4546

4647
# 'all' represents many '$MultiTargets' values
4748
if ($MultiTargets.Contains("all")) {
@@ -105,10 +106,12 @@ $targetFrameworksToRemove = @(
105106
$NetstandardTfm
106107
).Where({ -not $desiredTfmValues.Contains($_) })
107108

108-
$targetFrameworksToRemoveRegexPartial = $targetFrameworksToRemove -join "|";
109-
110-
$newFileContents = $fileContents -replace "<(?:$targetFrameworksToRemoveRegexPartial)>.+?>", '';
109+
# When targetFrameworksToRemoveRegexPartial is empty, the regex will match everything.
110+
# To work around this, check if there's anything to remove before doing it.
111+
if ($targetFrameworksToRemove.Length -gt 0) {
112+
$targetFrameworksToRemoveRegexPartial = "$($targetFrameworksToRemove -join "|")";
113+
$newFileContents = $fileContents -replace "<(?:$targetFrameworksToRemoveRegexPartial).+?>.+?>", '';
114+
}
111115

112116
Set-Content -Force -Path $PSScriptRoot/EnabledTargetFrameworks.props -Value $newFileContents;
113-
114-
Write-Output "Done. Please close and regenerate your solution. Do not commit these changes to the tooling repository."
117+
Write-Output "Done. Please close and regenerate your solution. Do not commit these changes to the tooling repository."

MultiTarget/WinUI.Extra.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
4242
<RuntimeIdentifiers Condition="8 > $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
4343

44-
<WindowsSdkPackageVersion Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">10.0.22621.41</WindowsSdkPackageVersion>
45-
<WindowsSdkPackageVersion Condition="8 > $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))">10.0.22621.38</WindowsSdkPackageVersion>
44+
<!--- Workaround for ADO 53865998 - See https://github.com/CommunityToolkit/Tooling-Windows-Submodule/issues/215 - Don't include extraneous WebView2 dll -->
45+
<WebView2NeverCopyLoaderDllToOutputDirectory>true</WebView2NeverCopyLoaderDllToOutputDirectory>
4646
</PropertyGroup>
4747

4848
<PropertyGroup Condition="'$(IsUno)' == 'true'">

ProjectHeads/Head.WinAppSdk.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<EnableMsixTooling>true</EnableMsixTooling>
1010
<WindowsAppContainer>true</WindowsAppContainer>
1111
<ApplicationManifest>app.manifest</ApplicationManifest>
12+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1213
</PropertyGroup>
1314

1415
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\PackageReferences\WinAppSdk.props" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.201",
3+
"version": "8.0.403",
44
"rollForward": "latestFeature"
55
},
66
"msbuild-sdks":

0 commit comments

Comments
 (0)