From 47e3498b7149920e3b32367289cd96424cca2806 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Wed, 30 Oct 2019 22:42:25 +0800 Subject: [PATCH] Use cake as local tool and builds for slnf. --- .config/dotnet-tools.json | 12 ++++++++++++ build.ps1 | 2 +- build.sh | 2 +- build/Desktop.proj | 17 +++++++++++++++++ build/build.cake | 7 ++++--- global.json | 5 +++++ osu.sln | 1 + 7 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 build/Desktop.proj create mode 100644 global.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000000..1b70c949eb --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "cake.tool": { + "version": "0.35.0", + "commands": [ + "dotnet-cake" + ] + } + } +} \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 2dbd10a150..4b3b1f717a 100755 --- a/build.ps1 +++ b/build.ps1 @@ -21,7 +21,7 @@ if ($DryRun) { $cakeArguments += "-dryrun" } if ($Experimental) { $cakeArguments += "-experimental" } $cakeArguments += $ScriptArgs -dotnet tool install Cake.Tool --global --version 0.35.0 +dotnet tool restore dotnet cake ./build/build.cake --bootstrap dotnet cake ./build/build.cake $cakeArguments exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh index ac6bd877a6..2c22f08574 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ echo "Installing Cake.Tool..." -dotnet tool install Cake.Tool --global --version 0.35.0 +dotnet tool restore # Parse arguments. CAKE_ARGUMENTS=() diff --git a/build/Desktop.proj b/build/Desktop.proj new file mode 100644 index 0000000000..b1c6b065e8 --- /dev/null +++ b/build/Desktop.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/build.cake b/build/build.cake index cfdfebee61..389ff4829d 100644 --- a/build/build.cake +++ b/build/build.cake @@ -11,7 +11,8 @@ var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); var rootDirectory = new DirectoryPath(".."); -var solution = rootDirectory.CombineWithFilePath("osu.sln"); +var desktopBuilds = rootDirectory.CombineWithFilePath("build/Desktop.proj"); +var desktopSlnf = rootDirectory.CombineWithFilePath("osu.Desktop.slnf"); /////////////////////////////////////////////////////////////////////////////// // TASKS @@ -19,7 +20,7 @@ var solution = rootDirectory.CombineWithFilePath("osu.sln"); Task("Compile") .Does(() => { - DotNetCoreBuild(solution.FullPath, new DotNetCoreBuildSettings { + DotNetCoreBuild(desktopBuilds.FullPath, new DotNetCoreBuildSettings { Configuration = configuration, }); }); @@ -41,7 +42,7 @@ Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { - InspectCode(solution, new InspectCodeSettings { + InspectCode(desktopSlnf, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); diff --git a/global.json b/global.json new file mode 100644 index 0000000000..d8b8d14c36 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Microsoft.Build.Traversal": "2.0.19" + } +} \ No newline at end of file diff --git a/osu.sln b/osu.sln index 12ea89aaad..1baf62da15 100644 --- a/osu.sln +++ b/osu.sln @@ -56,6 +56,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{10DF8F12-50FD-45D8-8A38-17BA764BF54D}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + global.json = global.json osu.Android.props = osu.Android.props osu.Game.props = osu.Game.props osu.iOS.props = osu.iOS.props