Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 15 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
platform: [WinUI2, WinUI3]

env:
MULTI_TARGET_DIRECTORY: tooling/MultiTarget
# faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
TARGET_PLATFORMS: ${{ matrix.platform != 'WinUI3' && 'all' || 'all-uwp' }}
TEST_PLATFORM: ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}
Expand Down Expand Up @@ -87,15 +88,15 @@ jobs:
uses: microsoft/[email protected]

- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
working-directory: ./common/MultiTarget/
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 ${{ env.TARGET_PLATFORMS }}" -ErrorAction Stop

- name: Generate solution w/ ${{ env.TEST_PLATFORM }} Tests
working-directory: ./
run: powershell -version 5.1 -command "./common/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop

- name: Enable Uno.WinUI (in WinUI3 matrix only)
working-directory: ./common/MultiTarget/
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
run: powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
if: ${{ matrix.platform == 'WinUI3' }}

Expand All @@ -104,7 +105,7 @@ jobs:

# Build All Packages
- name: pack experiments
working-directory: ./common/Scripts/
working-directory: ./tooling/Scripts/
run: ./PackEachExperiment.ps1 all

# Push Packages to our DevOps Artifacts Feed
Expand All @@ -127,11 +128,11 @@ jobs:

- name: Run SourceGenerators tests
id: test-generator
run: vstest.console.exe ./common/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"

- name: Run experiment tests against ${{ env.TEST_PLATFORM }}
id: test-platform
run: vstest.console.exe ./common/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"

- name: Create test reports
run: |
Expand All @@ -150,7 +151,8 @@ jobs:
# TODO: We should only run this if something in the common or template folder changed...
runs-on: windows-latest
env:
PROJECT_DIRECTORY: common/ProjectTemplate
HEADS_DIRECTORY: tooling/ProjectHeads
PROJECT_DIRECTORY: tooling/ProjectTemplate
TEST_PROJECT_NAME: CiTestExp
TEST_PROJECT_DIRECTORY: components/CiTestExp

Expand All @@ -176,7 +178,7 @@ jobs:

- name: Add project heads to ProjectTemplate
working-directory: ./${{ env.PROJECT_DIRECTORY }}
run: ${{ github.workspace }}/common/ProjectHeads/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

# Build and use template for creating new experiments
- name: Build ProjectTemplate
Expand All @@ -198,7 +200,7 @@ jobs:

- name: Add project heads to ${{ env.TEST_PROJECT_NAME }}
working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }}
run: ${{ github.workspace }}/common/ProjectHeads/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

- name: MSBuild
working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }}
Expand Down Expand Up @@ -235,6 +237,8 @@ jobs:

wasm-linux:
runs-on: ubuntu-latest
env:
HEADS_DIRECTORY: tooling/ProjectHeads

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
Expand All @@ -257,15 +261,15 @@ jobs:
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./common/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build

# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
- name: dotnet build
working-directory: ./common/ProjectHeads/AllComponents/Wasm/
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false

# TODO: Do we want to run tests here? Can we do that on linux easily?
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ MigrationBackup/

