Skip to content

Commit

Permalink
Merge pull request #134 from VaclavElias/update-15-cross-platform-imp…
Browse files Browse the repository at this point in the history
…rovements

Update 15 - Cross platform improvements
  • Loading branch information
VaclavElias authored Apr 28, 2024
2 parents 53bff15 + b99616d commit 321f077
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 63 deletions.
61 changes: 40 additions & 21 deletions .github/workflows/dotnet-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: .NET Build and Publish Nuget

env:
PROJECT_PATH_CORE: src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj
PROJECT_PATH_SKYBOX: src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj
PROJECT_PATH_SKYBOX: src/Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj
PROJECT_PATH_WINDOWS: src/Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj
COMMON_SETTINGS_PATH: src/CommonSettings.props
VERSION: "1.0.0.0-preview.${{ github.run_number }}"

Expand Down Expand Up @@ -33,26 +34,26 @@ jobs:
run: dotnet restore ${{ env.PROJECT_PATH_CORE }}

# Temporary solution, because of System.Security.Cryptography.Pkcs not found issue
- name: Modify Stride.Core.Assets.CompilerApp.targets
shell: pwsh
run: |
$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"
[xml]$targetsXml = Get-Content -Path $targetsPath
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
$namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
$targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
if ($targetNode -ne $null)
{
$targetNode.SetAttribute("Condition", "false")
$targetsXml.Save($targetsPath)
Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
}
else
{
Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
}
# - name: Modify Stride.Core.Assets.CompilerApp.targets
# shell: pwsh
# run: |
# $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"

# [xml]$targetsXml = Get-Content -Path $targetsPath
# $namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
# $namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")

# $targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
# if ($targetNode -ne $null)
# {
# $targetNode.SetAttribute("Condition", "false")
# $targetsXml.Save($targetsPath)
# Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
# }
# else
# {
# Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
# }

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

# Stride.CommunityToolkit.Windows
- name: Restore dependencies - Stride.CommunityToolkit.Windows
run: dotnet restore ${{ env.PROJECT_PATH_WINDOWS }}

- name: Build
run: dotnet build ${{ env.PROJECT_PATH_WINDOWS }} --no-restore

- name: Test
run: dotnet test ${{ env.PROJECT_PATH_WINDOWS }} --no-build --verbosity normal

- name: Publish Stride Community Toolkit - Windows
uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ${{ env.PROJECT_PATH_WINDOWS }}
VERSION_FILE_PATH: ${{ env.COMMON_SETTINGS_PATH }}
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
TAG_COMMIT: false

# Stride.CommunityToolkit.Skyboxes
- name: Restore dependencies - Stride.CommunityToolkit.Skyboxes
run: dotnet restore ${{ env.PROJECT_PATH_SKYBOX }}
Expand Down
52 changes: 30 additions & 22 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: .NET Build Test

env:
PROJECT_PATH_CORE: src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj
PROJECT_PATH_SKYBOX: src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj
PROJECT_PATH_CORE: src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj
PROJECT_PATH_SKYBOX: src/Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj
PROJECT_PATH_WINDOWS: src/Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj

on:
workflow_dispatch:
Expand All @@ -25,26 +26,26 @@ jobs:
run: dotnet restore ${{ env.PROJECT_PATH_CORE }}

# Temporary solution, because of System.Security.Cryptography.Pkcs not found issue
- name: Modify Stride.Core.Assets.CompilerApp.targets
shell: pwsh
run: |
$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"
[xml]$targetsXml = Get-Content -Path $targetsPath
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
$namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")
$targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
if ($targetNode -ne $null)
{
$targetNode.SetAttribute("Condition", "false")
$targetsXml.Save($targetsPath)
Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
}
else
{
Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
}
# - name: Modify Stride.Core.Assets.CompilerApp.targets
# shell: pwsh
# run: |
# $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"

# [xml]$targetsXml = Get-Content -Path $targetsPath
# $namespaceManager = New-Object System.Xml.XmlNamespaceManager($targetsXml.NameTable)
# $namespaceManager.AddNamespace("msbuild", "http://schemas.microsoft.com/developer/msbuild/2003")

# $targetNode = $targetsXml.SelectSingleNode("//msbuild:Target[@Name='_StridePrepareAssetsForPack']", $namespaceManager)
# if ($targetNode -ne $null)
# {
# $targetNode.SetAttribute("Condition", "false")
# $targetsXml.Save($targetsPath)
# Write-Host "Modified _StridePrepareAssetsForPack target in Stride.Core.Assets.CompilerApp.targets"
# }
# else
# {
# Write-Host "_StridePrepareAssetsForPack target not found in Stride.Core.Assets.CompilerApp.targets"
# }

