forked from microsoft/azure-pipelines-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdir.proj
More file actions
138 lines (119 loc) Β· 7.47 KB
/
dir.proj
File metadata and controls
138 lines (119 loc) Β· 7.47 KB
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectFiles Include="Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj" />
<ProjectFiles Include="Agent.Listener/Agent.Listener.csproj" />
<ProjectFiles Include="Agent.Worker/Agent.Worker.csproj" />
<ProjectFiles Include="Agent.PluginHost/Agent.PluginHost.csproj" />
<ProjectFiles Include="Agent.Sdk/Agent.Sdk.csproj" />
<ProjectFiles Include="Agent.Plugins/Agent.Plugins.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(LayoutRoot)'==''">
<LayoutRoot>$(MSBuildProjectDirectory)/../_layout/unknown</LayoutRoot>
</PropertyGroup>
<PropertyGroup>
<L1Root>$(MSBuildProjectDirectory)/../_l1</L1Root>
</PropertyGroup>
<ItemGroup>
<LayoutRootFiles Include="$(MSBuildProjectDirectory)/Misc/layoutroot/**"/>
<LayoutBinFiles Include="$(MSBuildProjectDirectory)/Misc/layoutbin/**"/>
</ItemGroup>
<ItemGroup>
<L1Tasks Include="$(L1Root)/externals/Tasks/**"/>
</ItemGroup>
<Target Name="GenerateConstant">
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitInfoCommitHash" />
</Exec>
<Message Text="Building $(GitInfoCommitHash) --- $(PackageRuntime)" Importance="high" Condition=" !$(GitInfoCommitHash.Contains('fatal')) "/>
<Message Text="Building from non-Git sources --- $(PackageRuntime)" Importance="high" Condition=" $(GitInfoCommitHash.Contains('fatal')) "/>
<ItemGroup>
<BuildConstants Include="namespace Microsoft.VisualStudio.Services.Agent"/>
<BuildConstants Include="{"/>
<BuildConstants Include="%20%20%20%20public static class BuildConstants"/>
<BuildConstants Include="%20%20%20%20{"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20public static class Source"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20{"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20%20%20%20%20public static readonly string CommitHash = %22$(GitInfoCommitHash)%22%3B" Condition=" !$(GitInfoCommitHash.Contains('fatal')) "/>
<BuildConstants Include="%20%20%20%20%20%20%20%20%20%20%20%20public static readonly string CommitHash = %220000000000000000000000000000000000000000%22%3B" Condition=" $(GitInfoCommitHash.Contains('fatal')) "/>
<BuildConstants Include="%20%20%20%20%20%20%20%20}%0A"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20public static class AgentPackage"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20{"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20%20%20%20%20public static readonly string PackageName = %22$(PackageRuntime)%22%3B"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20%20%20%20%20public static readonly string Version = %22$(AgentVersion)%22%3B"/>
<BuildConstants Include="%20%20%20%20%20%20%20%20}"/>
<BuildConstants Include="%20%20%20%20}"/>
<BuildConstants Include="}"/>
</ItemGroup>
<WriteLinesToFile
File="Microsoft.VisualStudio.Services.Agent/BuildConstants.cs"
Lines="@(BuildConstants)"
Overwrite="true"
Encoding="Unicode"/>
</Target>
<Target Name="Build" DependsOnTargets="GenerateConstant">
<MSBuild Targets="Restore"
BuildInParallel="false"
Projects="@(ProjectFiles)"
SkipNonExistentProjects="false"
StopOnFirstFailure="true" />
<MSBuild Targets="Publish"
BuildInParallel="false"
Projects="@(ProjectFiles)"
SkipNonExistentProjects="false"
StopOnFirstFailure="true"
Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/bin" />
<Exec Command="%22$(DesktopMSBuild)%22 Agent.Service/Windows/AgentService.csproj /p:Configuration=$(BUILDCONFIG) /p:OutputPath=%22$(LayoutRoot)/bin%22" ConsoleToMSBuild="true" Condition="'$(PackageRuntime)' == 'win-x64' Or '$(PackageRuntime)' == 'win-x86'" />
</Target>
<Target Name="TestL0" DependsOnTargets="GenerateConstant">
<Exec Command="dotnet build Test/Test.csproj -c $(BUILDCONFIG) /p:PackageRuntime=$(PackageRuntime)" ConsoleToMSBuild="true" />
<Exec Command="dotnet test Test/Test.csproj --settings $(MSBuildProjectDirectory)/Test/CodeCoverage.runsettings --no-build --logger:trx --collect:"Code Coverage" --filter "$(TestFilters)" /p:PackageRuntime=$(PackageRuntime)" ConsoleToMSBuild="true" />
</Target>
<Target Name="TestL1" DependsOnTargets="GenerateConstant">
<Copy SourceFiles="@(LayoutBinFiles)" DestinationFolder="$(L1Root)/bin/%(RecursiveDir)"/>
<Copy SourceFiles="@(L1Tasks)" DestinationFolder="$(L1Root)/bin/L1/Tasks/%(RecursiveDir)"/>
<MSBuild Targets="Restore"
BuildInParallel="false"
Projects="@(ProjectFiles)"
SkipNonExistentProjects="false"
StopOnFirstFailure="true" />
<MSBuild Targets="Publish"
BuildInParallel="false"
Projects="@(ProjectFiles)"
SkipNonExistentProjects="false"
StopOnFirstFailure="true"
Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/bin" />
<Exec Command="dotnet build Test/Test.csproj -c $(BUILDCONFIG) /p:PackageRuntime=$(PackageRuntime) -o $(L1Root)/bin" ConsoleToMSBuild="true" />
<Exec Command="dotnet test Test/Test.csproj -o $(L1Root)/bin --no-build --logger:trx --filter "$(TestFilters)"" ConsoleToMSBuild="true" />
</Target>
<Target Name="Layout" DependsOnTargets="Clean;Build">
<Copy SourceFiles="@(LayoutRootFiles)" DestinationFolder="$(LayoutRoot)/%(RecursiveDir)"/>
<Copy SourceFiles="@(LayoutBinFiles)" DestinationFolder="$(LayoutRoot)/bin/%(RecursiveDir)"/>
<ItemGroup>
<LayoutRootFilesToDelete Include="$(LayoutRoot)/*.cmd" Condition="'$(PackageRuntime)' != 'win-x64' And '$(PackageRuntime)' != 'win-x86'"/>
<LayoutRootFilesToDelete Include="$(LayoutRoot)/*.sh" Condition="'$(PackageRuntime)' == 'win-x64' Or '$(PackageRuntime)' == 'win-x86'"/>
<LayoutRootFilesToDelete Include="$(LayoutRoot)/bin/AgentService.js" Condition="'$(PackageRuntime)' == 'win-x64' Or '$(PackageRuntime)' == 'win-x86'"/>
</ItemGroup>
<Delete Files="@(LayoutRootFilesToDelete)" />
</Target>
<Target Name="CleanL1">
<RemoveDir Directories="$(L1Root)" ContinueOnError="WarnAndContinue" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(LayoutRoot)" ContinueOnError="WarnAndContinue" />
<RemoveDir Directories="Microsoft.VisualStudio.Services.Agent/bin" />
<RemoveDir Directories="Microsoft.VisualStudio.Services.Agent/obj" />
<RemoveDir Directories="Agent.Listener/bin" />
<RemoveDir Directories="Agent.Listener/obj" />
<RemoveDir Directories="Agent.Worker/bin" />
<RemoveDir Directories="Agent.Worker/obj" />
<RemoveDir Directories="Agent.PluginHost/bin" />
<RemoveDir Directories="Agent.PluginHost/obj" />
<RemoveDir Directories="Agent.Sdk/bin" />
<RemoveDir Directories="Agent.Sdk/obj" />
<RemoveDir Directories="Agent.Plugins/bin" />
<RemoveDir Directories="Agent.Plugins/obj" />
<RemoveDir Directories="Test/bin" />
<RemoveDir Directories="Test/obj" />
</Target>
</Project>