Skip to content
Newer
Older
100644 208 lines (178 sloc) 7.57 KB
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
1 <project name="clojure" default="all" xmlns:mvn="urn:maven-artifact-ant">
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
2
3 <description>
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
4 Build with "ant jar" and then start the
5 REPL with: "java -cp clojure.jar clojure.main".
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
6 You will need to install the Maven Ant
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
7 Tasks to ${ant.home}/lib in order to execute
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
8 the nightly-build or stable-build targets.
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
9 </description>
10
11 <property name="src" location="src"/>
d5f4c4c @stuarthalloway gtic work-in-progress:
stuarthalloway authored
12 <property name="test" location="test"/>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
13 <property name="jsrc" location="${src}/jvm"/>
14 <property name="cljsrc" location="${src}/clj"/>
15 <property name="build" location="classes"/>
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
16
17 <!-- version related properties -->
18 <property file="${cljsrc}/clojure/version.properties"/>
19 <!-- ensures all version properties are present -->
20 <fail unless="clojure.version.major"/>
21 <fail unless="clojure.version.minor"/>
22 <fail unless="clojure.version.interim"/>
23
24 <condition property="clojure.version.incremental.label"
25 value=".${clojure.version.incremental}"
26 else="">
27 <length string="${clojure.version.incremental}" when="greater" length="0" />
28 </condition>
29 <condition property="clojure.version.qualifier.label"
30 value="-${clojure.version.qualifier}"
31 else="">
32 <length string="${clojure.version.qualifier}" when="greater" length="0" />
33 </condition>
34 <condition property="clojure.version.interim.label"
35 value="-SNAPSHOT"
36 else="">
37 <!-- We place -SNAPSHOT whenever interim is not set to false, not only
38 if interim is set to true (this is less typo prone in the worst case -->
39 <not><equals arg1="${clojure.version.interim}" arg2="false" trim="true"/></not>
40 </condition>
41
42 <property name="clojure.version.label"
43 value="${clojure.version.major}.${clojure.version.minor}${clojure.version.incremental.label}${clojure.version.qualifier.label}${clojure.version.interim.label}"/>
44
45 <!-- general filterset for use when clojure version must be copied -->
46 <filterset id="clojure-version-filterset">
47 <filter token="clojure-version" value="${clojure.version.label}"/>
48 </filterset>
49
0467cd7 @richhickey copy versioned jars to unversioned on build, patch from
richhickey authored
50 <property name="clojure_noversion_jar" location="clojure.jar"/>
51 <property name="slim_noversion_jar" location="clojure-slim.jar"/>
52 <property name="src_noversion_jar" location="clojure-sources.jar"/>
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
53 <property name="clojure_jar" location="clojure-${clojure.version.label}.jar"/>
54 <property name="slim_jar" location="clojure-slim-${clojure.version.label}.jar"/>
55 <property name="src_jar" location="clojure-sources-${clojure.version.label}.jar"/>
56
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
57
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
58 <!-- These make sense for building on tapestry.formos.com -->
59
60 <property name="snapshot.repo.dir" location="/var/www/maven-snapshot-repository"/>
61 <property name="stable.repo.dir" location="/var/www/maven-repository"/>
62
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
63 <target name="init" depends="clean">
64 <tstamp/>
65 <mkdir dir="${build}"/>
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
66 <antcall target="init-version"/>
67 </target>
68
69 <target name="init-version">
70 <copy file="pom-template.xml"
71 tofile="pom.xml">
72 <filterset refid="clojure-version-filterset"/>
73 </copy>
74 <!--prevents users from modifying accidentally the generated pom.xml
75 works only on linux.-->
76 <chmod file="pom.xml" perm="ugo-w"/>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
77 </target>
78
79 <target name="compile-java" depends="init"
80 description="Compile Java sources.">
81 <javac srcdir="${jsrc}" destdir="${build}" includeJavaRuntime="yes"
26f5aed @richhickey initial fork/join support
richhickey authored
82 debug="true" target="1.5" classpath="jsr166y.jar"/>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
83 </target>
84
85 <target name="compile-clojure" depends="compile-java"
86 description="Compile Clojure sources.">
87 <java classname="clojure.lang.Compile"
26f5aed @richhickey initial fork/join support
richhickey authored
88 classpath="${build}:${cljsrc}:jsr166y.jar">
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
89 <sysproperty key="clojure.compile.path" value="${build}"/>
90 <arg value="clojure.core"/>
91 <arg value="clojure.main"/>
92 <arg value="clojure.set"/>
93 <arg value="clojure.xml"/>
94 <arg value="clojure.zip"/>
95 <arg value="clojure.inspector"/>
a12092c @stuarthalloway gtic package renamings:
stuarthalloway authored
96 <arg value="clojure.walk"/>
97 <arg value="clojure.stacktrace"/>
98 <arg value="clojure.template"/>
99 <arg value="clojure.test"/>
100 <arg value="clojure.test.tap"/>
26f5aed @richhickey initial fork/join support
richhickey authored
101 <arg value="clojure.par"/>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
102 </java>
103 </target>
104
105 <target name="clojure" depends="compile-clojure"
106 description="Create clojure jar file.">
107 <jar jarfile="${clojure_jar}" basedir="${build}">
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
108 <fileset dir="${cljsrc}">
109 <include name="**/*.clj"/>
110 <include name="clojure/version.properties"/>
111 </fileset>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
112 <manifest>
113 <attribute name="Main-Class" value="clojure.main"/>
114 <attribute name="Class-Path" value="."/>
115 </manifest>
116 </jar>
0467cd7 @richhickey copy versioned jars to unversioned on build, patch from
richhickey authored
117 <copy file="${clojure_jar}" tofile="${clojure_noversion_jar}" />
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
118 </target>
119
24a3497 @richhickey changed test target to "test"
richhickey authored
120 <target name="test"
d5f4c4c @stuarthalloway gtic work-in-progress:
stuarthalloway authored
121 description="Run clojure tests">
122 <!-- depends="clojure"> -->
123 <java classname="clojure.main">
124 <classpath>
125 <path location="${test}"/>
126 <path location="${clojure_jar}"/>
127 </classpath>
128 <arg value="-e"/>
a12092c @stuarthalloway gtic package renamings:
stuarthalloway authored
129 <arg value="(require '(clojure [test-clojure :as main])) (main/run)"/>
d5f4c4c @stuarthalloway gtic work-in-progress:
stuarthalloway authored
130 </java>
131 </target>
132
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
133 <target name="clojure-slim" depends="compile-java"
134 description="Create clojure-slim jar file (omits compiled Clojure code)">
135 <jar jarfile="${slim_jar}">
136 <fileset dir="${build}" includes="clojure/asm/**"/>
137 <fileset dir="${build}" includes="clojure/lang/**"/>
138 <fileset dir="${build}" includes="clojure/main.class"/>
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
139 <fileset dir="${cljsrc}">
140 <include name="**/*.clj"/>
141 <include name="clojure/version.properties"/>
142 </fileset>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
143 <manifest>
144 <attribute name="Main-Class" value="clojure.main"/>
145 <attribute name="Class-Path" value="."/>
146 </manifest>
147 </jar>
0467cd7 @richhickey copy versioned jars to unversioned on build, patch from
richhickey authored
148 <copy file="${slim_jar}" tofile="${slim_noversion_jar}" />
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
149 </target>
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
150
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
151 <target name="clojure-sources" depends="init"
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
152 description="Create a JAR of Java sources.">
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
153 <jar jarfile="${src_jar}" basedir="${jsrc}" includes="**/*">
154 <fileset dir="${cljsrc}"
155 includes="clojure/version.properties"/>
156 </jar>
0467cd7 @richhickey copy versioned jars to unversioned on build, patch from
richhickey authored
157 <copy file="${src_jar}" tofile="${src_noversion_jar}" />
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
158 </target>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
159
160 <target name="jar" depends="clojure"/>
161
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
162 <target name="all" depends="clojure,clojure-slim,clojure-sources"/>
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
163
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
164 <target name="clean"
165 description="Remove autogenerated files and directories.">
166 <delete dir="${build}"/>
37ae4fb @richhickey added support for versioned builds, alignment with *clojure-version*,…
richhickey authored
167 <delete file="pom.xml"/>
5f11c76 @richhickey Revert: improved Maven integration, patch from hlship [issue 70], bro…
richhickey authored
168 </target>
540e119 @richhickey added (non-definitive) ant and maven build scripts
richhickey authored
169
cbef0c9 @richhickey Build patch: install results to local Maven repository [issue 105], p…
richhickey authored
170 <target name="-setup-maven">
171 <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"/>
172 </target>
173
174 <macrodef name="deploy">
175 <attribute name="target-dir" description="Root of Maven repository"/>
176 <sequential>
177 <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"/>
178 <mvn:deploy file="${clojure_jar}">
179 <pom file="pom.xml"/>
180 <attach file="${src_jar}" classifier="sources"/>
181 <attach file="${slim_jar}" classifier="slim"/>
182 <remoteRepository url="file:@{target-dir}"/>
183 </mvn:deploy>
184 </sequential>
185 </macrodef>
186
187 <target name="ci-build" depends="clean,all,-setup-maven"
188 description="Continous integration build, installed to local repository.">
189 <mvn:install file="${clojure_jar}">
190 <pom file="pom.xml"/>
191 <attach file="${src_jar}" classifier="sources"/>
192 <attach file="${slim_jar}" classifier="slim"/>
193 </mvn:install>
194 </target>
195
196 <target name="nightly-build" depends="ci-build"
197 description="Build and deploy to nightly (snapshot) repository.">
198 <deploy target-dir="${snapshot.repo.dir}"/>
199 </target>
200
201
202 <target name="stable-build" depends="ci-build" description="Build and deploy to stable repository.">
203 <deploy target-dir="${stable.repo.dir}"/>
204 </target>
d1894df @richhickey improved Maven integration [issue 70], patch from hlship
richhickey authored
205
206
540e119 @richhickey added (non-definitive) ant and maven build scripts
richhickey authored
207 </project>
Something went wrong with that request. Please try again.