forked from marek-stoj/NReadability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NReadability.build
143 lines (131 loc) · 4.5 KB
/
NReadability.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
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0" encoding="utf-8" ?>
<project name="NReadability" default="all">
<property name="nreadability.version" value="1.4.9.0" />
<property name="msbuild.path" value="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" />
<property name="git.path" value="C:\Program Files (x86)\Git\bin\git.exe" />
<property name="nuget.path" value="C:\Programs\NuGet\NuGet.exe" />
<echo message="Current NReadability version is ${nreadability.version}." />
<target name="expand-templates">
<echo message="Expanding AssemblyInfo.cs templates." />
<foreach item="File" property="filePath">
<in>
<items>
<include name="Src\**\AssemblyInfo.cs.template" />
</items>
</in>
<do>
<echo message="Expanding template ${filePath}" />
<copy file="${filePath}" tofile="${path::combine(path::get-directory-name(filePath), 'AssemblyInfo.cs')}" overwrite="true">
<filterchain>
<replacetokens>
<token key="NReadabilityVersion" value="${nreadability.version}" />
</replacetokens>
</filterchain>
</copy>
</do>
</foreach>
</target>
<target name="build" depends="expand-templates">
<exec program="${msbuild.path}">
<arg value="Src\NReadability\NReadability.sln" />
<arg value="/t:Build" />
<arg value="/p:Configuration=Release" />
<arg value="/p:Platform=Any CPU" />
</exec>
</target>
<target name="doc" depends="build">
<exec program="Tools\ImmDocNet\ImmDocNet.exe">
<arg value="-ForceDelete" />
<arg value="-IncludeInternalMembers" />
<arg value="-ProjectName:NReadability Documentation" />
<arg value="-OutputDirectory:ImmDoc" />
<arg value="-CHMName:ImmDoc\NReadability.chm" />
<arg value="Bin\NReadability.dll" />
<arg value="Bin\NReadability.xml" />
</exec>
</target>
<target name="test" depends="build">
<exec program="Tools\NUnit\nunit-console.exe">
<arg value="Tests\NReadability.Tests.dll" />
<arg value="/xml=Tests\TestsResults.xml" />
</exec>
</target>
<target name="dist" depends="build test doc">
<delete dir="Dist" />
<copy todir="Dist">
<fileset basedir="Bin">
<include name="*.dll" />
<include name="*.xml" />
</fileset>
</copy>
<copy file="Bin\NReadability.Console.exe" todir="Dist" />
<copy file="LICENSE.txt" todir="Dist" />
<copy todir="Dist">
<fileset basedir="ImmDoc">
<include name="*.chm" />
</fileset>
</copy>
<call target="package" />
</target>
<target name="package">
<!-- Package binary. -->
<property name="bin.zip.dir" value="NReadability-${nreadability.version}" />
<zip zipfile="Dist\${bin.zip.dir}.zip">
<fileset basedir="Dist" prefix="${bin.zip.dir}">
<include name="**\*" />
<exclude name="NReadability-*.zip" />
</fileset>
</zip>
<!-- Package source. -->
<property name="src.zip.dir" value="NReadability-${nreadability.version}-Src" />
<echo message="Archiving repository." />
<exec program="${git.path}">
<arg value="archive" />
<arg value="--format=zip" />
<arg value="--output" />
<arg value="Dist\${src.zip.dir}.zip" />
<arg value="master" />
</exec>
<!-- Create NuGet package. -->
<exec program="${nuget.path}">
<arg value="pack" />
<arg value="NReadability.nuspec" />
<arg value="-OutputDirectory" />
<arg value="Dist" />
</exec>
<!-- Clean up. -->
<delete>
<fileset basedir="Dist">
<include name="**\*" />
<exclude name="${bin.zip.dir}.zip" />
<exclude name="${src.zip.dir}.zip" />
<exclude name="*.nupkg" />
</fileset>
</delete>
</target>
<target name="push-to-nuget">
<foreach item="File" property="filePath">
<in>
<items>
<include name="Dist\NReadability.*.nupkg" />
</items>
</in>
<do>
<echo message="Pushing ${filePath} to NuGet." />
<exec program="${nuget.path}">
<arg value="push" />
<arg value="${filePath}" />
</exec>
</do>
</foreach>
</target>
<target name="clean">
<delete dir="Bin" />
<delete dir="Tests" />
<delete dir="ImmDoc" />
<delete dir="Dist" />
</target>
<target name="all">
<call target="dist" />
</target>
</project>