|
3 | 3 | #
|
4 | 4 | # https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects
|
5 | 5 |
|
6 |
| -$CSPROJ="osu.Game/osu.Game.csproj" |
| 6 | +$GAME_CSPROJ="osu.Game/osu.Game.csproj" |
| 7 | +$ANDROID_PROPS="osu.Android.props" |
| 8 | +$IOS_PROPS="osu.iOS.props" |
7 | 9 | $SLN="osu.sln"
|
8 | 10 |
|
9 |
| -dotnet remove $CSPROJ package ppy.osu.Framework; |
10 |
| -dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj ../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj; |
11 |
| -dotnet add $CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj |
| 11 | +dotnet remove $GAME_CSPROJ reference ppy.osu.Framework; |
| 12 | +dotnet remove $ANDROID_PROPS reference ppy.osu.Framework.Android; |
| 13 | +dotnet remove $IOS_PROPS reference ppy.osu.Framework.iOS; |
| 14 | + |
| 15 | +dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj ` |
| 16 | + ../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj ` |
| 17 | + ../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj ` |
| 18 | + ../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj; |
| 19 | + |
| 20 | +dotnet add $GAME_CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj; |
| 21 | +dotnet add $ANDROID_PROPS reference ../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj; |
| 22 | +dotnet add $IOS_PROPS reference ../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj; |
| 23 | + |
| 24 | +# workaround for dotnet add not inserting $(MSBuildThisFileDirectory) on props files |
| 25 | +(Get-Content "osu.Android.props") -replace "`"..\\osu-framework", "`"`$(MSBuildThisFileDirectory)..\osu-framework" | Set-Content "osu.Android.props" |
| 26 | +(Get-Content "osu.iOS.props") -replace "`"..\\osu-framework", "`"`$(MSBuildThisFileDirectory)..\osu-framework" | Set-Content "osu.iOS.props" |
| 27 | + |
| 28 | +# needed because iOS framework nupkg includes a set of properties to work around certain issues during building, |
| 29 | +# and those get ignored when referencing framework via project, threfore we have to manually include it via props reference. |
| 30 | +(Get-Content "osu.iOS.props") | |
| 31 | + Foreach-Object { |
| 32 | + if ($_ -match "</Project>") |
| 33 | + { |
| 34 | + " <Import Project=`"`$(MSBuildThisFileDirectory)../osu-framework/osu.Framework.iOS.props`"/>" |
| 35 | + } |
| 36 | + |
| 37 | + $_ |
| 38 | + } | Set-Content "osu.iOS.props" |
12 | 39 |
|
13 |
| -$SLNF=Get-Content "osu.Desktop.slnf" | ConvertFrom-Json |
14 | 40 | $TMP=New-TemporaryFile
|
| 41 | + |
| 42 | +$SLNF=Get-Content "osu.Desktop.slnf" | ConvertFrom-Json |
15 | 43 | $SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj")
|
16 | 44 | ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
|
17 | 45 | Move-Item -Path $TMP -Destination "osu.Desktop.slnf" -Force
|
| 46 | + |
| 47 | +$SLNF=Get-Content "osu.Android.slnf" | ConvertFrom-Json |
| 48 | +$SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj") |
| 49 | +ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8 |
| 50 | +Move-Item -Path $TMP -Destination "osu.Android.slnf" -Force |
| 51 | + |
| 52 | +$SLNF=Get-Content "osu.iOS.slnf" | ConvertFrom-Json |
| 53 | +$SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj") |
| 54 | +ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8 |
| 55 | +Move-Item -Path $TMP -Destination "osu.iOS.slnf" -Force |
0 commit comments