-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
tasks.proj
45 lines (39 loc) · 1.92 KB
/
tasks.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)**\*.csproj" />
<!-- These projects do not need to be built during source-build. -->
<!-- For example, they may take dependencies on pre-built packages that aren't build-from-source. e.g. 'Microsoft.DotNet.CilStrip.Sources' -->
<ProjectReference Remove="MonoTargetsTasks\MonoTargetsTasks.csproj"
Condition="'$(DotNetBuildFromSource)' == 'true'" />
</ItemGroup>
<!--
Use synthetic inputs/outputs to avoid building it all the time. This should let devs build with
MSBuild node reuse enabled (the Arcade default). If it were built every time, it would hit file
locking issues vs. the persistent nodes that loaded the task DLL for the previous build. It
isn't particularly accurate, but better than nothing.
-->
<Target Name="BuildIncrementally"
DependsOnTargets="GetTasksSrc"
Inputs="@(TasksSrc)"
Outputs="$(TasksIntermediateFile)">
<ItemGroup>
<TaskProject Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
<MSBuild Projects="@(TaskProject)"
Properties="Configuration=Debug;Platform=AnyCPU"
Targets="Build" />
<WriteLinesToFile File="$(TasksIntermediateFile)"
Lines="$(TasksIntermediateFile)"
Overwrite="true" />
</Target>
<Target Name="GetTasksSrc"
DependsOnTargets="PrepareProjectReferences">
<PropertyGroup>
<TasksIntermediateFile>$([MSBuild]::NormalizePath('$(ArtifactsObjDir)', '$(MSBuildProjectName)', 'Debug', 'build-semaphore.txt'))</TasksIntermediateFile>
</PropertyGroup>
<!-- Include both the project file and its sources as an input. -->
<ItemGroup>
<TasksSrc Include="%(ProjectReferenceWithConfiguration.RelativeDir)%(ProjectReferenceWithConfiguration.RecursiveDir)**\*" />
</ItemGroup>
</Target>
</Project>