-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-binaries.msbuild
92 lines (71 loc) · 5.21 KB
/
package-binaries.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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="PackageBinaries" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- MSBuild community tasks -->
<PropertyGroup>
<MSBuildCommunityTasksPath>Libraries</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="MSBuild.Community.Tasks.Targets" />
<Target Name="PackageBinaries">
<!-- Package debug -->
<MSBuild Projects="$(MSBuildProjectFile)" Targets="DoPackageBinariesForConfig" Properties="Configuration=Debug"/>
<!-- Package release -->
<MSBuild Projects="$(MSBuildProjectFile)" Targets="DoPackageBinariesForConfig" Properties="Configuration=Release"/>
<Message Text="Created binary packages in .\Binaries" />
</Target>
<!-- Package release binaries -->
<Target Name="DoPackageBinariesForConfig">
<Message Text="Config: $(Configuration)" />
<!-- Projects to build -->
<ItemGroup>
<OAuthNetProjects Include="1.0a\OAuth.Net.Common\OAuth.Net.Common.csproj" />
<OAuthNetProjects Include="1.0a\OAuth.Net.Components\OAuth.Net.Components.csproj" />
<OAuthNetProjects Include="1.0a\OAuth.Net.Consumer\OAuth.Net.Consumer.csproj" />
<OAuthNetProjects Include="1.0a\OAuth.Net.ServiceProvider\OAuth.Net.ServiceProvider.csproj" />
</ItemGroup>
<!-- Build the projects -->
<MSBuild Projects="@(OAuthNetProjects)" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssemblies=true">
<Output TaskParameter="TargetOutputs" ItemName="OAuthNetAssemblies" />
</MSBuild>
<!-- Fetch XML and PDB files too -->
<ItemGroup>
<BuildFiles Include="@(OAuthNetAssemblies)" />
<!-- Frig to include PDB and XML for OAuth.Net.Common if present -->
<BuildFiles Include="1.0a\OAuth.Net.Common\bin\$(Configuration)\OAuth.Net.Common.pdb" Condition=" '$(Configuration)' == 'Debug' And Exists('1.0a\OAuth.Net.Common\bin\$(Configuration)\OAuth.Net.Common.pdb')"/>
<BuildFiles Include="1.0a\OAuth.Net.Common\bin\$(Configuration)\OAuth.Net.Common.xml" Condition="Exists('1.0a\OAuth.Net.Common\bin\$(Configuration)\OAuth.Net.Common.xml')"/>
<!-- Frig to include PDB and XML for OAuth.Net.Components if present -->
<BuildFiles Include="1.0a\OAuth.Net.Components\bin\$(Configuration)\OAuth.Net.Components.pdb" Condition=" '$(Configuration)' == 'Debug' And Exists('1.0a\OAuth.Net.Components\bin\$(Configuration)\OAuth.Net.Components.pdb')"/>
<BuildFiles Include="1.0a\OAuth.Net.Components\bin\$(Configuration)\OAuth.Net.Components.xml" Condition="Exists('1.0a\OAuth.Net.Components\bin\$(Configuration)\OAuth.Net.Components.xml')"/>
<!-- Frig to include PDB and XML for OAuth.Net.Consumer if present -->
<BuildFiles Include="1.0a\OAuth.Net.Consumer\bin\$(Configuration)\OAuth.Net.Consumer.pdb" Condition=" '$(Configuration)' == 'Debug' And Exists('1.0a\OAuth.Net.Consumer\bin\$(Configuration)\OAuth.Net.Consumer.pdb')"/>
<BuildFiles Include="1.0a\OAuth.Net.Consumer\bin\$(Configuration)\OAuth.Net.Consumer.xml" Condition="Exists('1.0a\OAuth.Net.Consumer\bin\$(Configuration)\OAuth.Net.Consumer.xml')"/>
<!-- Frig to include PDB and XML for OAuth.Net.ServiceProvider if present -->
<BuildFiles Include="1.0a\OAuth.Net.ServiceProvider\bin\$(Configuration)\OAuth.Net.ServiceProvider.pdb" Condition=" '$(Configuration)' == 'Debug' And Exists('1.0a\OAuth.Net.ServiceProvider\bin\$(Configuration)\OAuth.Net.ServiceProvider.pdb')"/>
<BuildFiles Include="1.0a\OAuth.Net.ServiceProvider\bin\$(Configuration)\OAuth.Net.ServiceProvider.xml" Condition="Exists('1.0a\OAuth.Net.ServiceProvider\bin\$(Configuration)\OAuth.Net.ServiceProvider.xml')"/>
</ItemGroup>
<!-- Include files from build, documentation, licenses -->
<ItemGroup>
<ContentFiles Include="@(BuildFiles); Libraries\*; Documentation\OAuthNet.chm; Licenses\*.txt" Exclude="Libraries\nunit.*;Libraries\MSBuild*;Libraries\ICSharp*;Libraries\Castle*;Libraries\*Windsor*;Licenses\Castle*" />
</ItemGroup>
<!-- Make temp directory -->
<RemoveDir Directories="tmp" Condition="Exists('tmp')"/>
<MakeDir Directories="tmp\OAuth.Net-$(Configuration)" />
<!-- Copy to temp directory -->
<Copy SourceFiles="@(ContentFiles)" DestinationFolder="tmp\OAuth.Net-$(Configuration)" />
<!-- Make binaries directory if needed -->
<MakeDir Directories="Binaries" Condition="!Exists('Binaries')" />
<!-- Find the assembly version (for Common but should all be the same) -->
<GetAssemblyIdentity AssemblyFiles="tmp\OAuth.Net-$(Configuration)\OAuth.Net.Common.dll">
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo" />
</GetAssemblyIdentity>
<!-- Items to zip from temp directory -->
<ItemGroup>
<!-- All files copied to tmp directory -->
<ZipFiles Include="tmp\OAuth.Net-$(Configuration)\**\*.*"/>
</ItemGroup>
<!-- Create the zip file -->
<Delete Files="Binaries\OAuthNet-$(Configuration)-%(AssemblyInfo.Version).zip" Condition="Exists('Binaries\OAuthNet-$(Configuration)-%(AssemblyInfo.Version).zip')"/>
<Zip Files="@(ZipFiles)" Flatten="true" ZipFileName="Binaries\OAuthNet-$(Configuration)-%(AssemblyInfo.Version).zip" ZipLevel="9" />
<!-- Clean up tmp directory -->
<RemoveDir Directories="tmp" Condition="Exists('tmp')"/>
</Target>
</Project>