Skip to content

Commit 321f077

Browse files
authored
Merge pull request #134 from VaclavElias/update-15-cross-platform-improvements
Update 15 - Cross platform improvements
2 parents 53bff15 + b99616d commit 321f077

File tree

10 files changed

+100
-63
lines changed

10 files changed

+100
-63
lines changed

.github/workflows/dotnet-nuget.yml

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: .NET Build and Publish Nuget
22

33
env:
44
PROJECT_PATH_CORE: src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj
5-
PROJECT_PATH_SKYBOX: src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj
5+
PROJECT_PATH_SKYBOX: src/Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj
6+
PROJECT_PATH_WINDOWS: src/Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj
67
COMMON_SETTINGS_PATH: src/CommonSettings.props
78
VERSION: "1.0.0.0-preview.${{ github.run_number }}"
89

@@ -33,26 +34,26 @@ jobs:
3334
run: dotnet restore ${{ env.PROJECT_PATH_CORE }}
3435

3536
# Temporary solution, because of System.Security.Cryptography.Pkcs not found issue
36-
- name: Modify Stride.Core.Assets.CompilerApp.targets
37-
shell: pwsh
38-
run: |
39-
$targetsPath = Join-Path -Path (Get-ChildItem -Path "${env:USERPROFILE}\.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive" -Filter "Stride.Core.Assets.CompilerApp.targets" -Recurse).DirectoryName -ChildPath "Stride.Core.Assets.CompilerApp.targets"
40-
41-
[xml]$targetsXml = Get-Content -Path $targetsPath
42-
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
43-
$namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
44-
45-
$targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
46-
if ($targetNode -ne $null)
47-
{
48-
$targetNode.SetAttribute("Condition", "false")
49-
$targetsXml.Save($targetsPath)
50-
Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
51-
}
52-
else
53-
{
54-
Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
55-
}
37+
# - name: Modify Stride.Core.Assets.CompilerApp.targets
38+
# shell: pwsh
39+
# run: |
40+
# $targetsPath = Join-Path -Path (Get-ChildItem -Path "${env:USERPROFILE}\.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive" -Filter "Stride.Core.Assets.CompilerApp.targets" -Recurse).DirectoryName -ChildPath "Stride.Core.Assets.CompilerApp.targets"
41+
42+
# [xml]$targetsXml = Get-Content -Path $targetsPath
43+
# $namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
44+
# $namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
45+
46+
# $targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
47+
# if ($targetNode -ne $null)
48+
# {
49+
# $targetNode.SetAttribute("Condition", "false")
50+
# $targetsXml.Save($targetsPath)
51+
# Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
52+
# }
53+
# else
54+
# {
55+
# Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
56+
# }
5657

5758
- name: Build
5859
run: dotnet build ${{ env.PROJECT_PATH_CORE }} --no-restore
@@ -70,6 +71,24 @@ jobs:
7071
VERSION_FILE_PATH: ${{ env.COMMON_SETTINGS_PATH }}
7172
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
7273

74+
# Stride.CommunityToolkit.Windows
75+
- name: Restore dependencies - Stride.CommunityToolkit.Windows
76+
run: dotnet restore ${{ env.PROJECT_PATH_WINDOWS }}
77+
78+
- name: Build
79+
run: dotnet build ${{ env.PROJECT_PATH_WINDOWS }} --no-restore
80+
81+
- name: Test
82+
run: dotnet test ${{ env.PROJECT_PATH_WINDOWS }} --no-build --verbosity normal
83+
84+
- name: Publish Stride Community Toolkit - Windows
85+
uses: alirezanet/publish-nuget@v3.1.0
86+
with:
87+
PROJECT_FILE_PATH: ${{ env.PROJECT_PATH_WINDOWS }}
88+
VERSION_FILE_PATH: ${{ env.COMMON_SETTINGS_PATH }}
89+
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
90+
TAG_COMMIT: false
91+
7392
# Stride.CommunityToolkit.Skyboxes
7493
- name: Restore dependencies - Stride.CommunityToolkit.Skyboxes
7594
run: dotnet restore ${{ env.PROJECT_PATH_SKYBOX }}

.github/workflows/dotnet.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: .NET Build Test
22

33
env:
4-
PROJECT_PATH_CORE: src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj
5-
PROJECT_PATH_SKYBOX: src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj
4+
PROJECT_PATH_CORE: src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj
5+
PROJECT_PATH_SKYBOX: src/Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj
6+
PROJECT_PATH_WINDOWS: src/Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj
67

