Skip to content

Commit 45029c6

Browse files
committed
Undo temporary hacks and workarounds
1 parent b85e1bc commit 45029c6

File tree

7 files changed

+139
-7
lines changed

7 files changed

+139
-7
lines changed

.github/workflows/build.yml

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
strategy:
6161
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
6262
matrix:
63-
winui: [2, 3] # Temporary until we can get Uno/Wasm working
64-
multitarget: ['uwp', 'wasdk'] # Temporary until we can get Uno/Wasm working
63+
winui: [2, 3]
64+
multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
6565
exclude:
6666
# WinUI 2 not supported on wasdk
6767
- winui: 2
@@ -134,7 +134,42 @@ jobs:
134134

135135
# Generate full solution with all projects (sample gallery heads, components, tests)
136136
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests
137-
run: powershell -version 5.1 -command "./tooling/Build-Toolkit-Components.ps1 -Components DependencyPropertyGenerator -Release -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop
137+
working-directory: ./
138+
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop
139+
140+
# Build solution
141+
- name: MSBuild (With diagnostics)
142+
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
143+
run: >
144+
msbuild.exe /restore /nowarn:MSB4011
145+
/p:Configuration=Release
146+
/m
147+
${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }}
148+
/v:${{ env.MSBUILD_VERBOSITY }}
149+
CommunityToolkit.AllComponents.sln
150+
151+
- name: MSBuild
152+
if: ${{ env.ENABLE_DIAGNOSTICS == 'false' }}
153+
run: msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release
154+
155+
# Run tests
156+
- name: Setup VSTest Path
157+
uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
158+
159+
- name: Install Testspace Module
160+
uses: testspace-com/setup-testspace@v1
161+
with:
162+
domain: ${{ github.repository_owner }}
163+
164+
- name: Run component tests against ${{ matrix.multitarget }}
165+
if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
166+
id: test-platform
167+
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
168+
169+
- name: Create test reports
170+
run: |
171+
testspace '[${{ matrix.multitarget }}]./TestResults/*.trx'
172+
if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}
138173

139174
- name: Artifact - Diagnostic Logs
140175
uses: actions/upload-artifact@v4
@@ -178,7 +213,7 @@ jobs:
178213
strategy:
179214
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
180215
matrix:
181-
winui: [2, 3] # Temporary until we can get Uno/Wasm working
216+
winui: [2, 3]
182217

183218
env:
184219
VERSION_PROPERTY: ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
@@ -234,7 +269,7 @@ jobs:
234269
235270
# Build and pack component nupkg
236271
- name: Build and pack component packages
237-
run: ./tooling/Build-Toolkit-Components.ps1 -Components DependencyPropertyGenerator -MultiTargets uwp,wasdk -ExcludeMultiTargets ${{ env.EXCLUDED_MULTITARGETS }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
272+
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -ExcludeMultiTargets ${{ env.EXCLUDED_MULTITARGETS }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
238273

239274
- name: Validate package names
240275
if: ${{ env.VERSION_PROPERTY != '' }}
@@ -271,4 +306,52 @@ jobs:
271306
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
272307
with:
273308
name: build-logs-winui${{ matrix.winui }}
274-
path: ./*.*log
309+
path: ./*.*log
310+
311+
wasm-linux:
312+
runs-on: ubuntu-latest
313+
env:
314+
HEADS_DIRECTORY: tooling/ProjectHeads
315+
316+
steps:
317+
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
318+
uses: actions/setup-dotnet@v4
319+
with:
320+
dotnet-version: ${{ env.DOTNET_VERSION }}
321+
322+
- name: .NET Info (if diagnostics)
323+
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
324+
run: dotnet --info
325+
326+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
327+
- name: Checkout Repository
328+
uses: actions/checkout@v4
329+
with:
330+
submodules: recursive
331+
332+
# Restore Tools from Manifest list in the Repository
333+
- name: Restore dotnet tools
334+
run: dotnet tool restore
335+
336+
- name: Generate solution
337+
shell: pwsh
338+
working-directory: ./
339+
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
340+
341+
- name: Install ninja for WASM native dependencies
342+
run: sudo apt-get install ninja-build
343+
344+
# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
345+
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
346+
- name: dotnet build
347+
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
348+
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
349+
350+
# TODO: Do we want to run tests here? Can we do that on linux easily?
351+
352+
- name: Artifact - Diagnostic Logs
353+
uses: actions/upload-artifact@v4
354+
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
355+
with:
356+
name: linux-logs
357+
path: ./**/*.*log

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory).editorconfig" />
2727
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)settings.xamlstyler" />
2828
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)*.md" />
29+
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)tooling\GlobalUsings*.cs" />
2930
</ItemGroup>
3031

