forked from dotnet/machinelearning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
113 lines (92 loc) · 4.32 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build">
<PropertyGroup>
<!-- versioning.targets will import this file, so don't import it again -->
<DisableImportVersioningProps>true</DisableImportVersioningProps>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
<Import Project="build/ExternalBenchmarkDataFiles.props" />
<Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
<UsingTask TaskName="DownloadFilesFromUrl" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
<PropertyGroup>
<!-- To disable the restoration of packages, set RestoreDuringBuild=false or pass /p:RestoreDuringBuild=false.-->
<RestoreDuringBuild Condition="'$(RestoreDuringBuild)'==''">true</RestoreDuringBuild>
</PropertyGroup>
<PropertyGroup>
<!-- CreateOrUpdateCurrentVersionFile needs ProjectDir set to generate the SourceLink file -->
<ProjectDir>$(RepoRoot)</ProjectDir>
</PropertyGroup>
<ItemGroup>
<Project Include="Microsoft.ML.sln" />
</ItemGroup>
<Import Project="dir.traversal.targets" />
<Import Project="$(ToolsDir)clean.targets" />
<PropertyGroup>
<TraversalBuildDependsOn>
CreateOrUpdateCurrentVersionFile;
RestoreProjects;
BuildRedist;
BuildNative;
$(TraversalBuildDependsOn);
DownloadExternalTestFiles;
</TraversalBuildDependsOn>
</PropertyGroup>
<Target Name="RestoreProjects" Condition="'$(RestoreDuringBuild)'=='true'">
<Message Importance="High" Text="Restoring all projects..." />
<MSBuild Projects="@(Project)"
Targets="Restore"
Properties="MSBuildWarningsAsMessages=NU1503" />
</Target>
<Target Name="BuildRedist"
Condition="'$(SkipRedistBuild)' != 'true'"
DependsOnTargets="RestoreProjects">
<Message Importance="High" Text="Building redist components..." />
<MSBuild Projects="src/Redist/build.proj"
Targets="Build" />
</Target>
<Target Name="BuildNative"
Condition="'$(SkipNativeBuild)' != 'true'"
DependsOnTargets="RestoreProjects;BuildRedist">
<Message Importance="High" Text="Building native components..." />
<MSBuild Projects="src/Native/build.proj"
Targets="Build" />
</Target>
<Target Name="BuildPackages"
DependsOnTargets="CreateOrUpdateCurrentVersionFile;RestoreProjects">
<Message Importance="High" Text="Building packages ..." />
<ItemGroup>
<PkgProject Include="pkg\**\*.nupkgproj" />
</ItemGroup>
<MSBuild Projects="@(PkgProject)"
Targets="Restore" />
<MSBuild Projects="@(PkgProject)"
Targets="Pack" />
</Target>
<ItemGroup>
<TestFile Include="$(MSBuildThisFileDirectory)/test/data/external/winequality-white.csv"
Url="https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv"
DestinationFile="$(MSBuildThisFileDirectory)test/data/external/winequality-white.csv" />
</ItemGroup>
<ItemGroup Condition="'$(IncludeBenchmarkData)' == 'true'">
<BenchmarkFile Update="@(BenchmarkFile)">
<Url>https://aka.ms/tlc-resources/benchmarks/%(Identity)</Url>
<DestinationFile>$(MSBuildThisFileDirectory)/test/data/external/%(Identity)</DestinationFile>
</BenchmarkFile>
<TestFile Include="@(BenchmarkFile->'$(MSBuildThisFileDirectory)/test/data/external/%(Identity)')" />
</ItemGroup>
<Target Name="DownloadExternalTestFiles" Inputs="@(TestFile)" Outputs="%(TestFile.DestinationFile)">
<Message Importance="High" Text="Downloading external test files... %(TestFile.DestinationFile)" />
<DownloadFilesFromUrl Items="@(TestFile)"
DestinationDir="test/data/external"
TreatErrorsAsWarnings="true"/>
</Target>
<Target Name="RunTests">
<MSBuild Projects="test\run-tests.proj"
Targets="RunTests" />
</Target>
<!-- Override CleanAllProjects from dir.traversal.targets and just remove the full BinDir -->
<Target Name="CleanAllProjects">
<RemoveDir Directories="$(BinDir)" />
</Target>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>