Skip to content

Commit

Permalink
Build samples using locally published tools
Browse files Browse the repository at this point in the history
Results in faster builds since we don't need to build the compiler every time.
But this also means that we should not forget to compile the compiler every time we make changes to it.
  • Loading branch information
Nirmal4G committed May 9, 2020
1 parent 892508d commit f84b958
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ steps:
projects: $(tests)
arguments: -c $(buildConfiguration)
publishTestResults: true
- task: DotNetCoreCLI@2
displayName: Publish minsk ($(buildConfiguration))
inputs:
command: publish
projects: $(sln)
arguments: -c $(buildConfiguration)
publishWebProjects: false
zipAfterPublish: false
- task: DotNetCoreCLI@2
displayName: Build samples ($(buildConfiguration))
inputs:
Expand Down
4 changes: 4 additions & 0 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
<PublishDir>$(SolutionDir)publish</PublishDir>
</PropertyGroup>

<PropertyGroup>
<MinskToolsPath Condition="'$(MinskToolsPath)' == ''">$(RepositoryDir)artifacts\Minsk\</MinskToolsPath>
</PropertyGroup>

</Project>
14 changes: 12 additions & 2 deletions samples/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@
'%(FileName)' != 'System.Runtime' AND
'%(FileName)' != 'System.Runtime.Extensions'" />
</ItemGroup>
<Exec Command="dotnet run --project &quot;$(MSBuildThisFileDirectory)\..\src\msc\msc.csproj&quot; -- @(Compile->'&quot;%(Identity)&quot;', ' ') /o &quot;@(IntermediateAssembly)&quot; @(ReferencePath->'/r &quot;%(Identity)&quot;', ' ')"
WorkingDirectory="$(MSBuildProjectDirectory)" />

<PropertyGroup>
<MinskCompilerArgs>@(Compile->'"%(Identity)"', ' ')</MinskCompilerArgs>
<MinskCompilerArgs>$(MinskCompilerArgs) /o "@(IntermediateAssembly)"</MinskCompilerArgs>
<MinskCompilerArgs>$(MinskCompilerArgs) @(ReferencePath->'/r "%(Identity)"', ' ')</MinskCompilerArgs>

<MinskExeExt Condition="$([MSBuild]::IsOSPlatform('Windows'))">.exe</MinskExeExt>
<MinskCompilerExe Condition="'$(MinskCompilerExe)' == ''">msc$(MinskExeExt)</MinskCompilerExe>
<MinskCompileCommand>"$([MSBuild]::NormalizePath('$(MinskToolsPath)', '$(MinskCompilerExe)'))" $(MinskCompilerArgs)</MinskCompileCommand>
</PropertyGroup>

<Exec Command="$(MinskCompileCommand)" />
</Target>

</Project>

0 comments on commit f84b958

Please sign in to comment.