-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.proj
57 lines (47 loc) · 2.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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<PublishPath>bin\publish</PublishPath>
</PropertyGroup>
<Target Name="Build">
<PropertyGroup>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">1.0.1</PackageVersion>
<Build_Number Condition=" '$(Build_Number)' == '' ">0</Build_Number>
<AssemblyVersion>$(PackageVersion).$(Build_Number)</AssemblyVersion>
</PropertyGroup>
<MSBuild Projects="TeamCity.MSBuild.Logger.sln" Targets="Clean;Restore;Rebuild" Properties="Configuration=$(Configuration);AssemblyVersion=$(AssemblyVersion)"/>
</Target>
<Target Name="Test">
<Exec Command="dotnet test TeamCity.MSBuild.Logger.Tests\TeamCity.MSBuild.Logger.Tests.csproj -c $(Configuration)"/>
</Target>
<Target Name="Publish">
<ItemGroup>
<MSBuildVersion Include="net45">
<MSBuildLoggerPath>msbuild12</MSBuildLoggerPath>
</MSBuildVersion>
<MSBuildVersion Include="net452">
<MSBuildLoggerPath>msbuild14</MSBuildLoggerPath>
</MSBuildVersion>
<MSBuildVersion Include="netstandard1.6">
<MSBuildLoggerPath>msbuild15</MSBuildLoggerPath>
</MSBuildVersion>
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PublishForFramework" Properties="Configuration=$(Configuration);Framework=%(MSBuildVersion.Identity);MSBuildLoggerPath=%(MSBuildVersion.MSBuildLoggerPath)"/>
<Message Text="##teamcity[publishArtifacts '$(PublishPath)\**\*.dll=>TeamCity.MSBuild.Logger.zip']" />
</Target>
<Target Name="PublishForFramework">
<PropertyGroup>
<FullPublishPath>$(PublishPath)\$(MSBuildLoggerPath)</FullPublishPath>
<BinPath>TeamCity.MSBuild.Logger\bin\$(Configuration)\$(Framework)\publish</BinPath>
<OutputPath>TeamCity.MSBuild.Logger\bin\$(Configuration)\$(Framework)</OutputPath>
</PropertyGroup>
<RemoveDir Directories="$(FullPublishPath)" />
<MSBuild Projects="TeamCity.MSBuild.Logger\TeamCity.MSBuild.Logger.csproj" Targets="Publish" Properties="Configuration=$(Configuration);TargetFramework=$(Framework)"/>
<ItemGroup>
<MSBuildLoggerFiles Include="$(BinPath)\*.dll"/>
</ItemGroup>
<Copy SourceFiles="@(MSBuildLoggerFiles)" DestinationFolder="$(OutputPath)"/>
<Copy SourceFiles="@(MSBuildLoggerFiles)" DestinationFolder="$(FullPublishPath)"/>
</Target>
</Project>