Skip to content

Commit

Permalink
Fix solcodegen build order to use use regular dotnet build (paralle…
Browse files Browse the repository at this point in the history
…l) on slow build server
  • Loading branch information
zone117x committed Nov 20, 2018
1 parent 3037f1d commit e043624
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
File renamed without changes.
10 changes: 10 additions & 0 deletions src/Before.Meadow.sln.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<SolCodeGenFileExe>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen/bin/Internal/netcoreapp2.1/Meadow.SolCodeGen.dll'))</SolCodeGenFileExe>
<SolCodeGenBuild>dotnet build "$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen'))" -f netcoreapp2.1 -c Internal</SolCodeGenBuild>
</PropertyGroup>
<Target Name="PrepareSolCodeGen" BeforeTargets="Build">
<Message Importance="High" Text="Running: $(SolCodeGenBuild)" Condition="!Exists('$(SolCodeGenFileExe)')" />
<Exec Command="$(SolCodeGenBuild)" Condition="!Exists('$(SolCodeGenFileExe)')" />
</Target>
</Project>
10 changes: 10 additions & 0 deletions src/Meadow.SolCodeGen/Meadow.SolCodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Internal|AnyCPU' ">
<IntermediateOutputPath>obj\Internal\$(TargetFramework)</IntermediateOutputPath>
<OutputPath>bin\Internal</OutputPath>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<DefineConstants>;LANG_7_3;TRACE;DEBUG;NETCOREAPP;NETCOREAPP2_1</DefineConstants>
<DocumentationFile>obj\Internal\$(TargetFramework)\Meadow.SolCodeGen.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.5" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
Expand Down
3 changes: 2 additions & 1 deletion src/Meadow.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
..\.travis.yml = ..\.travis.yml
after.Meadow.sln.targets = after.Meadow.sln.targets
..\appveyor.yml = ..\appveyor.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Expand All @@ -18,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
run-coverage-tests.bat = run-coverage-tests.bat
SolCodeGen.targets = SolCodeGen.targets
solution.ruleset = solution.ruleset
Before.Meadow.sln.targets = Before.Meadow.sln.targets
After.Meadow.sln.targets = After.Meadow.sln.targets
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.JsonRpc", "Meadow.JsonRpc\Meadow.JsonRpc.csproj", "{F9169F5F-FD4E-4DD0-B26A-D561CB271AB8}"
Expand Down
4 changes: 2 additions & 2 deletions src/SolCodeGen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Target Name="GenerateFromSol" BeforeTargets="BeforeBuild">

<PropertyGroup>
<SolCodeGenFileExe>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen/bin/$(Configuration)/netcoreapp2.1/Meadow.SolCodeGen.dll'))</SolCodeGenFileExe>
<SolCodeGenBuild>dotnet build "$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen'))" -f netcoreapp2.1 -c Debug</SolCodeGenBuild>
<SolCodeGenFileExe>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen/bin/Internal/netcoreapp2.1/Meadow.SolCodeGen.dll'))</SolCodeGenFileExe>
<SolCodeGenBuild>dotnet build "$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/Meadow.SolCodeGen'))" -f netcoreapp2.1 -c Internal</SolCodeGenBuild>
<SolSourceDir>"$(MSBuildProjectDirectory)/Contracts"</SolSourceDir>
<NamespaceFilter>$(RootNamespace).Contracts</NamespaceFilter>
<GenerateArgs>--source $(SolSourceDir) --namespace $(RootNamespace) --generate source</GenerateArgs>
Expand Down

0 comments on commit e043624

Please sign in to comment.