forked from ppy/osu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UseLocalVeldrid.ps1
38 lines (30 loc) · 2.03 KB
/
UseLocalVeldrid.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.OpenGLBindings/Veldrid.OpenGLBindings.csproj")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.MetalBindings/Veldrid.MetalBindings.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")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.OpenGLBindings/Veldrid.OpenGLBindings.csproj")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.MetalBindings/Veldrid.MetalBindings.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")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.OpenGLBindings/Veldrid.OpenGLBindings.csproj")
$SLNF.solution.projects += ("../veldrid/src/Veldrid.MetalBindings/Veldrid.MetalBindings.csproj")
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
Move-Item -Path $TMP -Destination "osu-framework.iOS.slnf" -Force