Skip to content

Commit

Permalink
WIP: dotnet support, see #13
Browse files Browse the repository at this point in the history
  • Loading branch information
cd21h committed Nov 1, 2017
1 parent 312bed3 commit e590c76
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 18 deletions.
29 changes: 18 additions & 11 deletions Properties/Build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<NugetWorkspace>$([System.IO.Path]::GetFullPath('$(BuildPath)\..\NugetWorkspace'))</NugetWorkspace>
<SpecificationReportPath>$(DropsPath)\SpecificationReports</SpecificationReportPath>
<NUnitResultsPath>$(DropsPath)\TestResults</NUnitResultsPath>
<ForcedMSBuildProperties>Configuration=Release;Platform=Any CPU</ForcedMSBuildProperties>
<BuildConfig>Release</BuildConfig>
<ForcedMSBuildProperties>Configuration=$(BuildConfig);Platform=Any CPU</ForcedMSBuildProperties>
<InstallerNameWithoutExtension>$(SolutionName).Setup</InstallerNameWithoutExtension>
<ReferencedAssembliesPath>$([System.IO.Path]::GetFullPath('$(BuildPath)\..\ReferencedAssemblies'))</ReferencedAssembliesPath>
<PackageName>$(SolutionName)</PackageName>
Expand Down Expand Up @@ -93,8 +94,8 @@

<Choose>
<When Condition=" '$(GitVersion_NuGetVersion)' != '' ">
<PropertyGroup>
<NuGetVersion>$(GitVersion_NuGetVersion)</NuGetVersion>
<PropertyGroup>
<NuGetVersion>$(GitVersion_NuGetVersion)</NuGetVersion>
</PropertyGroup>
</When>
<Otherwise>
Expand All @@ -114,13 +115,19 @@
</Choose>


<ItemGroup>
<SolutionsToBuild Include="$(SolutionsPath)\$(SolutionName).sln;"/>
<ProjectBuildArtefactFolders Include="$(ApplicationsPath)\$(SolutionName)\bin;
$(ApplicationsPath)\$(SolutionName)\obj;
$(DeploymentProjectPath)\bin;
$(DeploymentProjectPath)\obj;
$(SpecificationReportPath)" />
</ItemGroup>
<Choose>
<When Condition=" '$(UseDotNetCli)' == 'true' ">
</When>
<Otherwise>
<ItemGroup>
<SolutionsToBuild Include="$(SolutionsPath)\$(SolutionName).sln;" />
<ProjectBuildArtefactFolders Include="$(ApplicationsPath)\$(SolutionName)\bin;
$(ApplicationsPath)\$(SolutionName)\obj;
$(DeploymentProjectPath)\bin;
$(DeploymentProjectPath)\obj;
$(SpecificationReportPath)" />
</ItemGroup>
</Otherwise>
</Choose>

</Project>
3 changes: 2 additions & 1 deletion Properties/Global.Imports
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<Import Project="$(TasksPath)\MSBuild.Extended.tasks" />

<!-- Import Custom Project Targets -->
<Import Project="$(TargetsPath)\BuildSolutions.target" />
<Import Project="$(TargetsPath)\BuildSolutions.target" Condition=" '$(UseDotNetCli)' != 'true' " />
<Import Project="$(TargetsPath)\DotNetBuild.target" Condition=" '$(UseDotNetCli)' == 'true' "/>
<Import Project="$(TargetsPath)\BuildSuccess.target" />
<Import Project="$(TargetsPath)\CleanSolution.target" />
<Import Project="$(TargetsPath)\CreateDrops.target" />
Expand Down
6 changes: 0 additions & 6 deletions Targets/BuildSolutions.target
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@

<Message Text="SolutionsToBuild: @(SolutionsToBuild)" />

<!-- *** This line must NOT be merged back into the regular Build branch *** -->
<!--<ReadLinesFromFile File="$(VersioningPath)\BuildNumber.txt">
<Output TaskParameter="Lines" PropertyName="BuildNumber"/>
</ReadLinesFromFile>-->

<MSBuild
Projects="@(SolutionsToBuild)"
Properties="$(ForcedMSBuildProperties);BuildNumber=$(VersionBuild);$(HardLinksOptions)" />

</Target>

</Project>
16 changes: 16 additions & 0 deletions Targets/DotNetBuild.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="DotNetRestore" Condition=" '$(UseDotNetCli)' == 'true' ">
<Exec Command="dotnet restore" WorkingDirectory="$(SolutionsPath)"/>
</Target>

<Target Name="DotNetBuild" Condition=" '$(UseDotNetCli)' == 'true' "
DependsOnTargets="DotNetRestore">

<Message Text="Solution path: $(SolutionsPath)" />

<Exec Command="dotnet build -c $(BuildConfig)" WorkingDirectory="$(SolutionsPath)"/>
</Target>

</Project>

0 comments on commit e590c76

Please sign in to comment.