Skip to content

Commit

Permalink
Reimplement MSBuild task integration
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed May 1, 2019
1 parent 763018e commit 71c5155
Show file tree
Hide file tree
Showing 18 changed files with 286 additions and 329 deletions.
5 changes: 2 additions & 3 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ partial class Build : NukeBuild
.SetProjectFile(Solution));
});

[Unlisted] [ProjectFrom(nameof(Solution))] Project CommonProject;
[Unlisted] [ProjectFrom(nameof(Solution))] Project GlobalToolProject;
[Unlisted] [ProjectFrom(nameof(Solution))] Project CodeGenerationProject;
[Unlisted] [ProjectFrom(nameof(Solution))] Project MSBuildTaskRunnerProject;

Target Compile => _ => _
.DependsOn(Restore)
Expand All @@ -96,7 +95,7 @@ partial class Build : NukeBuild
.SetFileVersion(GitVersion.GetNormalizedFileVersion())
.SetInformationalVersion(GitVersion.InformationalVersion)
.CombineWith(
from project in new[] { GlobalToolProject, CommonProject, CodeGenerationProject }
from project in new[] { GlobalToolProject, MSBuildTaskRunnerProject }
from framework in project.GetTargetFrameworks()
select new { project, framework }, (cs, v) => cs
.SetProject(v.project)
Expand Down
6 changes: 6 additions & 0 deletions nuke-common.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nuke.GlobalTool", "source\N
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nuke.GlobalTool.Tests", "source\Nuke.GlobalTool.Tests\Nuke.GlobalTool.Tests.csproj", "{BD416DD4-06F4-4246-B92C-B261B026B6E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nuke.MSBuildTaskRunner", "source\Nuke.MSBuildTaskRunner\Nuke.MSBuildTaskRunner.csproj", "{8166FF13-87CF-45BC-B307-7A16329B6981}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,6 +67,10 @@ Global
{BD416DD4-06F4-4246-B92C-B261B026B6E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD416DD4-06F4-4246-B92C-B261B026B6E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD416DD4-06F4-4246-B92C-B261B026B6E9}.Release|Any CPU.Build.0 = Release|Any CPU
{8166FF13-87CF-45BC-B307-7A16329B6981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8166FF13-87CF-45BC-B307-7A16329B6981}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8166FF13-87CF-45BC-B307-7A16329B6981}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8166FF13-87CF-45BC-B307-7A16329B6981}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 1 addition & 4 deletions source/Nuke.CodeGeneration/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ public static void GenerateCode(
tool.Namespace = namespaceProvider?.Invoke(tool);
ApplyRuntimeInformation(tool, specificationFile, sourceFileProvider, namespaceProvider);

var outputFile = outputFileProvider?.Invoke(tool) ??
Path.Combine(Path.GetDirectoryName(tool.SpecificationFile).NotNull(), tool.DefaultOutputFileName);

GenerateCode(tool, outputFile);
GenerateCode(tool, outputFileProvider?.Invoke(tool) ?? tool.DefaultOutputFile);
}
}

Expand Down
62 changes: 0 additions & 62 deletions source/Nuke.CodeGeneration/CodeGeneratorTask.cs

This file was deleted.

15 changes: 4 additions & 11 deletions source/Nuke.CodeGeneration/Nuke.CodeGeneration.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.6.3" />
<PackageReference Include="Humanizer" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.5" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Nuke.Common\Nuke.Common.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == ''">
<None Include="$(MSBuildProjectName).targets" PackagePath="build\netstandard2.0" Pack="true" />
<None Include="$(MSBuildProjectName).targets" PackagePath="build\net461" Pack="true" />
<None Include="bin\$(Configuration)\netstandard2.0\publish\**\*.*" PackagePath="build\netstandard2.0" Pack="true" />
<None Include="bin\$(Configuration)\net461\publish\**\*.*" PackagePath="build\net461" Pack="true" />
</ItemGroup>

<ItemGroup>
<Nuke Include="..\..\build\Build.CodeGeneration.cs" />
</ItemGroup>

</Project>
22 changes: 0 additions & 22 deletions source/Nuke.Common.Tests/ExternalFilesTaskTest.cs

This file was deleted.

2 changes: 1 addition & 1 deletion source/Nuke.Common.Tests/ProjectModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void SolutionTest()
var solution = ProjectModelTasks.ParseSolution(SolutionFile);

solution.SolutionFolders.Select(x => x.Name).Should().BeEquivalentTo("misc");
solution.AllProjects.Where(x => x.Is(ProjectType.CSharpProject)).Should().HaveCount(7);
solution.AllProjects.Where(x => x.Is(ProjectType.CSharpProject)).Should().HaveCount(8);

var buildProject = solution.AllProjects.SingleOrDefault(x => x.Name == "_build");
buildProject.Should().NotBeNull();
Expand Down
109 changes: 0 additions & 109 deletions source/Nuke.Common/BuildTasks/ExternalFilesTask.cs

This file was deleted.

35 changes: 0 additions & 35 deletions source/Nuke.Common/BuildTasks/Nuke.Common.targets

This file was deleted.

Loading

0 comments on commit 71c5155

Please sign in to comment.