-
Notifications
You must be signed in to change notification settings - Fork 1
/
YamlDotNet.build
133 lines (108 loc) · 4.1 KB
/
YamlDotNet.build
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
<?xml version="1.0" encoding="utf-8"?>
<project name="YamlDotNet" default="package" basedir="." xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<!-- This build file requires .NET 4.0 and nant 0.91 alpha 2 or higher -->
<property name="nant.settings.currentframework" value="net-4.0"/>
<property name="version" value="1.1.9" />
<fileset id="binaries">
<include name="YamlDotNet.Core/bin/Release/YamlDotNet.Core.dll" />
<include name="YamlDotNet.Core/bin/Release/YamlDotNet.Core.pdb" />
<include name="YamlDotNet.RepresentationModel/bin/Release/YamlDotNet.RepresentationModel.dll" />
<include name="YamlDotNet.RepresentationModel/bin/Release/YamlDotNet.RepresentationModel.pdb" />
<include name="YamlDotNet.Converters/bin/Release/YamlDotNet.Converters.dll" />
<include name="YamlDotNet.Converters/bin/Release/YamlDotNet.Converters.pdb" />
</fileset>
<loadtasks assembly="support/nantcontrib/NAnt.Contrib.Tasks.dll" />
<target name="doc">
<msbuild project="YamlDotNet.shfbproj" target="Rebuild">
<property name="Configuration" value="Release" />
</msbuild>
</target>
<target name="build">
<msbuild project="YamlDotNet.sln" target="Rebuild">
<property name="Configuration" value="Release" />
</msbuild>
</target>
<target name="package-bin" depends="build">
<delete dir="tmp" failonerror="false" />
<mkdir dir="tmp" />
<copy todir="tmp" flatten="true">
<fileset refid="binaries" />
</copy>
<zip zipfile="release/${version}/YamlDotNet-bin-${version}.zip">
<fileset basedir="tmp">
<include name="*" />
</fileset>
</zip>
<delete dir="tmp" />
</target>
<target name="package-src">
<zip zipfile="release/${version}/YamlDotNet-src-${version}.zip">
<fileset>
<exclude name="doc/**/*" />
<exclude name="release/**/*" />
<exclude name="support/**/*" />
<exclude name="**/*.pfx" />
<exclude name="**/*.user" />
<exclude name="**/*.suo" />
<exclude name="**/password.txt" />
<exclude name="**/*_ReSharper*" />
<exclude name="**/*_ReSharper*/**" />
<exclude name="**/bin" />
<exclude name="**/bin/**" />
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="package-doc" depends="doc">
<copy file="Help/YamlDotNet.chm" tofile="release/${version}/YamlDotNet-${string::replace(version, '.', '-')}.chm" overwrite="true" />
</target>
<target name="build-nuget-package">
<echo message="${path::get-file-name(nuspec-file)}" />
<delete dir="tmp" failonerror="false" />
<mkdir dir="tmp" />
<copy file="${nuspec-file}" todir="tmp" />
<xmlpoke file="tmp/${path::get-file-name(nuspec-file)}" xpath="/package/metadata/version" value="${version}" />
<xmlpoke file="tmp/${path::get-file-name(nuspec-file)}" xpath="/package/metadata/dependencies/dependency/@version" value="${version}" />
<exec program="support/nuget/NuGet.exe" workingdir="tmp">
<arg value="pack" />
<arg value="${path::get-file-name(nuspec-file)}" />
</exec>
<copy todir="release/${version}">
<fileset basedir="tmp">
<include name="*.nupkg" />
</fileset>
</copy>
<delete dir="tmp" />
</target>
<target name="publish-nuget" depends="package-nuget" description="Builds NuGet packages and publishes them to the NuGet repository.">
<foreach item="File" property="nuspec-file">
<in>
<items>
<include name="release/${version}/*.nupkg" />
</items>
</in>
<do>
<exec program="support/nuget/NuGet.exe" workingdir="release/${version}">
<arg value="push" />
<arg value="-source" />
<arg value="http://packages.nuget.org/v1/" />
<arg value="${path::get-file-name(nuspec-file)}" />
</exec>
</do>
</foreach>
</target>
<target name="package-nuget" depends="build">
<foreach item="File" property="nuspec-file">
<in>
<items>
<include name="*.nuspec" />
</items>
</in>
<do>
<call target="build-nuget-package" />
</do>
</foreach>
</target>
<target name="package" depends="package-bin, package-src, package-doc">
</target>
</project>