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

Remove unique dev assembly #185

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Development --no-restore
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Rush (dev build)
path: osu.Game.Rulesets.Rush/bin/Development/netstandard2.1/osu.Game.Rulesets.Rush-dev.dll
path: osu.Game.Rulesets.Rush/bin/Debug/netstandard2.1/osu.Game.Rulesets.Rush.dll
12 changes: 0 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,5 @@
"preLaunchTask": "Build tests (Release)",
"console": "internalConsole"
},
{
"name": "Rush for osu! (Tests, Development)",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": [
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Development/net5.0/osu.Game.Rulesets.Rush.Tests.dll"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Build tests (Development)",
"console": "internalConsole"
},
]
}
15 changes: 0 additions & 15 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "Build tests (Development)",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"osu.Game.Rulesets.Rush.Tests",
"/p:Configuration=Development",
"/p:GenerateFullPaths=true",
"/m",
"/verbosity:m"
],
"group": "build",
"problemMatcher": "$msCompile"
},
// Test Tasks
{
"label": "Run tests (Debug)",
Expand Down
5 changes: 0 additions & 5 deletions osu.Game.Rulesets.Rush.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Development|Any CPU = Development|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Release|Any CPU.Build.0 = Release|Any CPU
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Development|Any CPU.ActiveCfg = Development|Any CPU
{5AE1F0F1-DAFA-46E7-959C-DA233B7C87E9}.Development|Any CPU.Build.0 = Development|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Release|Any CPU.Build.0 = Release|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Development|Any CPU.ActiveCfg = Development|Any CPU
{B4577C85-CB83-462A-BCE3-22FFEB16311D}.Development|Any CPU.Build.0 = Development|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 5 additions & 2 deletions osu.Game.Rulesets.Rush/RushRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
Expand Down Expand Up @@ -30,11 +32,12 @@ public class RushRuleset : Ruleset
{
public const string SHORT_NAME = "rush";

private static readonly Lazy<bool> is_development_build = new Lazy<bool>(() => typeof(RushRuleset).Assembly.GetName().Name.EndsWith("-dev"));
private static readonly Lazy<bool> is_development_build
= new Lazy<bool>(() => typeof(RushRuleset).Assembly.GetCustomAttributes(false).OfType<DebuggableAttribute>().Any(da => da.IsJITTrackingEnabled));

public static bool IsDevelopmentBuild => is_development_build.Value;

public override string ShortName => !IsDevelopmentBuild ? SHORT_NAME : $"{SHORT_NAME}-dev";
public override string ShortName => SHORT_NAME;

public override string Description => !IsDevelopmentBuild ? "Rush!" : "Rush! (dev build)";

Expand Down
49 changes: 15 additions & 34 deletions osu.Game.Rulesets.Rush/osu.Game.Rulesets.Rush.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<Configurations>Debug;Release;Development</Configurations>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Rush</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Development' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
</PropertyGroup>
<Choose>
<When Condition=" '$(Configuration)' == 'Release' ">
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush</AssemblyName>
<PropertyGroup Label="Project">
<AssemblyTitle>rush for osu!</AssemblyTitle>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush-dev</AssemblyName>
<AssemblyName>osu.Game.Rulesets.Rush</AssemblyName>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Rush</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="!('$(Configuration)' == 'Release')">
<AssemblyTitle>rush for osu! (development build)</AssemblyTitle>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<!-- The automated version of this (<EmbeddedResource Include="xyz\**" />) would prepend the RootNamespace to name,
that will not work well with DllResourceStore as it can only determine the root namespace via AssemblyName,
and we change that based on the build configuration for separation purposes.
Therefore prepend the AssemblyName to embedded resources names instead. -->
<EmbeddedResource Include="Resources\**">
<LogicalName>$(AssemblyName).$([System.String]::Copy(%(Identity)).Replace($([System.IO.Path]::DirectorySeparatorChar.ToString()), '.'))</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2021.927.0" />
</ItemGroup>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\**"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2021.927.0" />
</ItemGroup>
</Project>