This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.prepare.discovery.msbuild
168 lines (151 loc) · 10.1 KB
/
build.prepare.discovery.msbuild
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="Build_Prepare_Discovery_Run"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Defines whether the current script file has been loaded / imported or not -->
<ExistsBuildPrepareNuGet>true</ExistsBuildPrepareNuGet>
<!-- The full path to the settings file that contains all the settings for the build process -->
<BuildPropertyFile Condition=" '$(BuildPropertyFile)' == '' ">UNDEFINED</BuildPropertyFile>
<!--
Define the DirWorkspace before importing the BuildPropertyFile so that it is defined and can be used by
the properties in the BuildPropertyFile. Note that we can't define it in the BuildPropertyFile because that
is imported which means there is no way to get the path of the file.
-->
<DirWorkspace Condition=" '$(DirWorkspace)' == '' ">$([System.IO.Path]::GetDirectoryName('$(BuildPropertyFile)'))</DirWorkspace>
</PropertyGroup>
<Import Project="$(BuildPropertyFile)"
Condition="Exists('$(BuildPropertyFile)') AND '$(ExistsSettings)' != 'true' " />
<Import Project="$(DirNBuildKitMsBuild)\shared.templatetokens.msbuild"
Condition="Exists('$(DirNBuildKitMsBuild)\shared.templatetokens.msbuild') AND '$(ExistsSharedTemplateTokens)' != 'true' " />
<Import Project="$(DirNBuildKitMsBuildExtensions)\GetSemanticVersionFromFile.msbuild"
Condition="Exists('$(DirNBuildKitMsBuildExtensions)\GetSemanticVersionFromFile.msbuild') AND '$(ExistsExtensionsGetSemanticVersionFromFile)' != 'true' " />
<Import Project="$(DirNBuildKitMsBuildExtensions)\SearchPackagesDirectoryForToolDirectory.msbuild"
Condition="Exists('$(DirNBuildKitMsBuildExtensions)\SearchPackagesDirectoryForToolDirectory.msbuild') AND '$(ExistsExtensionsSearchPackagesDirectoryForToolDirectory)' != 'true' " />
<Import Project="$(DirNBuildKitMsBuildExtensions)\TemplateFile.msbuild"
Condition="Exists('$(DirNBuildKitMsBuildExtensions)\TemplateFile.msbuild') AND '$(ExistsExtensionsTemplateFile)' != 'true' " />
<Target Name="Build_Prepare_Discovery_Run" DependsOnTargets="_Build_Prepare_Discovery_DisplayInfo">
<CallTarget Targets="_Build_Prepare_Discovery_GetVersion" />
<CallTarget Targets="_Build_Prepare_Discovery_GatherCoreFiles_ForHyperVInstall" />
<CallTarget Targets="_Build_Prepare_Discovery_GatherCoreFiles_ForLanInstall" />
<CallTarget Targets="_Build_Prepare_Discovery_GatherConfigurationFiles" />
<CallTarget Targets="_Build_Prepare_Discovery_GatherVerificationFiles" />
</Target>
<Target Name="_Build_Prepare_Discovery_DisplayInfo">
<Message Text="Project directory structure:" />
<Message Text="The workspace is located at: $(DirWorkspace)" />
<Message Text="The directory containing the build output is located at: $(DirBuild)" />
<Message Text="The directory containing the build logs is located at: $(DirBuildLogs)" />
<Message Text="The directory containing the temporary build files is located at: $(DirBuildTemp)" />
<Message Text="The directory containing the installer files is located at: $(DirBuildTempInstallers)" />
<Message Text=" " />
</Target>
<Target Name="_Build_Prepare_Discovery_GetVersion" Condition="Exists('$(FileSemanticVersion)')">
<GetSemanticVersionFromFile VersionFile="$(FileSemanticVersion)"
Condition="Exists('$(FileSemanticVersion)') AND '$(ShouldExecute)' == 'true' ">
<Output TaskParameter="VersionSemantic" PropertyName="VersionSemantic" />
</GetSemanticVersionFromFile>
<Message Text="Version: $(VersionSemantic)" />
</Target>
<PropertyGroup>
<DefaultDirectories>
DirNBuildKitMsBuild=$(DirNBuildKitMsBuild);
DirNBuildKitMsBuildExtensions=$(DirNBuildKitMsBuildExtensions);
DirExternalInstallers=$(DirExternalInstallers)
</DefaultDirectories>
<DefaultFlags>
InstallConsul=true;
InstallProvisioning=true
</DefaultFlags>
</PropertyGroup>
<Target Name="_Build_Prepare_Discovery_GatherCoreFiles_ForHyperVInstall">
<SearchPackagesDirectoryForToolDirectory PackagesDir="$(DirPackages)"
FileToLocate="Initialize-HyperVImage.ps1"
Condition=" '$(ShouldExecute)' == 'true' ">
<Output TaskParameter="Path" PropertyName="DirPackagesResourcesCoreHypervTemplates" />
</SearchPackagesDirectoryForToolDirectory>
<CreateProperty Value="$([System.IO.Path]::GetDirectoryName('$([System.IO.Path]::GetDirectoryName('$(DirPackagesResourcesCoreHypervTemplates)'))'))">
<Output TaskParameter="Value" PropertyName="DirPackageResourcesCoreHyperv" />
</CreateProperty>
<MSBuild
BuildInParallel="False"
Projects="$(DirPackageResourcesCoreHyperv)\distribute.core.msbuild"
Properties="BuildPropertyFile=$(BuildPropertyFile);$(DefaultDirectories);$(DefaultFlags);DirOutput=$(DirBuildTempDiscoveryHyperV)"
RebaseOutputs="False"
RemoveProperties=""
RunEachTargetSeparately="True"
SkipNonexistentProjects="False"
StopOnFirstFailure="True"
TargetAndPropertyListSeparators=""
Targets=""
ToolsVersion="$(MSBuildToolsVersion)"
UnloadProjectsOnCompletion="False"
UseResultsCache="True" />
</Target>
<Target Name="_Build_Prepare_Discovery_GatherCoreFiles_ForLanInstall">
<SearchPackagesDirectoryForToolDirectory PackagesDir="$(DirPackages)"
FileToLocate="Initialize-LocalNetworkResource.ps1"
Condition=" '$(ShouldExecute)' == 'true' ">
<Output TaskParameter="Path" PropertyName="DirPackagesResourcesCoreLanTemplates" />
</SearchPackagesDirectoryForToolDirectory>
<CreateProperty Value="$([System.IO.Path]::GetDirectoryName('$([System.IO.Path]::GetDirectoryName('$(DirPackagesResourcesCoreLanTemplates)'))'))">
<Output TaskParameter="Value" PropertyName="DirPackageResourcesCoreLan" />
</CreateProperty>
<MSBuild
BuildInParallel="False"
Projects="$(DirPackageResourcesCoreLan)\distribute.core.msbuild"
Properties="BuildPropertyFile=$(BuildPropertyFile);$(DefaultDirectories);$(DefaultFlags);DirOutput=$(DirBuildTempDiscoveryLan)"
RebaseOutputs="False"
RemoveProperties=""
RunEachTargetSeparately="True"
SkipNonexistentProjects="False"
StopOnFirstFailure="True"
TargetAndPropertyListSeparators=""
Targets=""
ToolsVersion="$(MSBuildToolsVersion)"
UnloadProjectsOnCompletion="False"
UseResultsCache="True" />
</Target>
<Target Name="_Build_Prepare_Discovery_GatherConfigurationFiles"
DependsOnTargets="nBuildKit_Shared_TemplateTokens_Initialize">
<MakeDir Directories="$(DirBuild)"
Condition="!Exists('$(DirBuild)')" />
<MakeDir Directories="$(DirBuildTemp)"
Condition="!Exists('$(DirBuildTemp)')" />
<MakeDir Directories="$(DirBuildTempDiscovery)"
Condition="!Exists('$(DirBuildTempDiscovery)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirConfiguration)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirConfiguration)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooks)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooks)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooksServer)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooksServer)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooksServer)\files"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirConfigurationCookbooksServer)\files')" />
<Copy SourceFiles="$(DirScripts)\New-DiscoveryHypervImage.ps1"
DestinationFolder="$(DirBuildTempDiscoveryHyperV)" />
<Copy SourceFiles="$(DirScripts)\New-DiscoveryLocalServer.ps1"
DestinationFolder="$(DirBuildTempDiscoveryLan)" />
</Target>
<Target Name="_Build_Prepare_Discovery_GatherVerificationFiles">
<MakeDir Directories="$(DirBuild)"
Condition="!Exists('$(DirBuild)')" />
<MakeDir Directories="$(DirBuildTemp)"
Condition="!Exists('$(DirBuildTemp)')" />
<MakeDir Directories="$(DirBuildTempDiscovery)"
Condition="!Exists('$(DirBuildTempDiscovery)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirVerification)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirVerification)')" />
<MakeDir Directories="$(DirBuildTempDiscoveryShared)\$(RelDirVerificationTests)"
Condition="!Exists('$(DirBuildTempDiscoveryShared)\$(RelDirVerificationTests)')" />
<ItemGroup>
<VerificationTestFiles Include="$(DirTest)\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(VerificationTestFiles)"
DestinationFiles="@(VerificationTestFiles->'$(DirBuildTempDiscoveryShared)\$(RelDirVerificationTests)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>