# Community Toolkit Labs generated files
CommunityToolkit.AllComponents.sln
common/MultiTarget/Generated/**
tooling/MultiTarget/Generated/**
heads/

# We use slngen to generate solutions
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
"/p:UnoSourceGeneratorUseGenerationHost=true",
"/p:UnoSourceGeneratorUseGenerationController=false",
"/p:UnoRemoteControlPort=443",
"--project=${workspaceFolder}/common/ProjectHeads/AllComponents/Wasm/CommunityToolkit.App.Wasm.csproj"
"--project=${workspaceFolder}/tooling/ProjectHeads/AllComponents/Wasm/CommunityToolkit.App.Wasm.csproj"
],
"presentation": {
"group": "1",
"order": 1
},
"cwd": "${workspaceFolder}/common/ProjectHeads/AllComponents/Wasm",
"cwd": "${workspaceFolder}/tooling/ProjectHeads/AllComponents/Wasm",
"preLaunchTask": "generateAllSolution"
},
{
"type": "PowerShell",
"request": "launch",
"name": "Discover samples",
"script": "foreach ($component in Get-ChildItem -Directory -Depth 0 -Path './components/*') { ${workspaceFolder}/common/ProjectHeads/GenerateSingleSampleHeads.ps1 -ComponentPath $component } ; ${workspaceFolder}/common/GenerateVSCodeLaunchConfig.ps1; ",
"script": "foreach ($component in Get-ChildItem -Directory -Depth 0 -Path './components/*') { ${workspaceFolder}/tooling/ProjectHeads/GenerateSingleSampleHeads.ps1 -ComponentPath $component } ; ${workspaceFolder}/tooling/GenerateVSCodeLaunchConfig.ps1; ",
"presentation": {
"group": "2",
"order": 2
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"label": "generateAllSolution",
"type": "shell",
"command": "pwsh ./common/GenerateAllSolution.ps1",
"command": "pwsh ./tooling/GenerateAllSolution.ps1",
"group": "build"
}
]
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<PackageIdPrefix>CommunityToolkit.Labs</PackageIdPrefix>
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
<ToolingDirectory>$(RepositoryDirectory)\tooling</ToolingDirectory>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory).editorconfig" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)settings.xamlstyler" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)*.md" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)common\GlobalUsings*.cs" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)tooling\GlobalUsings*.cs" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion GenerateAllSolution.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
SET "IncludeHeads=%1"
IF "%IncludeHeads%"=="" SET "IncludeHeads=all"

powershell .\common\GenerateAllSolution.ps1 -IncludeHeads %IncludeHeads%
powershell .\tooling\GenerateAllSolution.ps1 -IncludeHeads %IncludeHeads%
8 changes: 4 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# 🧪 Windows Community Toolkit Labs (Preview) 🧪

![Windows Community Toolkit Labs Social Image](common/ToolkitLabsSocial.png)
![Windows Community Toolkit Labs Social Image](tooling/ToolkitLabsSocial.png)

Welcome to the home of Windows Community Toolkit Labs. A place for all new components to be developed in 'experiments' for the [Windows Community Toolkit](https://aka.ms/windowstoolkitdocs) (built on top of WinUI 2, [WinUI 3](https://aka.ms/winui3), and [Uno Platform](https://platform.uno))! Find out more about Toolkit Labs in our [blog post here](https://devblogs.microsoft.com/ifdef-windows/announcing-the-windows-community-toolkit-labs/). It includes more about our motivations for having this space as well as how to setup the NuGet feed required to easily use experiments found in this repo.

Expand Down Expand Up @@ -39,14 +39,14 @@ Once there is traction and your idea is approved, an issue will be created to tr
Then you can fork the Labs repo, create a new branch, and start working on your feature (or porting over your existing prototype).

```ascii
dotnet new --install .\common\ProjectTemplate\
dotnet new --install .\tooling\ProjectTemplate\

cd components

dotnet new labexp -n MyExperimentNameHere
```

[Read more about creating a new experiment from the template folder here.](https://github.com/CommunityToolkit/Labs-Windows/tree/main/common/ProjectTemplate)
[Read more about creating a new experiment from the template folder here.](https://github.com/CommunityToolkit/Labs-Windows/tree/main/tooling/ProjectTemplate)

Then open a PR, not everything needs to be done in your initial PR, but some basically functionality and a usage example should exist. The Labs space is a great place to work on something over time, get feedback from the community, and collaborate with others. However, your initial PR should compile and have enough content for folks to understand how to leverage your component.

Expand All @@ -70,7 +70,7 @@ Open up an issue on the main Toolkit repo using the `Toolkit Labs Transfer` Issu

You can build the main Sample App solution to see all the experiments currently available in this repository by running the `GenerateAllSolution.bat` script in the repo root. Then just open the `CommunityToolkit.AllComponents.sln` solution in Visual Studio. You can run one of the project heads such as `CommunityToolkit.App.WinAppSdk` to run the sample app for that platform.

If you'd like to run a head beyond UWP, Wasm, or the WinAppSDK, you'll need to run the `UseTargetFrameworks.ps1` script first in the `common/Scripts` directory. e.g. `.\UseTargetFrameworks.ps1 -targets all`
If you'd like to run a head beyond UWP, Wasm, or the WinAppSDK, you'll need to run the `UseTargetFrameworks.ps1` script first in the `tooling/MultiTarget` directory. e.g. `.\UseTargetFrameworks.ps1 -targets all`

If you'd like to test on Uno + Windows App SDK over Uno + UWP, run the `UseUnoWinUI.ps1` script. e.g. `.\UseUnoWinUI.ps1 -targets 3`

Expand Down
2 changes: 1 addition & 1 deletion Windows.Toolkit.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings.cs" />
<Compile Include="$(RepositoryDirectory)tooling\GlobalUsings.cs" />
</ItemGroup>
</Project>
37 changes: 0 additions & 37 deletions common/ProjectHeads/Tests.Head.props

This file was deleted.

3 changes: 0 additions & 3 deletions common/ProjectTemplate/OpenSolution.bat

This file was deleted.

2 changes: 1 addition & 1 deletion components/CanvasLayout/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/CanvasView/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
2 changes: 1 addition & 1 deletion components/CanvasView/samples/CanvasView.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/MarqueeText/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
2 changes: 1 addition & 1 deletion components/MarqueeText/samples/MarqueeText.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
</ItemGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
</ItemGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/RivePlayer/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
2 changes: 1 addition & 1 deletion components/RivePlayer/samples/RivePlayer.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
</ItemGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/SegmentedControl/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/SettingsControls/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SampleProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
</ItemGroup>

<!-- Sets this up as a toolkit component's source project -->
<Import Project="$(RepositoryDirectory)common\ToolkitComponent.SourceProject.props" />
<Import Project="$(ToolingDirectory)\ToolkitComponent.SourceProject.props" />
</Project>
2 changes: 1 addition & 1 deletion components/Shimmer/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF

powershell ..\..\common\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Loading