Add UseLocalVeldrid scripts

This commit is contained in:
Dan Balasescu
2023-06-12 17:06:41 +09:00
parent c7c12aa57b
commit 5bcbb7a2d2
2 changed files with 60 additions and 0 deletions

32
UseLocalVeldrid.ps1 Normal file
View File

@@ -0,0 +1,32 @@
# Run this script to use a local copy of veldrid rather than fetching it from nuget.
# It expects the veldrid directory to be at the same level as the osu-framework directory
#
# https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects
$FRAMEWORK_CSPROJ="osu.Framework/osu.Framework.csproj"
$SLN="osu-framework.sln"
dotnet remove $FRAMEWORK_CSPROJ reference ppy.Veldrid;
dotnet sln $SLN add ../veldrid/src/Veldrid/Veldrid.csproj `
../veldrid/src/Veldrid.MetalBindings/Veldrid.MetalBindings.csproj `
../veldrid/src/Veldrid.OpenGLBindings/Veldrid.OpenGLBindings.csproj;
dotnet add $FRAMEWORK_CSPROJ reference ../veldrid/src/Veldrid/Veldrid.csproj;
$TMP=New-TemporaryFile
$SLNF=Get-Content "osu-framework.Desktop.slnf" | ConvertFrom-Json
$SLNF.solution.projects += ("../veldrid/src/Veldrid/Veldrid.csproj")
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
Move-Item -Path $TMP -Destination "osu-framework.Desktop.slnf" -Force
$SLNF=Get-Content "osu-framework.Android.slnf" | ConvertFrom-Json
$SLNF.solution.projects += ("../veldrid/src/Veldrid/Veldrid.csproj")
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
Move-Item -Path $TMP -Destination "osu-framework.Android.slnf" -Force
$SLNF=Get-Content "osu-framework.iOS.slnf" | ConvertFrom-Json
$SLNF.solution.projects += ("../veldrid/src/Veldrid/Veldrid.csproj")
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
Move-Item -Path $TMP -Destination "osu-framework.iOS.slnf" -Force

28
UseLocalVeldrid.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/sh
# Run this script to use a local copy of veldrid rather than fetching it from nuget.
# It expects the veldrid directory to be at the same level as the osu-framework directory
#
# https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects
FRAMEWORK_CSPROJ="osu.Framework/osu.Framework.csproj"
SLN="osu-framework.sln"
dotnet remove $FRAMEWORK_CSPROJ reference ppy.Veldrid
dotnet sln $SLN add ../veldrid/src/Veldrid/Veldrid.csproj \
../veldrid/src/Veldrid.MetalBindings/Veldrid.MetalBindings.csproj \
../veldrid/src/Veldrid.OpenGLBindings/Veldrid.OpenGLBindings.csproj
dotnet add $FRAMEWORK_CSPROJ reference ../veldrid/src/Veldrid/Veldrid.csproj
tmp=$(mktemp)
jq '.solution.projects += ["../veldrid/src/Veldrid/Veldrid.csproj"]' osu-framework.Desktop.slnf > $tmp
mv -f $tmp osu-framework.Desktop.slnf
jq '.solution.projects += ["../veldrid/src/Veldrid/Veldrid.csproj"]' osu-framework.Android.slnf > $tmp
mv -f $tmp osu-framework.Android.slnf
jq '.solution.projects += ["../veldrid/src/Veldrid/Veldrid.csproj"]' osu-framework.iOS.slnf > $tmp
mv -f $tmp osu-framework.iOS.slnf