Skip to content

Commit c232d88

Browse files
Dont hardcode the dotnet frameworks we target (#49)
Load them from the project file instead
1 parent 75d9005 commit c232d88

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

build/Build.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Build : NukeBuild
2222
{
2323
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
2424

25-
[Solution] readonly Solution Solution;
25+
[Solution(GenerateProjects = true)] readonly Solution Solution;
2626

2727
[NukeOctoVersion] readonly OctoVersionInfo OctoVersionInfo;
2828

@@ -82,13 +82,7 @@ class Build : NukeBuild
8282
.DependsOn(Test)
8383
.Executes(() =>
8484
{
85-
//todo: figure out a better way of doing this.
86-
// unfortunately we cant use nuke to parse it from the solution file, as our use of things like
87-
// "([MSBuild]::IsOSUnixLike())" means that it wont parse
88-
89-
var targets = new[] { "netstandard2.0", "netcoreapp3.1", "net5.0" };
90-
if (EnvironmentInfo.IsWin)
91-
targets = targets.Concat("net452").ToArray();
85+
var targets = Solution.CommandLine.GetTargetFrameworks();
9286

9387
foreach (var target in targets)
9488
{

0 commit comments

Comments
 (0)