78
on:
89
workflow_dispatch:
@@ -25,26 +26,26 @@ jobs:
2526
run: dotnet restore ${{ env.PROJECT_PATH_CORE }}
2627

2728
# Temporary solution, because of System.Security.Cryptography.Pkcs not found issue
28-
- name: Modify Stride.Core.Assets.CompilerApp.targets
29-
shell: pwsh
30-
run: |
31-
$targetsPath = Join-Path -Path (Get-ChildItem -Path "${env:USERPROFILE}\.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive" -Filter "Stride.Core.Assets.CompilerApp.targets" -Recurse).DirectoryName -ChildPath "Stride.Core.Assets.CompilerApp.targets"
32-
33-
[xml]$targetsXml = Get-Content -Path $targetsPath
34-
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
35-
$namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
36-
37-
$targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
38-
if ($targetNode -ne $null)
39-
{
40-
$targetNode.SetAttribute("Condition", "false")
41-
$targetsXml.Save($targetsPath)
42-
Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
43-
}
44-
else
45-
{
46-
Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
47-
}
29+
# - name: Modify Stride.Core.Assets.CompilerApp.targets
30+
# shell: pwsh
31+
# run: |
32+
# $targetsPath = Join-Path -Path (Get-ChildItem -Path "${env:USERPROFILE}\.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive" -Filter "Stride.Core.Assets.CompilerApp.targets" -Recurse).DirectoryName -ChildPath "Stride.Core.Assets.CompilerApp.targets"
33+
34+
# [xml]$targetsXml = Get-Content -Path $targetsPath
35+
# $namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
36+
# $namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
37+
38+
# $targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
39+
# if ($targetNode -ne $null)
40+
# {
41+
# $targetNode.SetAttribute("Condition", "false")
42+
# $targetsXml.Save($targetsPath)
43+
# Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
44+
# }
45+
# else
46+
# {
47+
# Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
48+
# }
4849

4950
# - name: Get NuGet global-packages location
5051
# id: nuget-cache
@@ -67,6 +68,13 @@ jobs:
6768
# Copy-Item "C:\Users\runneradmin\.nuget\packages\system.security.cryptography.pkcs\6.0.4\lib\net6.0\System.Security.Cryptography.Pkcs.dll" -Destination "src/Stride.CommunityToolkit/bin/Debug/net8.0/"
6869
# shell: pwsh
6970

71+
# Stride.CommunityToolkit.Windows
72+
- name: Restore Stride.CommunityToolkit.Windows dependencies
73+
run: dotnet restore ${{ env.PROJECT_PATH_WINDOWS }}
74+
75+
- name: Build Stride.CommunityToolkit.Windows
76+
run: dotnet build ${{ env.PROJECT_PATH_WINDOWS }} --no-restore
77+
7078
# Stride.CommunityToolkit.Skyboxes
7179
- name: Restore Stride.CommunityToolkit.Skyboxes dependencies
7280
run: dotnet restore ${{ env.PROJECT_PATH_SKYBOX }}

Stride.CommunityToolkit.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.Common", "examples\
5454
EndProject
5555
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.CommunityToolkit.Skyboxes", "src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj", "{423A1266-4A6D-425F-96CE-945A1802F711}"
5656
EndProject
57+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.CommunityToolkit.Windows", "src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj", "{E5E01EDB-524C-4FC2-951B-321E5D08C972}"
58+
EndProject
5759
Global
5860
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5961
Debug|Any CPU = Debug|Any CPU
@@ -135,6 +137,10 @@ Global
135137
{423A1266-4A6D-425F-96CE-945A1802F711}.Debug|Any CPU.Build.0 = Debug|Any CPU
136138
{423A1266-4A6D-425F-96CE-945A1802F711}.Release|Any CPU.ActiveCfg = Release|Any CPU
137139
{423A1266-4A6D-425F-96CE-945A1802F711}.Release|Any CPU.Build.0 = Release|Any CPU
140+
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
141+
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Debug|Any CPU.Build.0 = Debug|Any CPU
142+
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Release|Any CPU.ActiveCfg = Release|Any CPU
143+
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Release|Any CPU.Build.0 = Release|Any CPU
138144
EndGlobalSection
139145
GlobalSection(SolutionProperties) = preSolution
140146
HideSolutionNode = FALSE

