-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
123 lines (96 loc) · 3.36 KB
/
build.xml
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
<project name="dejour" basedir="." default="all"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/>
<property name="dejour-version" value="d"/>
<target name="install-ivy" description="install ivy">
<path id="ivy.lib.path">
<pathelement location="ivy.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path" />
</target>
<property name="pattern-with-rev"
value="${basedir}/downloads/[conf]/[artifact]-[revision].[ext]"/>
<target name="downloads" depends="install-ivy">
<ivy:retrieve pattern="${pattern-with-rev}"/>
</target>
<target name="init" depends="downloads"/>
<target name="clj.exe" depends="init">
<exec dir="c_src" executable="make">
<arg value="release"/>
</exec>
</target>
<macrodef name="create-dejour-release">
<attribute name="name"/>
<attribute name="rel-name"
default="dejour-@{name}${dejour-version}"/>
<sequential>
<mkdir dir="build/@{rel-name}/lib"/>
<copy todir="build/@{rel-name}">
<fileset dir="${basedir}">
<include name="bin/**/*"/>
<include name="examples/**/*"/>
</fileset>
</copy>
<copy tofile="build/@{rel-name}/syslib/jline.jar" flatten="true">
<fileset dir="${basedir}">
<include name="downloads/jline/jline*.jar"/>
</fileset>
</copy>
<copy todir="build/@{rel-name}/lib" flatten="true">
<fileset dir="${basedir}">
<include name="downloads/@{name}/**/*"/>
</fileset>
</copy>
<chmod perm="ugo+x">
<fileset dir="build/@{rel-name}"/>
</chmod>
<echo>name = @{name}</echo>
<echo>rel-name = @{rel-name}</echo>
<zip destfile="build/@{rel-name}.zip"
basedir="build/"
includes="@{rel-name}/**/*"/>
<tar destfile="build/@{rel-name}.tar">
<tarfileset dir="build" filemode="755">
<include name="@{name}/bin/**/*"/>
</tarfileset>
<tarfileset dir="build">
<include name="@{rel-name}/**/*"/>
<exclude name="@{rel-name}/bin/**/*"/>
</tarfileset>
</tar> </sequential>
</macrodef>
<target name="all" depends="init" >
<create-dejour-release name="minimal-1.2.1"/>
<create-dejour-release name="complete-1.2.1"/>
<create-dejour-release name="minimal-1.3.0"/>
<create-dejour-release name="complete-1.3.0"/>
</target>
<target name="everything" depends="clj.exe, all"/>
<macrodef name="test-dejour-release">
<attribute name="ivy-conf-name"/>
<attribute name="name" default="dejour-@{ivy-conf-name}"/>
<sequential>
<java fork="true" failonerror="true" classname="clojure.main">
<env key="PATH" value="build/@{name}/bin${path.separator}${env.PATH}"/>
<classpath>
<fileset dir="build/@{name}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
<arg value="${basedir}/test/dejour-tests.clj"/>
</java>
</sequential>
</macrodef>
<target name="test">
<test-dejour-release ivy-conf-name="complete-1.2.1${dejour-version}"/>
</target>
<target name="clean">
<delete dir="build" />
<delete dir="downloads" />
<exec dir="c_src" executable="make">
<arg value="clean"/>
</exec>
</target>
</project>