From 137f3495e3d5ffa8c84ccec04ba83d3507f195e4 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 23 Nov 2019 22:10:27 +0800 Subject: [PATCH 01/19] Use appveyor yml back for build. --- appveyor.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f911d67c6e..b64d56d4f6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,5 +2,10 @@ clone_depth: 1 version: '{branch}-{build}' image: Visual Studio 2019 test: off -build_script: - - cmd: PowerShell -Version 2.0 .\build.ps1 +before_build: + - ps: dotnet --info # Useful when version mismatch between CI and local + - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects +build: + project: osu.sln + parallel: true + verbosity: minimal From 8479f8531e8c7d6fdfa929f9b65d5e755121f5b7 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 23 Nov 2019 22:20:38 +0800 Subject: [PATCH 02/19] Android package name cannot contain `Catch`. --- .../Properties/AndroidManifest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch.Tests.Android/Properties/AndroidManifest.xml b/osu.Game.Rulesets.Catch.Tests.Android/Properties/AndroidManifest.xml index 0fa3b7730d..f8c3fcd894 100644 --- a/osu.Game.Rulesets.Catch.Tests.Android/Properties/AndroidManifest.xml +++ b/osu.Game.Rulesets.Catch.Tests.Android/Properties/AndroidManifest.xml @@ -1,5 +1,6 @@  - + + \ No newline at end of file From fbb83045f37174556080b8e58b3bf0f926cd1ae8 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 23 Nov 2019 23:13:30 +0800 Subject: [PATCH 03/19] Enable tests. --- appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b64d56d4f6..d8f54f7494 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,6 @@ clone_depth: 1 version: '{branch}-{build}' image: Visual Studio 2019 -test: off before_build: - ps: dotnet --info # Useful when version mismatch between CI and local - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects @@ -9,3 +8,8 @@ build: project: osu.sln parallel: true verbosity: minimal +test: + assemblies: + except: + - '**\*Android*' + - '**\*iOS*' From 18840c63190d33c480ca407e969be743b4af284c Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sun, 24 Nov 2019 16:53:57 +0800 Subject: [PATCH 04/19] Run format check in CI. --- .config/dotnet-tools.json | 6 ++++++ appveyor.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6ba6ae82c8..e1a2c6025e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,6 +13,12 @@ "commands": [ "dotnet-format" ] + }, + "codefilesanity": { + "version": "0.0.33", + "commands": [ + "CodeFileSanity" + ] } } } \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index d8f54f7494..6c8f073419 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,10 @@ build: project: osu.sln parallel: true verbosity: minimal +after_build: + - ps: dotnet tool restore + - ps: dotnet CodeFileSanity + - ps: dotnet format --dry-run --check test: assemblies: except: From 38dae996a18b512a0645580846a7ec3b04319626 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sun, 24 Nov 2019 17:50:48 +0800 Subject: [PATCH 05/19] Add InspectCode to CI. --- .config/dotnet-tools.json | 6 ----- InspectCode.ps1 | 27 ++++++++++++++++++++ appveyor.yml | 2 +- build/InspectCode.cake | 52 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 InspectCode.ps1 create mode 100644 build/InspectCode.cake diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e1a2c6025e..6ba6ae82c8 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,12 +13,6 @@ "commands": [ "dotnet-format" ] - }, - "codefilesanity": { - "version": "0.0.33", - "commands": [ - "CodeFileSanity" - ] } } } \ No newline at end of file diff --git a/InspectCode.ps1 b/InspectCode.ps1 new file mode 100644 index 0000000000..6ed935fdbb --- /dev/null +++ b/InspectCode.ps1 @@ -0,0 +1,27 @@ +[CmdletBinding()] +Param( + [string]$Target, + [string]$Configuration, + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity, + [switch]$ShowDescription, + [Alias("WhatIf", "Noop")] + [switch]$DryRun, + [Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)] + [string[]]$ScriptArgs +) + +# Build Cake arguments +$cakeArguments = ""; +if ($Target) { $cakeArguments += "-target=$Target" } +if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } +if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } +if ($ShowDescription) { $cakeArguments += "-showdescription" } +if ($DryRun) { $cakeArguments += "-dryrun" } +if ($Experimental) { $cakeArguments += "-experimental" } +$cakeArguments += $ScriptArgs + +dotnet tool restore +dotnet cake ./build/InspectCode.cake --bootstrap +dotnet cake ./build/InspectCode.cake $cakeArguments +exit $LASTEXITCODE \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 6c8f073419..20cf85f44b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,8 +10,8 @@ build: verbosity: minimal after_build: - ps: dotnet tool restore - - ps: dotnet CodeFileSanity - ps: dotnet format --dry-run --check + - ps: .\InspectCode.ps1 test: assemblies: except: diff --git a/build/InspectCode.cake b/build/InspectCode.cake new file mode 100644 index 0000000000..bd3fdf5f93 --- /dev/null +++ b/build/InspectCode.cake @@ -0,0 +1,52 @@ +#addin "nuget:?package=CodeFileSanity&version=0.0.33" +#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.2.1" +#tool "nuget:?package=NVika.MSBuild&version=1.0.1" +var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); + +/////////////////////////////////////////////////////////////////////////////// +// ARGUMENTS +/////////////////////////////////////////////////////////////////////////////// + +var target = Argument("target", "CodeAnalysis"); +var configuration = Argument("configuration", "Release"); + +var rootDirectory = new DirectoryPath(".."); +var sln = rootDirectory.CombineWithFilePath("osu.sln"); +var desktopSlnf = rootDirectory.CombineWithFilePath("osu.Desktop.slnf"); + +/////////////////////////////////////////////////////////////////////////////// +// TASKS +/////////////////////////////////////////////////////////////////////////////// + +// windows only because both inspectcode and nvika depend on net45 +Task("InspectCode") + .WithCriteria(IsRunningOnWindows()) + .Does(() => { + InspectCode(desktopSlnf, new InspectCodeSettings { + CachesHome = "inspectcode", + OutputFile = "inspectcodereport.xml", + ArgumentCustomization = arg => { + if (AppVeyor.IsRunningOnAppVeyor) // Don't flood CI output + arg.Append("--verbosity:WARN"); + return arg; + }, + }); + + int returnCode = StartProcess(nVikaToolPath, $@"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); + if (returnCode != 0) + throw new Exception($"inspectcode failed with return code {returnCode}"); + }); + +Task("CodeFileSanity") + .Does(() => { + ValidateCodeSanity(new ValidateCodeSanitySettings { + RootDirectory = rootDirectory.FullPath, + IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor + }); + }); + +Task("CodeAnalysis") + .IsDependentOn("CodeFileSanity") + .IsDependentOn("InspectCode"); + +RunTarget(target); \ No newline at end of file From 3a62406c581dd533dab5d93c66186d268a292fb4 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sun, 24 Nov 2019 19:44:13 +0800 Subject: [PATCH 06/19] Update deploy script. --- appveyor.yml | 2 ++ appveyor_deploy.yml | 12 ++++++++++-- osu.Game/osu.Game.csproj | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 20cf85f44b..7588520e36 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,8 @@ after_build: - ps: dotnet tool restore - ps: dotnet format --dry-run --check - ps: .\InspectCode.ps1 +artifacts: + - path: '**\*.nupkg' test: assemblies: except: diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index fb7825b31d..208ec38977 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -1,10 +1,18 @@ clone_depth: 1 version: '{build}' image: Visual Studio 2019 +before_build: + - ps: dotnet --info # Useful when version mismatch between CI and local + - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects test: off skip_non_tags: true -build_script: - - cmd: PowerShell -Version 2.0 .\build.ps1 +configuration: Release +build: + project: osu.sln + parallel: true + verbosity: minimal +artifacts: + - path: '**\*.nupkg' deploy: - provider: Environment name: nuget diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 449b4dc4e3..e7614ff395 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -8,6 +8,7 @@ osu! ppy.osu.Game icon.png + true From 575b4db1864fb911b304b45d879b3b9af584651e Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sun, 24 Nov 2019 20:39:11 +0800 Subject: [PATCH 07/19] Patch csproj version. --- appveyor.yml | 4 ++++ appveyor_deploy.yml | 6 +++++- osu.Game/osu.Game.csproj | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7588520e36..333ed94f6e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,10 @@ clone_depth: 1 version: '{branch}-{build}' image: Visual Studio 2019 +dotnet_csproj: + patch: true + file: 'osu.Game\osu.Game.csproj' # Use wildcard when it's able to exclude Xamarin projects + version: '0.0.{build}' before_build: - ps: dotnet --info # Useful when version mismatch between CI and local - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index 208ec38977..d8d18028de 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -1,6 +1,10 @@ clone_depth: 1 version: '{build}' image: Visual Studio 2019 +dotnet_csproj: + patch: true + file: 'osu.Game\osu.Game.csproj' # Use wildcard when it's able to exclude Xamarin projects + version: $(APPVEYOR_REPO_TAG_NAME) before_build: - ps: dotnet --info # Useful when version mismatch between CI and local - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects @@ -8,7 +12,7 @@ test: off skip_non_tags: true configuration: Release build: - project: osu.sln + project: build\Desktop.proj # Skipping Xamarin Release that's slow and covered by fastlane parallel: true verbosity: minimal artifacts: diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index e7614ff395..6c25e9e5fe 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -7,6 +7,7 @@ osu! ppy.osu.Game + 0.0.0 icon.png true From 3c6526bbd2afd3f8b5a45086a9c8ee0541aa30b8 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 25 Nov 2019 15:59:38 +0800 Subject: [PATCH 08/19] Add nuget http cache --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 333ed94f6e..dbe7ed4cf2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,8 @@ dotnet_csproj: patch: true file: 'osu.Game\osu.Game.csproj' # Use wildcard when it's able to exclude Xamarin projects version: '0.0.{build}' +cache: + - '%LOCALAPPDATA%\NuGet\v3-cache' -> appveyor.yml before_build: - ps: dotnet --info # Useful when version mismatch between CI and local - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects From e31e83deaaa29e7f6e69bd11b65fe445fec3a96f Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 25 Nov 2019 16:40:13 +0800 Subject: [PATCH 09/19] Clean up and update readme. --- README.md | 11 ++++++-- build.ps1 | 27 ------------------ build.sh | 17 ----------- build/build.cake | 73 ------------------------------------------------ 4 files changed, 9 insertions(+), 119 deletions(-) delete mode 100755 build.ps1 delete mode 100755 build.sh delete mode 100644 build/build.cake diff --git a/README.md b/README.md index 65fb97eb5d..7bbd43c961 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ Detailed changelogs are published on the [official osu! site](https://osu.ppy.sh - A desktop platform with the [.NET Core SDK 3.0](https://www.microsoft.com/net/learn/get-started) or higher installed. - When running on Linux, please have a system-wide FFmpeg installation available to support video decoding. -- When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs. +- When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?tabs=netcore30&pivots=os-windows)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs. +- When developing with mobile, [Xamarin](https://docs.microsoft.com/en-us/xamarin/) is required, which is shipped together with Visual Studio or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/). - When working with the codebase, we recommend using an IDE with intelligent code completion and syntax highlighting, such as [Visual Studio 2019+](https://visualstudio.microsoft.com/vs/), [JetBrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). ## Running osu! @@ -73,13 +74,19 @@ If you are not interested in debugging osu!, you can add `-c Release` to gain pe If the build fails, try to restore NuGet packages with `dotnet restore`. +_Due to historical feature gap between .NET Core and Xamarin, running `dotnet` CLI from the root directory will probably not work. You can try to run the CLI towards single .NET Core project, or helper project at `build/Desktop.proj`. Or you can get help from your IDE of choice to run the correct commands. We are keeping configuration files in the repository for the popular IDEs._ + ### Testing with resource/framework modifications Sometimes it may be necessary to cross-test changes in [osu-resources](https://github.com/ppy/osu-resources) or [osu-framework](https://github.com/ppy/osu-framework). This can be achieved by running some commands as documented on the [osu-resources](https://github.com/ppy/osu-resources/wiki/Testing-local-resources-checkout-with-other-projects) and [osu-framework](https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects) wiki pages. ### Code analysis -Code analysis can be run with `powershell ./build.ps1` or `build.sh`. This is currently only supported under Windows due to [ReSharper CLI shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternatively, you can install ReSharper or use Rider to get inline support in your IDE of choice. +Before committing your code, please run code formatter. It can be achieved with command `dotnet format`, or `Format code` command in your IDE. (Defaults to `Ctrl+K,Ctrl+D` in Visual Studio, `Shift+Alt+F` in Visual Studio Code, or `Ctrl+Alt+L` in Rider) + +We have adopted some cross-platform, compiler integrated analyzers. They can provide warnings when you are editing, building inside IDE or from command line, as-if they are provided by the compiler itself. + +JetBrains ReSharper InspectCode is also used for wider rule sets. You can run it from PowerShell with `.\InspectCode.ps1`, which is [only supported on Windows](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternatively, you can install ReSharper or use Rider to get inline support in your IDE of choice. ## Contributing diff --git a/build.ps1 b/build.ps1 deleted file mode 100755 index 4b3b1f717a..0000000000 --- a/build.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -[CmdletBinding()] -Param( - [string]$Target, - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity, - [switch]$ShowDescription, - [Alias("WhatIf", "Noop")] - [switch]$DryRun, - [Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)] - [string[]]$ScriptArgs -) - -# Build Cake arguments -$cakeArguments = ""; -if ($Target) { $cakeArguments += "-target=$Target" } -if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } -if ($ShowDescription) { $cakeArguments += "-showdescription" } -if ($DryRun) { $cakeArguments += "-dryrun" } -if ($Experimental) { $cakeArguments += "-experimental" } -$cakeArguments += $ScriptArgs - -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 deleted file mode 100755 index 2c22f08574..0000000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -echo "Installing Cake.Tool..." -dotnet tool restore - -# Parse arguments. -CAKE_ARGUMENTS=() -for i in "$@"; do - case $1 in - -s|--script) SCRIPT="$2"; shift ;; - --) shift; CAKE_ARGUMENTS+=("$@"); break ;; - *) CAKE_ARGUMENTS+=("$1") ;; - esac - shift -done - -echo "Running build script..." -dotnet cake ./build/build.cake --bootstrap -dotnet cake ./build/build.cake "${CAKE_ARGUMENTS[@]}" \ No newline at end of file diff --git a/build/build.cake b/build/build.cake deleted file mode 100644 index 274e57ef4e..0000000000 --- a/build/build.cake +++ /dev/null @@ -1,73 +0,0 @@ -#addin "nuget:?package=CodeFileSanity&version=0.0.33" -#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.2.1" -#tool "nuget:?package=NVika.MSBuild&version=1.0.1" -var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); - -/////////////////////////////////////////////////////////////////////////////// -// ARGUMENTS -/////////////////////////////////////////////////////////////////////////////// - -var target = Argument("target", "Build"); -var configuration = Argument("configuration", "Release"); - -var rootDirectory = new DirectoryPath(".."); -var sln = rootDirectory.CombineWithFilePath("osu.sln"); -var desktopBuilds = rootDirectory.CombineWithFilePath("build/Desktop.proj"); -var desktopSlnf = rootDirectory.CombineWithFilePath("osu.Desktop.slnf"); - -/////////////////////////////////////////////////////////////////////////////// -// TASKS -/////////////////////////////////////////////////////////////////////////////// - -Task("Compile") - .Does(() => { - DotNetCoreBuild(desktopBuilds.FullPath, new DotNetCoreBuildSettings { - Configuration = configuration, - }); - }); - -Task("Test") - .IsDependentOn("Compile") - .Does(() => { - var testAssemblies = GetFiles(rootDirectory + "/**/*.Tests/bin/**/*.Tests.dll"); - - DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { - Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", - Parallel = true, - ToolTimeout = TimeSpan.FromMinutes(10), - }); - }); - -// windows only because both inspectcore and nvika depend on net45 -Task("InspectCode") - .WithCriteria(IsRunningOnWindows()) - .IsDependentOn("Compile") - .Does(() => { - InspectCode(desktopSlnf, new InspectCodeSettings { - CachesHome = "inspectcode", - OutputFile = "inspectcodereport.xml", - }); - - int returnCode = StartProcess(nVikaToolPath, $@"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); - if (returnCode != 0) - throw new Exception($"inspectcode failed with return code {returnCode}"); - }); - -Task("CodeFileSanity") - .Does(() => { - ValidateCodeSanity(new ValidateCodeSanitySettings { - RootDirectory = rootDirectory.FullPath, - IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor - }); - }); - -Task("DotnetFormat") - .Does(() => DotNetCoreTool(sln.FullPath, "format", "--dry-run --check")); - -Task("Build") - .IsDependentOn("CodeFileSanity") - .IsDependentOn("DotnetFormat") - .IsDependentOn("InspectCode") - .IsDependentOn("Test"); - -RunTarget(target); \ No newline at end of file From de3079d8e9bfa577914823eaacb594b6eeed82ee Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 25 Nov 2019 17:14:35 +0800 Subject: [PATCH 10/19] Fix appveyor configuration --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index dbe7ed4cf2..f8469f9f80 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ dotnet_csproj: file: 'osu.Game\osu.Game.csproj' # Use wildcard when it's able to exclude Xamarin projects version: '0.0.{build}' cache: - - '%LOCALAPPDATA%\NuGet\v3-cache' -> appveyor.yml + - '%LOCALAPPDATA%\NuGet\v3-cache -> appveyor.yml' before_build: - ps: dotnet --info # Useful when version mismatch between CI and local - ps: nuget restore -verbosity quiet # Only nuget.exe knows both new (.NET Core) and old (Xamarin) projects @@ -25,3 +25,4 @@ test: except: - '**\*Android*' - '**\*iOS*' + - 'build\**\*' From 9fcc56634121d21a5c34e8153d3c4f0bf23d7e1b Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 25 Nov 2019 18:32:41 +0800 Subject: [PATCH 11/19] Change the postition of nupkg artifacts. --- Directory.Build.props | 1 + appveyor.yml | 2 +- appveyor_deploy.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 838851b712..cee459faf9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -36,5 +36,6 @@ ppy Pty Ltd Copyright (c) 2019 ppy Pty Ltd osu game + $(MSBuildThisFileDirectory)artifacts\nupkg\ \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index f8469f9f80..82c0a21aff 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ after_build: - ps: dotnet format --dry-run --check - ps: .\InspectCode.ps1 artifacts: - - path: '**\*.nupkg' + - path: 'artifacts\nupkg\*.nupkg' test: assemblies: except: diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index d8d18028de..c7f762d425 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -16,7 +16,7 @@ build: parallel: true verbosity: minimal artifacts: - - path: '**\*.nupkg' + - path: 'artifacts\nupkg\*.nupkg' deploy: - provider: Environment name: nuget From 8928f05f4f262c9fdcdb596e5debb95f05d21a5f Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 26 Nov 2019 01:39:48 +0800 Subject: [PATCH 12/19] Temporarily remove deepequal test from Android to make CI green. --- osu.Game.Tests.Android/osu.Game.Tests.Android.csproj | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj b/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj index c2dd194e09..c44ed69c4d 100644 --- a/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj +++ b/osu.Game.Tests.Android/osu.Game.Tests.Android.csproj @@ -24,6 +24,7 @@ %(RecursiveDir)%(Filename)%(Extension) + %(RecursiveDir)%(Filename)%(Extension) @@ -68,10 +69,5 @@ osu.Game - - - 2.0.0 - - \ No newline at end of file From aa1545c9388a937db3ee4d1b4651d8cd0cf55747 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 26 Nov 2019 15:52:22 +0800 Subject: [PATCH 13/19] Refine words in README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7bbd43c961..7adc8dc973 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ If you are not interested in debugging osu!, you can add `-c Release` to gain pe If the build fails, try to restore NuGet packages with `dotnet restore`. -_Due to historical feature gap between .NET Core and Xamarin, running `dotnet` CLI from the root directory will probably not work. You can try to run the CLI towards single .NET Core project, or helper project at `build/Desktop.proj`. Or you can get help from your IDE of choice to run the correct commands. We are keeping configuration files in the repository for the popular IDEs._ +_Due to historical feature gap between .NET Core and Xamarin, running `dotnet` CLI from the root directory will not work for most commands. This can be resolved by specifying a target `.csproj` or the helper project at `build/Desktop.proj`. Configurations have been provided to work around this issue for all supported IDEs mentioned above._ ### Testing with resource/framework modifications @@ -82,7 +82,7 @@ Sometimes it may be necessary to cross-test changes in [osu-resources](https://g ### Code analysis -Before committing your code, please run code formatter. It can be achieved with command `dotnet format`, or `Format code` command in your IDE. (Defaults to `Ctrl+K,Ctrl+D` in Visual Studio, `Shift+Alt+F` in Visual Studio Code, or `Ctrl+Alt+L` in Rider) +Before committing your code, please run a code formatter. It can be achieved with `dotnet format` in command line, or `Format code` command in your IDE. We have adopted some cross-platform, compiler integrated analyzers. They can provide warnings when you are editing, building inside IDE or from command line, as-if they are provided by the compiler itself. From deaeda7348c8cfcf67083dd2bd7631cbdfb00610 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 26 Nov 2019 16:40:48 +0800 Subject: [PATCH 14/19] Change packing to be runned by AppVeyor. --- Directory.Build.props | 2 +- appveyor.yml | 3 +-- appveyor_deploy.yml | 3 +-- osu.Game/osu.Game.csproj | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index cee459faf9..693e132c40 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -28,6 +28,7 @@ $(NoWarn);NU1701 + false ppy Pty Ltd MIT https://github.com/ppy/osu @@ -36,6 +37,5 @@ ppy Pty Ltd Copyright (c) 2019 ppy Pty Ltd osu game - $(MSBuildThisFileDirectory)artifacts\nupkg\ \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 82c0a21aff..a4a0cedc66 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,12 +14,11 @@ build: project: osu.sln parallel: true verbosity: minimal + publish_nuget: true after_build: - ps: dotnet tool restore - ps: dotnet format --dry-run --check - ps: .\InspectCode.ps1 -artifacts: - - path: 'artifacts\nupkg\*.nupkg' test: assemblies: except: diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index c7f762d425..bb4482f501 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -15,8 +15,7 @@ build: project: build\Desktop.proj # Skipping Xamarin Release that's slow and covered by fastlane parallel: true verbosity: minimal -artifacts: - - path: 'artifacts\nupkg\*.nupkg' + publish_nuget: true deploy: - provider: Environment name: nuget diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6c25e9e5fe..2e456f1fa1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -9,7 +9,7 @@ ppy.osu.Game 0.0.0 icon.png - true + true From fe0785657cc8cc86df8a32f4f04fdcda3b7068cb Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Wed, 27 Nov 2019 19:37:11 +0800 Subject: [PATCH 15/19] Turn WarningAsError to always on. --- Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/Directory.Build.props b/Directory.Build.props index 693e132c40..572d97fafa 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,6 +2,7 @@ 7.3 + true $(MSBuildThisFileDirectory)app.manifest From 2865f320524dd149de900aa09516075df17162d4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Nov 2019 00:13:44 +0900 Subject: [PATCH 16/19] Fix nullref on clicking links in tests --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 61391b7102..2bbac92f7f 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -19,14 +19,8 @@ namespace osu.Game.Graphics.Containers { } - private OsuGame game; - - [BackgroundDependencyLoader(true)] - private void load(OsuGame game) - { - // will be null in tests - this.game = game; - } + [Resolved(CanBeNull = true)] + private OsuGame game { get; set; } public void AddLinks(string text, List links) { @@ -82,7 +76,7 @@ namespace osu.Game.Graphics.Containers if (action != null) action(); else - game.HandleLink(link); + game?.HandleLink(link); }, }); } From a2d935bebf7bb43bb5a35f966166ad3c1d1e42c6 Mon Sep 17 00:00:00 2001 From: Luxiono <55364481+Luxiono@users.noreply.github.com> Date: Wed, 27 Nov 2019 20:58:13 -0500 Subject: [PATCH 17/19] Adjust wording and make small format changes This makes small changes to the README file to make certain parts properly formatted (such as adding 'a' in front of a sentence with 'to' straight before it, as done in the Building section) and added special formatting where it feels needed. This may also make certain sentences slightly more natural. Please let me know if you want any other changes. --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7adc8dc973..e343e498cd 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ [![CodeFactor](https://www.codefactor.io/repository/github/ppy/osu/badge)](https://www.codefactor.io/repository/github/ppy/osu) [![dev chat](https://discordapp.com/api/guilds/188630481301012481/widget.png?style=shield)](https://discord.gg/ppy) -Rhythm is just a *click* away. The future of [osu!](https://osu.ppy.sh) and the beginning of an open era! Commonly known by the codename "osu!lazer". Pew pew. +Rhythm is just a *click* away. The future of [osu!](https://osu.ppy.sh) and the beginning of an open era! Commonly known by the codename *osu!lazer*. Pew pew. ## Status -This project is still heavily under development, but is in a state where users are encouraged to try it out and keep it installed alongside the stable osu! client. It will continue to evolve over the coming months and hopefully bring some new unique features to the table. +This project is still heavily under development, but is in a state where users are encouraged to try it out and keep it installed alongside the stable *osu!* client. It will continue to evolve over the coming months and hopefully bring some new unique features to the table. We are accepting bug reports (please report with as much detail as possible). Feature requests are welcome as long as you read and understand the contribution guidelines listed below. @@ -59,22 +59,22 @@ git pull ### Building -Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided [below](#contributing). +Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this is provided [below](#contributing). -- Visual Studio / Rider users should load the project via one of the platform-specific .slnf files, rather than the main .sln. This will allow access to template run configurations. +- Visual Studio / Rider users should load the project via one of the platform-specific `.slnf` files, rather than the main `.sln.` This will allow access to template run configurations. - Visual Studio Code users must run the `Restore` task before any build attempt. -You can also build and run osu! from the command-line with a single command: +You can also build and run *osu!* from the command-line with a single command: ```shell dotnet run --project osu.Desktop ``` -If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in any commands mentioned in this document. +If you are not interested in debugging *osu!*, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in any commands mentioned in this document. If the build fails, try to restore NuGet packages with `dotnet restore`. -_Due to historical feature gap between .NET Core and Xamarin, running `dotnet` CLI from the root directory will not work for most commands. This can be resolved by specifying a target `.csproj` or the helper project at `build/Desktop.proj`. Configurations have been provided to work around this issue for all supported IDEs mentioned above._ +_Due to a historical feature gap between .NET Core and Xamarin, running `dotnet` CLI from the root directory will not work for most commands. This can be resolved by specifying a target `.csproj` or the helper project at `build/Desktop.proj`. Configurations have been provided to work around this issue for all supported IDEs mentioned above._ ### Testing with resource/framework modifications @@ -82,7 +82,7 @@ Sometimes it may be necessary to cross-test changes in [osu-resources](https://g ### Code analysis -Before committing your code, please run a code formatter. It can be achieved with `dotnet format` in command line, or `Format code` command in your IDE. +Before committing your code, please run a code formatter. This can be achieved with running `dotnet format` in the command line, or the `Format code` command in your IDE. We have adopted some cross-platform, compiler integrated analyzers. They can provide warnings when you are editing, building inside IDE or from command line, as-if they are provided by the compiler itself. @@ -90,19 +90,19 @@ JetBrains ReSharper InspectCode is also used for wider rule sets. You can run it ## Contributing -We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention of having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted. +We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention of having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time to ensure no effort is wasted. If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu/issues) (especially those with the ["good first issue"](https://github.com/ppy/osu/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22) label). Before starting, please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have set up. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. -Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. We welcome all feedback so we can make contributing to this project as pain-free as possible. +Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured, with any libraries we are using, or with any processes involved with contributing, *please* bring it up. We welcome all feedback so we can make contributing to this project as painless as possible. For those interested, we love to reward quality contributions via [bounties](https://docs.google.com/spreadsheets/d/1jNXfj_S3Pb5PErA-czDdC9DUu4IgUbe1Lt8E7CYUJuE/view?&rm=minimal#gid=523803337), paid out via PayPal or osu!supporter tags. Don't hesitate to [request a bounty](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform) for your work on this project. ## Licence -The osu! client code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. +The *osu!client* code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. Please note that this *does not cover* the usage of the "osu!" or "ppy" branding in any software, resources, advertising or promotion, as this is protected by trademark law. From 078e0c10581527b9aa6323454722ad8b2a986d62 Mon Sep 17 00:00:00 2001 From: Luxiono <55364481+Luxiono@users.noreply.github.com> Date: Wed, 27 Nov 2019 21:11:42 -0500 Subject: [PATCH 18/19] Add peppy's suggestion Co-Authored-By: Dean Herbert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e343e498cd..ac164b3e8d 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ For those interested, we love to reward quality contributions via [bounties](htt ## Licence -The *osu!client* code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. +*osu!*'s code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. Please note that this *does not cover* the usage of the "osu!" or "ppy" branding in any software, resources, advertising or promotion, as this is protected by trademark law. From 32aa624ef3e941bc838ea956b487211310d05b3b Mon Sep 17 00:00:00 2001 From: Luxiono <55364481+Luxiono@users.noreply.github.com> Date: Wed, 27 Nov 2019 21:12:45 -0500 Subject: [PATCH 19/19] Add peppy's suggestion (part 2) Co-Authored-By: Dean Herbert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac164b3e8d..e2e854c755 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Sometimes it may be necessary to cross-test changes in [osu-resources](https://g ### Code analysis -Before committing your code, please run a code formatter. This can be achieved with running `dotnet format` in the command line, or the `Format code` command in your IDE. +Before committing your code, please run a code formatter. This can be achieved by running `dotnet format` in the command line, or using the `Format code` command in your IDE. We have adopted some cross-platform, compiler integrated analyzers. They can provide warnings when you are editing, building inside IDE or from command line, as-if they are provided by the compiler itself.