forked from dotnet/templating
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
196 lines (157 loc) · 11.1 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<Project DefaultTargets="Build">
<Import Project="Version.props" />
<Import Project="Settings.props" />
<Import Project="Loc.Settings.targets" />
<PropertyGroup>
<CIBuild Condition="'$(CIBuild)' == ''">false</CIBuild>
<EngineBuild Condition="'$(EngineBuild)' == '' AND '$(CIBuild)' == 'false'">true</EngineBuild>
<TemplatesBuild Condition="'$(TemplatesBuild)' == '' AND '$(CIBuild)' == 'false'">true</TemplatesBuild>
<SkipTests Condition="'$(SkipTests)' == ''">false</SkipTests>
<PB_SkipTests Condition="'$(PB_SkipTests)' == ''">false</PB_SkipTests>
<New3TargetFramework>netcoreapp1.1</New3TargetFramework>
<InnerRingTargetFramework>netstandard1.3</InnerRingTargetFramework>
<OuterRingTargetFramework>netstandard1.5</OuterRingTargetFramework>
<FullFrameworkTargetFramework>net45</FullFrameworkTargetFramework>
<FullFrameworkTestTargetFramework>net452</FullFrameworkTestTargetFramework>
<InnerRingPackTargetFrameworks>$(InnerRingTargetFramework)</InnerRingPackTargetFrameworks>
<InnerRingPackTargetFrameworks Condition="'$(IsFullFrameworkBuildSupported)' == 'true'">$(InnerRingPackTargetFrameworks);$(FullFrameworkTargetFramework)</InnerRingPackTargetFrameworks>
<OuterRingPackTargetFrameworks>$(OuterRingTargetFramework)</OuterRingPackTargetFrameworks>
<OuterRingPackTargetFrameworks Condition="'$(IsFullFrameworkBuildSupported)' == 'true'">$(OuterRingPackTargetFrameworks);$(FullFrameworkTargetFramework)</OuterRingPackTargetFrameworks>
<SharedTestPackTargetFrameworks>$(OuterRingTargetFramework)</SharedTestPackTargetFrameworks>
<SharedTestPackTargetFrameworks Condition="'$(IsFullFrameworkBuildSupported)' == 'true'">$(SharedTestPackTargetFrameworks);$(FullFrameworkTestTargetFramework)</SharedTestPackTargetFrameworks>
<NetCoreAppPackTargets>$(New3TargetFramework)</NetCoreAppPackTargets>
<NetCoreAppPackTargets Condition="'$(IsFullFrameworkBuildSupported)' == 'true'">$(NetCoreAppPackTargets);$(FullFrameworkBuildTarget)</NetCoreAppPackTargets>
</PropertyGroup>
<PropertyGroup>
<InnerRingProjects>
src/Microsoft.TemplateEngine.Abstractions/Microsoft.TemplateEngine.Abstractions.csproj;
src/Microsoft.TemplateEngine.Core.Contracts/Microsoft.TemplateEngine.Core.Contracts.csproj;
src/Microsoft.TemplateEngine.Utils/Microsoft.TemplateEngine.Utils.csproj;
src/Microsoft.TemplateEngine.Core/Microsoft.TemplateEngine.Core.csproj;
src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.csproj
</InnerRingProjects>
<OuterRingProjects>
src/Microsoft.TemplateEngine.Edge/Microsoft.TemplateEngine.Edge.csproj;
src/Microsoft.TemplateEngine.IDE/Microsoft.TemplateEngine.IDE.csproj;
test/Microsoft.TemplateEngine.Mocks/Microsoft.TemplateEngine.Mocks.csproj
</OuterRingProjects>
<SharedTestProjects>
test/Microsoft.TemplateEngine.TestHelper/Microsoft.TemplateEngine.TestHelper.csproj
</SharedTestProjects>
<CliProjects>
src/Microsoft.TemplateEngine.Cli/Microsoft.TemplateEngine.Cli.csproj;
</CliProjects>
<LocProjects>
src/Microsoft.TemplateEngine.Cli.Localization/Microsoft.TemplateEngine.Cli.Localization.csproj;
</LocProjects>
<PortableSourceProjectsToRestore_both>$(PortableSourceProjectsToPack_netcoreapp11);$(PortableSourceProjectsToPack_fullframework)</PortableSourceProjectsToRestore_both>
<TestUtilities>test/Microsoft.TemplateEngine.EndToEndTestHarness/Microsoft.TemplateEngine.EndToEndTestHarness.csproj</TestUtilities>
<TestProjects>
test/Microsoft.TemplateEngine.Core.UnitTests/Microsoft.TemplateEngine.Core.UnitTests.csproj;
test/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests.csproj;
test/Microsoft.TemplateEngine.Utils.UnitTests/Microsoft.TemplateEngine.Utils.UnitTests.csproj;
test/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj;
test/Microsoft.TemplateEngine.Edge.UnitTests/Microsoft.TemplateEngine.Edge.UnitTests.csproj;
test/dotnet-new3.UnitTests/dotnet-new3.UnitTests.csproj
</TestProjects>
</PropertyGroup>
<Target Name="Build">
<MakeDir Directories="$(ArtifactsDir);$(PackageOutputPath);$(TemplatesOutputPath);$(DevPath)" />
<CallTarget Targets="CollectGitInfo" />
<!-- Build the inner ring (abstractions, core, core contracts, etc.) -->
<MSBuild Projects="$(InnerRingProjects)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(InnerRingTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(InnerRingProjects)" Targets="Restore;Build"
Condition="'$(IsFullFrameworkBuildSupported)' == 'true' AND '$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(FullFrameworkTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(InnerRingProjects)" Targets="Pack"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFrameworks=$(InnerRingPackTargetFrameworks);Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath);NoBuild=true;IncludeSymbols=true"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build the outer ring (edge, mocks, etc.) -->
<MSBuild Projects="$(OuterRingProjects)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(OuterRingTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(OuterRingProjects)" Targets="Restore;Build"
Condition="'$(IsFullFrameworkBuildSupported)' == 'true' AND '$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(FullFrameworkTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(OuterRingProjects)" Targets="Pack"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFrameworks=$(OuterRingPackTargetFrameworks);Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath);NoBuild=true;IncludeSymbols=true"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build the shared test projects (test helper, etc.) -->
<MSBuild Projects="$(SharedTestProjects)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true' AND '$(PB_SkipTests)' != 'true'"
Properties="TargetFramework=$(OuterRingTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(SharedTestProjects)" Targets="Restore;Build"
Condition="'$(IsFullFrameworkBuildSupported)' == 'true' AND '$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(FullFrameworkTestTargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(SharedTestProjects)" Targets="Pack"
Condition="'$(EngineBuild)' == 'true' AND '$(PB_SkipTests)' != 'true'"
Properties="TargetFrameworks=$(SharedTestPackTargetFrameworks);Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath);NoBuild=true;IncludeSymbols=true"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build projects that only build for the dotnet CLI -->
<MSBuild Projects="$(CliProjects)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(OuterRingTargetFramework);Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath);NoBuild=true"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<MSBuild Projects="$(CliProjects)" Targets="Pack"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(OuterRingTargetFramework);Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath);NoBuild=true;IncludeSymbols=true"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build templates -->
<MSBuild Projects="template_feed/Template.proj" Targets="Build"
Condition="'$(TemplatesBuild)' == 'true'"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build new3 -->
<MSBuild Projects="src/dotnet-new3/dotnet-new3.csproj" Targets="Restore;Publish"
Condition="'$(EngineBuild)' == 'true'"
Properties="TargetFramework=$(New3TargetFramework);Configuration=$(Configuration);PublishDir=$(DevPath);RestoreRecursive=false"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build the test harness -->
<MSBuild Projects="$(TestUtilities)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true' AND '$(PB_SkipTests)' != 'true'"
Properties="TargetFramework=$(New3TargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Build tests -->
<MSBuild Projects="$(TestProjects)" Targets="Restore;Build"
Condition="'$(EngineBuild)' == 'true' AND '$(PB_SkipTests)' != 'true'"
Properties="TargetFramework=$(New3TargetFramework);Configuration=$(Configuration)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
<!-- Run tests -->
<MSBuild Projects="$(TestProjects)" Targets="VSTest"
Condition="'$(EngineBuild)' == 'true' AND '$(SkipTests)' != 'true' AND '$(PB_SkipTests)' != 'true'"
Properties="TargetFramework=$(New3TargetFramework);Configuration=$(Configuration);VSTestLogger=trx"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
</Target>
<!-- Localization -->
<Target Name="BuildLocalized" DependsOnTargets="SetLanguages" Condition="Exists('.tools\loc\loc.proj')">
<MSBuild Projects=".tools\loc\loc.proj" Targets="Build"
Properties="Lang=%(Languages.Identity)" />
<MSBuild Projects="$(LocProjects)" Targets="Restore;Pack"
Properties="Configuration=$(Configuration);PackageOutputPath=$(PackageOutputPath)"
RunEachTargetSeparately="true" StopOnFirstFailure="true" />
</Target>
<Target Name="SetLanguages">
<ItemGroup>
<Languages Remove="@(Languages)" />
</ItemGroup>
<ItemGroup>
<Languages Include="$(AllLanguages)" Condition="'$(Lang)' == 'all'" />
<Languages Include="$(Lang)" Condition="'$(Lang)' != 'all'" />
<Languages Include="ploc" Condition="'$(Lang)' == ''" />
</ItemGroup>
</Target>
<!-- Signing -->
<Target Name="SignBinaries" Condition="Exists('.tools\sign\sign.proj')">
<MSBuild Projects=".tools\sign\sign.proj" Targets="Build"
Properties="CodeSignCreateTestJob=$(CodeSignCreateTestJob);TestSign=$(TestSign)" />
</Target>
</Project>