forked from dotnet/iot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
87 lines (69 loc) · 3.69 KB
/
build.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Directory.Build.props" />
<PropertyGroup>
<BuildRestore Condition="'$(BuildRestore)'==''">true</BuildRestore>
<ProductBuild Condition="'$(ProductBuild)'==''">true</ProductBuild>
<ToolsBuild Condition="'$(ToolsBuild)'==''">true</ToolsBuild>
<SampleBuild Condition="'$(SampleBuild)'==''">true</SampleBuild>
<BuildTests Condition="'$(BuildTests)'==''">true</BuildTests>
<BuildPackages Condition="'$(BuildPackages)'==''">false</BuildPackages>
<BuildDependsOn Condition="'$(BuildRestore)'=='true'">$(BuildDependsOn);Restore</BuildDependsOn>
<BuildDependsOn Condition="'$(ProductBuild)'=='true'">$(BuildDependsOn);BuildProduct</BuildDependsOn>
<BuildDependsOn Condition="'$(ToolsBuild)'=='true'">$(BuildDependsOn);BuildTools</BuildDependsOn>
<BuildDependsOn Condition="'$(SampleBuild)'=='true'">$(BuildDependsOn);BuildSamples</BuildDependsOn>
<BuildDependsOn Condition="'$(BuildTests)'=='true'">$(BuildDependsOn);Test</BuildDependsOn>
<BuildDependsOn Condition="'$(BuildPackages)'=='true'">$(BuildDependsOn);Pack</BuildDependsOn>
</PropertyGroup>
<Import Project="Directory.Build.targets" />
<ItemGroup>
<UnitTestProjects Include="$(MSBuildThisFileDirectory)src\devices\**\*.Tests.csproj" />
</ItemGroup>
<Target Name="BuildProduct">
<ItemGroup>
<_ExcludeBuildProductProjects Include="$(MSBuildThisFileDirectory)src\Native\build-native.proj" />
<_BuildProductProjects Include="$(MSBuildThisFileDirectory)src\**\*.csproj" Exclude="@(_ExcludeBuildProductProjects);@(UnitTestProjects)" />
</ItemGroup>
<MSBuild Projects="@(_BuildProductProjects)" />
</Target>
<Target Name="BuildTools">
<ItemGroup>
<_BuildToolProjects Include="$(MSBuildThisFileDirectory)tools\**\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(_BuildToolProjects)" />
</Target>
<Target Name="BuildSamples">
<ItemGroup>
<_ExcludeBuildSampleProjects Include="$(MSBuildThisFileDirectory)samples\serialport-arduino\arduino-demo.csproj" />
<_BuildSampleProjects Include="$(MSBuildThisFileDirectory)samples\**\*.csproj" Exclude="@(_ExcludeBuildSampleProjects)" />
</ItemGroup>
<MSBuild Projects="@(_BuildSampleProjects)" />
</Target>
<Target Name="Restore">
<ItemGroup>
<_ExcludeProjectsToRestore Include="$(MSBuildThisFileDirectory)samples\serialport-arduino\arduino-demo.csproj" />
<_ProjectsToRestore Include="$(MSBuildThisFileDirectory)**\*.csproj" Exclude="@(_ExcludeProjectsToRestore)" />
</ItemGroup>
<MSBuild Projects="@(_ProjectsToRestore)" Targets="Restore" />
</Target>
<Target Name="Test">
<MSBuild Projects="@(UnitTestProjects)" Targets="VSTest"
ContinueOnError="ErrorAndContinue" />
<Error Condition="$(MSBuildLastTaskResult) != 'true'"
Text="Unit tests failed. Please check the detailed log to find out which ones failed." />
</Target>
<Target Name="Pack">
<ItemGroup>
<_ProjectsToPackage Include="$(MSBuildThisFileDirectory)src\Iot.Device.Bindings\Iot.Device.Bindings.csproj" />
<_ProjectsToPackage Include="$(MSBuildThisFileDirectory)src\System.Device.Gpio\System.Device.Gpio.csproj" />
</ItemGroup>
<MSBuild Projects="@(_ProjectsToPackage)" Targets="Pack" />
</Target>
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
<Target Name="Clean">
<RemoveDir Directories="$(ArtifactsObjDir)" />
<RemoveDir Directories="$(ArtifactsBinDir)" />
<RemoveDir Directories="$(ArtifactsPackagesDir)" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
</Project>