forked from googleapis/google-api-dotnet-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSupportLibraries.proj
85 lines (75 loc) · 3.52 KB
/
SupportLibraries.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
<Project ToolsVersion="12.0" DefaultTargets="Build;Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<!-- Need to build just this one solution -->
<SolutionFile Include="Src\Support\GoogleApisClient.sln" />
</ItemGroup>
<PropertyGroup>
<!-- Absolute directory of the packages repository -->
<PackagesDir>$(MSBuildThisFileDirectory)Src\Support\packages\</PackagesDir>
<!-- Absolute directory of nupkgs output directory -->
<NuPkgsDir>$(MSBuildThisFileDirectory)NuPkgs\Support\</NuPkgsDir>
<!-- Absolute directory of the NuGet.Config file -->
<NuGetConfig>$(MSBuildThisFileDirectory)NuGet.Config</NuGetConfig>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">ReleaseSigned</Configuration>
</PropertyGroup>
<Target Name="NuGetRestore">
<!-- restore nuget packages into packages directory, using our NuGet.Config -->
<Exec Command="nuget restore "%(SolutionFile.FullPath)" -PackagesDirectory $(PackagesDir) -ConfigFile $(NuGetConfig)" />
</Target>
<Target Name="Build" DependsOnTargets="NuGetRestore">
<PropertyGroup>
<!-- Missing XML comment for publicly visible type or member 'Type_or_Member' -->
<NoWarn>1591</NoWarn>
</PropertyGroup>
<!-- Build entire solution using the nupkgs from packages directory -->
<MSBuild
Projects="@(SolutionFile)"
BuildInParallel="True"
Targets="Build"
Properties="Configuration=$(Configuration);NugetPackagesDirectory=$(PackagesDir);NoWarn=$(NoWarn)" />
</Target>
<!--
Set GoogleApisVersion to major.minor.revision from Google.Apis.Core.dll.
-->
<Target Name="GetGoogleApisVersion">
<GetAssemblyIdentity
AssemblyFiles="Src\Support\GoogleApis\Portable\bin\ReleaseSigned\Google.Apis.Core.dll">
<Output TaskParameter="Assemblies" ItemName="GoogleApisAssembly" />
</GetAssemblyIdentity>
<PropertyGroup>
<!--
Parse and reformat the version, keeping the first three components.
-->
<GoogleApisVersion>$(
[System.Version]::Parse(%(GoogleApisAssembly.Version)).ToString(3)
)</GoogleApisVersion>
</PropertyGroup>
</Target>
<Target Name="Package" DependsOnTargets="GetGoogleApisVersion">
<!-- Make the packages output directory -->
<MakeDir Directories="NuPkgs\Support" />
<ItemGroup>
<!-- All nuspec files, except the nuspec files in the packages repo -->
<NuSpec Include="Src\Support\**\*.nuspec" Exclude="Src\Support\packages\**" />
</ItemGroup>
<!-- Run 'nuget pack' for each .nuspec found. -->
<Exec Command="nuget pack "%(NuSpec.FullPath)" -BasePath . -OutputDirectory $(NuPkgsDir) -Version $(GoogleApisVersion)" />
</Target>
<Target Name="Clean">
<PropertyGroup>
<BinDirs>$([System.IO.Directory]::GetDirectories("Src\Support","bin",System.IO.SearchOption.AllDirectories))</BinDirs>
<ObjDirs>$([System.IO.Directory]::GetDirectories("Src\Support","obj",System.IO.SearchOption.AllDirectories))</ObjDirs>
</PropertyGroup>
<!-- Clean the solution -->
<MSBuild Projects="@(SolutionFile)" BuildInParallel="True" Targets="Clean"/>
<!-- Remove all obj and bin directories -->
<RemoveDir Directories="$(BinDirs)" />
<RemoveDir Directories="$(ObjDirs)" />
<!-- Delete the package repository -->
<RemoveDir Directories="$(PackagesDir)" />
<!-- Delete the nuget packages -->
<RemoveDir Directories="$(NuPkgsDir)" />
</Target>
</Project>