forked from nunit/nunit3-vs-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nunit3-vs-adapter.build
105 lines (78 loc) · 3.52 KB
/
nunit3-vs-adapter.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
<?xml version="1.0"?>
<project name="NUnitTestAdapter" default="build" basedir=".">
<description>
This script is used to build, test and package the NUnit VS adapter.
</description>
<!-- Set version number for package -->
<property name="package.version" value="3.0.8-ctp-8"/>
<!-- Define package name, including version -->
<property name="package.base.name" value="NUnit3TestAdapter"/>
<property name="package.name" value="${package.base.name}-${package.version}"/>
<!-- Define various directories used -->
<property name="project.base.dir"
value="${project::get-base-directory()}"/>
<property name="project.package.dir"
value="${path::combine(project.base.dir,'package')}"/>
<property name="project.nuget.dir"
value="${path::combine(project.base.dir,'nuget')}"/>
<property name="project.lib.dir"
value="${path::combine(project.base.dir, 'lib')}"/>
<property name="package.working.dir"
value="${path::combine(project.package.dir, package.name)}"/>
<property name="install.release.dir"
value="${path::combine(project.base.dir, 'src\NUnitTestAdapterInstall\bin\Release')}"/>
<target name="build" description="Build the adapter (NYI)"/>
<target name="test" description="Test the adapter (NYI)"/>
<target name="package" desciption="Package the adapter"
depends="package-vsix,package-zip,package-nuget"/>
<target name="package-vsix">
<!-- Copy the vsix package, built by Visual Studio. -->
<property name="source.vsix.file" value="NUnit3TestAdapter.vsix"/>
<property name="target.vsix.file" value="${package.name}.vsix"/>
<copy file="${path::combine(install.release.dir, source.vsix.file)}"
tofile="${path::combine(project.package.dir, target.vsix.file)}"/>
</target>
<target name="package-zip">
<!-- Create the working directory -->
<mkdir dir="${package.working.dir}"/>
<!-- Copy binaries to the working directory for zipping. -->
<!-- Note that this requires the install project to have -->
<!-- a reference to each binary we want to include. -->
<copy todir="${package.working.dir}">
<fileset basedir="${install.release.dir}">
<include name="NUnit3.TestAdapter.dll"/>
<include name="nunit.engine.dll"/>
<include name="nunit.engine.api.dll"/>
<include name="Mono.Cecil.dll"/>
<include name="ignore.addins"/>
</fileset>
</copy>
<!-- Create the zip package -->
<property name="zip.file.name" value="${package.name}.zip"/>
<zip ziplevel="9"
zipfile="${project.package.dir}/${zip.file.name}">
<fileset basedir="${package.working.dir}" prefix="${package.name}">
<include name="**"/>
</fileset>
</zip>
</target>
<target name="package-nuget">
<property name="nuget.package.name" value="NUnit3VisualStudioTestAdapter"/>
<property name="nuget.internal.id" value="NUnit3TestAdapter"/>
<call target="create-nuget-package"/>
</target>
<target name="create-nuget-package">
<copy file="${project.nuget.dir}/${nuget.package.name}.nuspec"
tofile="${project.package.dir}/${nuget.package.name}-${package.version}.nuspec"
overwrite="true">
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<exec program="NuGet.exe"
workingdir="${project.package.dir}"
commandline="pack ${nuget.package.name}-${package.version}.nuspec" />
<move file="${project.package.dir}/${nuget.internal.id}.${package.version}.nupkg"
tofile="${project.package.dir}/${nuget.package.name}-${package.version}.nupkg"/>
</target>
</project>