-
Notifications
You must be signed in to change notification settings - Fork 0
/
TwitterNET.build
109 lines (90 loc) · 4.42 KB
/
TwitterNET.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
<?xml version="1.0" encoding="utf-8"?>
<project name="TwitterNET" xmlns="http://nant.sf.net/release/0.85/nant.xsd" default="build">
<include buildfile="TwitterNET.build.properties" /> <!-- Load our properties -->
<if test="${build.os == 'Unix'}" >
<include buildfile="TwitterNET.build.linux" /> <!-- Include the Linux specific stuff -->
</if>
<!-- Load additional NAnt Contrib tasks -->
<loadtasks assembly="${directory::get-current-directory()}${file.sep}lib${file.sep}nantcontrib${file.sep}bin${file.sep}NAnt.Contrib.Tasks.dll" />
<target name="build" depends="init, compile, testing" description="The main build target that builds TwitterNet"/>
<target name="clean" depends="init" description="Cleans up from a previous build">
<if test="${build.os == 'Unix'}" >
<call target="clean-linux" />
</if>
<if test="${build.os != 'Unix'}"> <!-- CLEAN Build on Windows -->
<exec program="${build.exe}"
commandline="${file.solution} /t:Clean /p:Configuration=${project.config};outdir=${dir.build}${file.sep} /v:q" verbose="true" />
</if>
<delete dir="${dir.build}" if="${directory::exists(dir.build)}" />
</target>
<target name="init" depends="" description="Sets up the files, options, and folders for the build">
<delete dir="${dir.build}" if="${directory::exists(dir.build)}" />
<mkdir dir="${dir.build}" />
<mkdir dir="${dir.buildreports}" />
<!--Settings Output-->
<echo message="Operating System: ${build.os}" />
<echo message="Solution Folder: ${dir.solution}"/>
<echo message="Solution File: ${file.solution}"/>
<echo message="Build Folder: ${dir.build}"/>
<echo message="Framework Path: ${framework.path}" />
<if test="${build.os != 'Unix'}">
<echo message="msbuild: ${build.exe}"/>
</if>
</target>
<target name="compile" depends="init" >
<echo message="Build Directory is ${dir.build}"/>
<echo message="Building solution: ${file.solution}" />
<if test="${build.os == 'Unix'}" >
<call target="compile-linux" />
</if>
<if test="${build.os != 'Unix'}"> <!-- Build on Windows -->
<exec program="${build.exe}"
commandline="${file.solution} /t:Clean /p:Configuration=${project.config};outdir=${dir.build}${file.sep} /v:q" verbose="true" />
<exec program="${build.exe}"
commandline="${file.solution} /t:Build /p:Configuration=${project.config};outdir=${dir.build}${file.sep} /v:q" verbose="true" />
</if>
</target>
<target name="testing" depends="init, compile">
<if test="${property::exists('teamcity.dotnet.nunitaddin')}">
<mkdir dir="${dir.nunit.addins}" />
<copy file="${teamcity.dotnet.nunitaddin}-2.4.8.dll" todir="${dir.nunit.addins}" />
<copy file="${teamcity.dotnet.nunitaddin}-2.4.8.pdb" todir="${dir.nunit.addins}" />
</if>
<if test="${build.os == 'Unix'}">
<call target="testing-linux" />
</if>
<if test="${build.os != 'Unix'}"> <!-- Not on Linux, so we can run code coverage -->
<exec program="${ncover.exe}" failonerror="false" verbose="true">
<arg line="${nunit.exe} ${dir.build}${file.sep}${assembly.unittests} /xml=${dir.build}${file.sep}TestResult.xml" />
<arg line="//a "TwitterNET"" />
<arg line="//ea "TwitterNET_Tests"" />
<arg line="//x ${dir.build}${file.sep}CodeCoverage.xml" />
<arg line="//v" />
</exec>
</if>
<!-- Code Coverage Report Style -->
<if test="${build.os != 'Unix'}">
<property name="xml.codecoverage" value="${dir.build}${file.sep}CodeCoverage.xml" />
<style style="${ncover.xslt}" in="${xml.codecoverage}" out="${dir.buildreports}${file.sep}CodeCoverageReport.html" if="${file::exists(xml.codecoverage)}" />
</if>
<!-- NUnit Report Creation (Currently only works on Windows build server)-->
<if test="${build.os != 'Unix'}" >
<nunit2report todir="${dir.buildreports}">
<fileset>
<include name="${dir.build}${file.sep}TestResult.xml" />
</fileset>
</nunit2report>
</if>
<if test="${build.os != 'Unix'}" >
<delete dir="${dir.nunit.addins}" if="${directory::exists(dir.nunit.addins)}" />
<delete>
<fileset>
<include name="${dir.build}${file.sep}*.xml" />
<include name="*.log" />
<include name="*.txt" />
<include name="${dir.build}${file.sep}nunit*.dll"/>
</fileset>
</delete>
</if>>
</target>
</project>