# - name: Get NuGet global-packages location
# id: nuget-cache
Expand All @@ -67,6 +68,13 @@ jobs:
# 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/"
# shell: pwsh

# Stride.CommunityToolkit.Windows
- name: Restore Stride.CommunityToolkit.Windows dependencies
run: dotnet restore ${{ env.PROJECT_PATH_WINDOWS }}

- name: Build Stride.CommunityToolkit.Windows
run: dotnet build ${{ env.PROJECT_PATH_WINDOWS }} --no-restore

# Stride.CommunityToolkit.Skyboxes
- name: Restore Stride.CommunityToolkit.Skyboxes dependencies
run: dotnet restore ${{ env.PROJECT_PATH_SKYBOX }}
Expand Down
6 changes: 6 additions & 0 deletions Stride.CommunityToolkit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.Common", "examples\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.CommunityToolkit.Skyboxes", "src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj", "{423A1266-4A6D-425F-96CE-945A1802F711}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.CommunityToolkit.Windows", "src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj", "{E5E01EDB-524C-4FC2-951B-321E5D08C972}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -135,6 +137,10 @@ Global
{423A1266-4A6D-425F-96CE-945A1802F711}.Debug|Any CPU.Build.0 = Debug|Any CPU
{423A1266-4A6D-425F-96CE-945A1802F711}.Release|Any CPU.ActiveCfg = Release|Any CPU
{423A1266-4A6D-425F-96CE-945A1802F711}.Release|Any CPU.Build.0 = Release|Any CPU
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5E01EDB-524C-4FC2-951B-321E5D08C972}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 3 additions & 2 deletions docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
{
"files": [
"Stride.CommunityToolkit/Stride.CommunityToolkit.csproj",
"Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj"
"Stride.CommunityToolkit.Skyboxes/Stride.CommunityToolkit.Skyboxes.csproj",
"Stride.CommunityToolkit.Windows/Stride.CommunityToolkit.Windows.csproj"
],
"src": "../src",
"properties": {
Expand Down Expand Up @@ -35,7 +36,7 @@
"_appTitle": "Stride Community Toolkit",
"_enableSearch": true,
"_appLogoPath": "media/stride-logo-blue-toolkit.svg",
"_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>"
"_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>"
},
"fileMetadata": {
"_appTitle": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</Target>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj" />
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/CommonSettings.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Copyright>Stride Contributors</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<!-- Once the issue with deployment is resolved, this can be removed -->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<!--<GeneratePackageOnBuild>True</GeneratePackageOnBuild>-->
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@
<Import Project="..\CommonSettings.props" />

<ItemGroup>
<!-- 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 -->
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
<PackageReference Include="Stride.Engine" Version="4.2.0.2122" />
<!--<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.1" IncludeAssets="build;buildTransitive" />
<PackageReference Include="Stride.Engine" Version="4.2.0.1" />-->
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;CODE_ANALYSIS</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\skybox_texture_hdr.dds" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<Import Project="..\CommonSettings.props" />

<ItemGroup>
<!-- 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 -->
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Stride.CommunityToolkit\Stride.CommunityToolkit.csproj" />
</ItemGroup>

</Project>
7 changes: 0 additions & 7 deletions src/Stride.CommunityToolkit/Stride.CommunityToolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@
</ItemGroup>

<ItemGroup>
<!-- 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 -->
<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.2122" IncludeAssets="build;buildTransitive" />
<PackageReference Include="Stride.Engine" Version="4.2.0.2122" />
<PackageReference Include="Stride.Particles" Version="4.2.0.2122" />
<PackageReference Include="Stride.Physics" Version="4.2.0.2122" />
<PackageReference Include="Stride.UI" Version="4.2.0.2122" />
<PackageReference Include="Stride.BepuPhysics" Version="0.9.2" />
<!--<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.2.0.1" IncludeAssets="build;buildTransitive" />
<PackageReference Include="Stride.Engine" Version="4.2.0.1" />
<PackageReference Include="Stride.Particles" Version="4.2.0.1" />
<PackageReference Include="Stride.Physics" Version="4.2.0.1" />
<PackageReference Include="Stride.UI" Version="4.2.0.1" />-->
</ItemGroup>

</Project>

0 comments on commit 321f077

Please sign in to comment.