Skip to content

Commit ed90d61

Browse files
committed
[RiderJson] Add DevEnv value for Rider and cleanup
1 parent 747f63e commit ed90d61

File tree

13 files changed

+220
-158
lines changed

13 files changed

+220
-158
lines changed

Sharpmake.Application/CommandLineArguments.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public enum InputType
6363
public string DebugSolutionStartArguments = string.Empty;
6464
public string DebugSolutionPath = string.Empty;
6565
public DevEnv DebugSolutionDevEnv = DebugProjectGenerator.DefaultDevEnv;
66-
public bool GenerateRdJson = false;
6766

6867
[CommandLine.Option("sources", @"sharpmake sources files: ex: /sources( ""project1.sharpmake"", ""..\..\project2.sharpmake"" )")]
6968
public void SetSources(params string[] files)
@@ -363,14 +362,6 @@ public void CommandLineForceCleanup(string autocleanupDb)
363362
Exit = true;
364363
}
365364

366-
[CommandLine.Option("rdjson", @"Generate Rider project files")]
367-
public void CommandLineGenerateRdJson(bool minimize = false, bool ignoreDefaults = false)
368-
{
369-
GenerateRdJson = true;
370-
RiderJson.Minimize = minimize;
371-
RiderJson.IgnoreDefaults = ignoreDefaults;
372-
}
373-
374365
public void Validate()
375366
{
376367
if (Assemblies.Length == 0 && Sources.Length == 0)

Sharpmake.Application/Program.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,6 @@ public static Builder CreateBuilder(BuildContext.BaseBuildContext context, Argum
658658
+ $" Make sure to have a static entry point method flagged with [{typeof(Main).FullName}] attribute, and add 'arguments.Generate<[your_class]>();' in it.");
659659
builder.Context.ConfigureOrder = builder.Arguments.ConfigureOrder;
660660

661-
if (parameters.GenerateRdJson)
662-
{
663-
builder.EventPostGenerationReport += RiderJson.PostGenerationCallback;
664-
}
665-
666661
// Call all configuration's methods and resolve project/solution member's values
667662
using (Builder.Instance.CreateProfilingScope("Build"))
668663
builder.BuildProjectAndSolution();

Sharpmake.Application/Properties/launchSettings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@
116116
"commandLineArgs": "/sources(@\u0027QTFileCustomBuild.sharpmake.cs\u0027)",
117117
"workingDirectory": "$(ProjectDir)\\..\\samples\\QTFileCustomBuild"
118118
},
119+
"Sample (RiderJson)": {
120+
"commandName": "Project",
121+
"commandLineArgs": "/sources(@\u0027RiderJson.sharpmake.cs\u0027)",
122+
"workingDirectory": "$(ProjectDir)\\..\\samples\\RiderJson"
123+
},
119124
"Sample (SimpleExeLibDependency)": {
120125
"commandName": "Project",
121126
"commandLineArgs": "/sources(@\u0027SimpleExeLibDependency.sharpmake.cs\u0027)",

Sharpmake.Generators/GeneratorManager.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Sharpmake.Generators.Apple;
66
using Sharpmake.Generators.FastBuild;
77
using Sharpmake.Generators.Generic;
8+
using Sharpmake.Generators.Rider;
89
using Sharpmake.Generators.VisualStudio;
910

1011
namespace Sharpmake.Generators
@@ -25,6 +26,9 @@ public class GeneratorManager : IGeneratorManager
2526
private MakeApplication _makeApplicationGenerator = null;
2627
public MakeApplication MakeApplicationGenerator => _makeApplicationGenerator ?? (_makeApplicationGenerator = new MakeApplication());
2728

29+
public RiderJson _riderJsonGenerator = null;
30+
public RiderJson RiderJsonGenerator => _riderJsonGenerator ?? (_riderJsonGenerator = new RiderJson());
31+
2832
// Project generators
2933
private CSproj _csprojGenerator = null;
3034
public CSproj CsprojGenerator => _csprojGenerator ?? (_csprojGenerator = new CSproj());
@@ -104,6 +108,11 @@ public void Generate(Builder builder,
104108
BffGenerator.Generate(builder, project, configurations, projectFile, generatedFiles, skipFiles);
105109
break;
106110
}
111+
case DevEnv.rider:
112+
{
113+
BffGenerator.Generate(builder, project, configurations, projectFile, generatedFiles, skipFiles);
114+
break;
115+
}
107116
default:
108117
{
109118
throw new Error("Generate called with unknown DevEnv: " + devEnv);
@@ -158,6 +167,17 @@ public void Generate(Builder builder,
158167
SlnGenerator.Generate(builder, solution, configurations, solutionFile, generatedFiles, skipFiles);
159168
break;
160169
}
170+
case DevEnv.rider:
171+
{
172+
if (UtilityMethods.HasFastBuildConfig(configurations))
173+
{
174+
var masterBff = new MasterBff();
175+
masterBff.Generate(builder, solution, configurations, solutionFile, generatedFiles, skipFiles);
176+
}
177+
178+
RiderJsonGenerator.Generate(builder, solution, configurations, solutionFile, generatedFiles, skipFiles);
179+
break;
180+
}
161181
default:
162182
{
163183
throw new Error("Generate called with unknown DevEnv: " + devEnv);

Sharpmake.Generators/Rider/RiderJson.Template.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace Sharpmake.Generators.Rider
1+
// Copyright (c) Ubisoft. All Rights Reserved.
2+
// Licensed under the Apache 2.0 License. See LICENSE.md in the project root for license information.
3+
4+
namespace Sharpmake.Generators.Rider
25
{
36
public partial class RiderJson
47
{

Sharpmake.Generators/Rider/RiderJson.Util.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using System;
1+
// Copyright (c) Ubisoft. All Rights Reserved.
2+
// Licensed under the Apache 2.0 License. See LICENSE.md in the project root for license information.
3+
4+
using System;
25
using System.Collections;
36
using System.Linq;
47
using Sharpmake.Generators.VisualStudio;
@@ -81,7 +84,7 @@ public static string GetCompiler(this IGenerationContext context)
8184
return Compiler.Clang;
8285
}
8386

84-
switch (context.Configuration.Compiler)
87+
switch (toolset.GetDefaultDevEnvForToolset())
8588
{
8689
case DevEnv.vs2015:
8790
return Compiler.Vs15;

0 commit comments

Comments
 (0)