3132
</Project>

components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<ProjectReference Include="..\CommunityToolkit.AppServices.SourceGenerators\CommunityToolkit.AppServices.SourceGenerators.csproj" />
1717
<ProjectReference Include="..\src\CommunityToolkit.AppServices.csproj" />
1818
</ItemGroup>
19+
20+
<ItemGroup>
21+
<Compile Remove="C:\Users\sergiopedri\git\Labs-Windows\tooling\GlobalUsings.cs" />
22+
</ItemGroup>
1923
</Project>

components/AppServices/CommunityToolkit.AppServices.SourceGenerators/CommunityToolkit.AppServices.SourceGenerators.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@
2222
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
2323
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
2424
</ItemGroup>
25+
26+
<!-- Remove imported global usings -->
27+
<ItemGroup>
28+
<Compile Remove="$(ToolingDirectory)\GlobalUsings.cs" />
29+
</ItemGroup>
2530
</Project>

components/AppServices/src/CommunityToolkit.AppServices.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<RootNamespace>CommunityToolkit.AppServices</RootNamespace>
88
<PackageId>$(PackageIdPrefix).$(ToolkitComponentName)</PackageId>
99
<HasWinUI>false</HasWinUI>
10-
<EnableGlobalUsings>false</EnableGlobalUsings>
1110
</PropertyGroup>
1211

1312
<!-- Sets this up as a toolkit component's source project -->
@@ -56,4 +55,9 @@
5655
<!-- Pack the source generator to the right package folder -->
5756
<None Include="..\CommunityToolkit.AppServices.SourceGenerators\bin\$(Platform)\$(Configuration)\netstandard2.0\CommunityToolkit.AppServices.SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
5857
</ItemGroup>
58+
59+
<!-- Remove imported global usings -->
60+
<ItemGroup>
61+
<Compile Remove="$(ToolingDirectory)\GlobalUsings.cs" />
62+
</ItemGroup>
5963
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<IsPackable>false</IsPackable>
5+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
7+
<!--
8+
Suppress ref safety warnings in unsafe contexts (see https://github.com/dotnet/csharplang/issues/6476).
9+
This is used eg. to replace Unsafe.SizeOf<T>() calls with just sizeof(T), or to just use raw pointers to
10+
reinterpret references to managed objects when it is safe to do so. The warnings are not necessary in this
11+
context, since in order to use these APIs the caller already has to be in an unsafe context.
12+
-->
13+
<NoWarn>$(NoWarn);CS8500</NoWarn>
14+
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" Pack="false" />
18+
<PackageReference Include="PolySharp" Version="1.13.2" PrivateAssets="All" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
23+
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
24+
</ItemGroup>
25+
26+
<!-- Remove imported global usings -->
27+
<ItemGroup>
28+
<Compile Remove="$(ToolingDirectory)\GlobalUsings.cs" />
29+
</ItemGroup>
30+
</Project>

components/Extensions.DependencyInjection/src/CommunityToolkit.Extensions.DependencyInjection.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
<!-- Pack the source generator to the right package folder -->
3131
<None Include="..\CommunityToolkit.Extensions.DependencyInjection.SourceGenerators\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
3232
</ItemGroup>
33+
34+
<!-- Remove imported global usings -->
35+
<ItemGroup>
36+
<Compile Remove="$(ToolingDirectory)\GlobalUsings.cs" />
37+
</ItemGroup>
3338
</Project>

0 commit comments

Comments
 (0)