Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UseLocalVeldrid scripts #5835

Merged
merged 1 commit into from
Jun 12, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions UseLocalVeldrid.ps1
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions UseLocalVeldrid.sh
Original file line number Diff line number Diff line change
@@ -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