docs/docfx.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
{
66
"files": [
77
"Stride.CommunityToolkit/Stride.CommunityToolkit.csproj",
8-
"Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj"
8+
"Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj",
9+
"Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj"
910
],
1011
"src": "../src",
1112
"properties": {
@@ -35,7 +36,7 @@
3536
"_appTitle": "Stride Community Toolkit",
3637
"_enableSearch": true,
3738
"_appLogoPath": "media/stride-logo-blue-toolkit.svg",
38-
"_appFooter": "<div class=\"d-flex flex-column flex-sm-row justify-content-between pt-1 text-center small\"><p >Supported by the <a href=\"https://dotnetfoundation.org/\" target=\"_blank\" rel=\"noopener\">.NET Foundation</a></p><p>Made with <a href=\"https://dotnet.github.io/docfx\">docfx</a></p><p >Stride Community Toolkit Website v.1.0.0.0</p><p>&copy; .NET Foundation and Contributors</p></div>"
39+
"_appFooter": "<div class=\"d-flex flex-column flex-sm-row justify-content-between pt-1 text-center small\"><p >Supported by the <a href=\"https://dotnetfoundation.org/\" target=\"_blank\" rel=\"noopener\">.NET Foundation</a></p><p>Made with <a href=\"https://dotnet.github.io/docfx\">docfx</a></p><p >Stride Community Toolkit Website v.1.0.0.1</p><p>&copy; .NET Foundation and Contributors</p></div>"
3940
},
4041
"fileMetadata": {
4142
"_appTitle": {

examples/code-only/Example01_Basic2DScene/Example01_Basic2DScene.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</Target>
1717

1818
<ItemGroup>
19-
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
19+
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
2020
</ItemGroup>
2121

2222
</Project>

examples/code-only/Example01_Basic3DScene/Example01_Basic3DScene.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj" />
12-
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
12+
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
1313
</ItemGroup>
1414

1515
</Project>

src/CommonSettings.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Copyright>Stride Contributors</Copyright>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<!-- Once the issue with deployment is resolved, this can be removed -->
16-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
16+
<!--<GeneratePackageOnBuild>True</GeneratePackageOnBuild>-->
1717
</PropertyGroup>
1818

1919
<ItemGroup>

src/Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,9 @@
99
<Import Project="..\CommonSettings.props" />
1010

1111
<ItemGroup>
12-
<!-- The light requires a shader defined in the engine assemblies - but shaders are assets and I think they are compiled by the asset compiler per Graphics API target, that's why we need Stride.Core.Assets.CompilerApp -->
13-
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
1412
<PackageReference Include="Stride.Engine" Version="4.2.0.2122" />
15-
<!--<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.1" IncludeAssets="build;buildTransitive" />
16-
<PackageReference Include="Stride.Engine" Version="4.2.0.1" />-->
1713
</ItemGroup>
1814

19-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
20-
<DefineConstants>$(DefineConstants)TRACE;CODE_ANALYSIS</DefineConstants>
21-
</PropertyGroup>
22-
2315
<ItemGroup>
2416
<None Remove="Resources\skybox_texture_hdr.dds" />
2517
</ItemGroup>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
5+
</PropertyGroup>
6+
7+
<Import Project="..\CommonSettings.props" />
8+
9+
<ItemGroup>
10+
<!-- The light requires a shader defined in the engine assemblies - but shaders are assets and I think they are compiled by the asset compiler per Graphics API target, that's why we need Stride.Core.Assets.CompilerApp -->
11+
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
16+
</ItemGroup>
17+
18+
</Project>

src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,11 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<!-- The light requires a shader defined in the engine assemblies - but shaders are assets and I think they are compiled by the asset compiler per Graphics API target, that's why we need Stride.Core.Assets.CompilerApp -->
18-
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
1917
<PackageReference Include="Stride.Engine" Version="4.2.0.2122" />
2018
<PackageReference Include="Stride.Particles" Version="4.2.0.2122" />
2119
<PackageReference Include="Stride.Physics" Version="4.2.0.2122" />
2220
<PackageReference Include="Stride.UI" Version="4.2.0.2122" />
2321
<PackageReference Include="Stride.BepuPhysics" Version="0.9.2" />
24-
<!--<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.1" IncludeAssets="build;buildTransitive" />
25-
<PackageReference Include="Stride.Engine" Version="4.2.0.1" />
26-
<PackageReference Include="Stride.Particles" Version="4.2.0.1" />
27-
<PackageReference Include="Stride.Physics" Version="4.2.0.1" />
28-
<PackageReference Include="Stride.UI" Version="4.2.0.1" />-->
2922
</ItemGroup>
3023

3124
</Project>

0 commit comments

Comments
 (0)