Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 187 lines (158 sloc) 7.48 kb
1371a6b updates Scala examples, added detach plugin
michelou authored
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <project name="sabbus" default="build">
4
5 <description>
6 SuperSabbus for Scala detach plugin.
7 </description>
8
9 <echo level="info" message="Running SABBUS for ${ant.project.name}..."/>
10
11 <!-- ===========================================================================
12 END-USER TARGETS
13 ============================================================================ -->
14
15 <target name="build" depends="pack.done"
16 description="Builds the Scala detach plugin."/>
17
18 <target name="clean" depends="quick.clean">
19 </target>
20
21 <target name="all.clean" depends="quick.clean, pack.clean">
22 </target>
23
24 <!-- ===========================================================================
25 PROPERTIES
26 ============================================================================ -->
27
28 <property environment="env"/>
29 <!-- Prevents system classpath from being used -->
30 <property name="build.sysclasspath" value="ignore"/>
31
32 <!-- Defines the repository layout -->
33 <property name="lib.dir" value="${basedir}/lib"/>
34 <property name="src.dir" value="${basedir}/src"/>
35 <property name="partest.dir" value="${basedir}/test"/>
36
37 <!-- Loads custom properties definitions -->
38 <property file="${basedir}/build.properties"/>
39
40 <!-- Sets location of build folders -->
41 <property name="build.dir" value="${basedir}/build"/>
42 <property name="build-quick.dir" value="${build.dir}/quick"/>
43 <property name="build-pack.dir" value="${build.dir}/pack"/>
44
45 <!-- if ANT_OPTS is already set by the environment, it will be unaltered,
46 but if it is unset it will take this default value. -->
47 <property name="env.ANT_OPTS" value="-Xms1024M -Xmx1024M -Xss1M -XX:MaxPermSize=128M -XX:+UseParallelGC" />
48
49 <property
50 name="scalacfork.jvmargs"
51 value="${env.ANT_OPTS}"/>
52
53 <property name="scalac.args.quick" value="-deprecation"/>
54 <property name="scalac.args.optimise" value=""/>
55
56 <!-- Setting-up Ant contrib tasks -->
57 <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib.dir}/ant/ant-contrib.jar"/>
58
59 <!-- ===========================================================================
60 QUICK BUILD (QUICK)
61 ============================================================================ -->
62
63 <target name="quick.clean">
64 <delete includeemptydirs="yes" quiet="yes" failonerror="no">
65 <fileset dir="${build-quick.dir}/classes/detach-library"/>
66 <fileset dir="${build-quick.dir}/classes/detach-plugin"/>
67 </delete>
68 </target>
69
70 <target name="quick.done">
71 <stopwatch name="quick.done.timer"/>
72 <path id="quick.classpath">
73 <pathelement location="${build-quick.dir}/classes/library"/>
74 <pathelement location="${build-quick.dir}/classes/compiler"/>
75 <pathelement location="${lib.dir}/fjbg.jar"/>
76 <pathelement location="${lib.dir}/msil.jar"/>
77 <pathelement location="${lib.dir}/forkjoin.jar"/>
78 <pathelement location="${ant.home}/lib/ant.jar"/>
79 </path>
80 <taskdef
81 resource="scala/tools/ant/sabbus/antlib.xml"
82 classpathref="quick.classpath"
83 />
84 <mkdir dir="${build-quick.dir}/classes/detach-plugin"/>
85 <scalacfork
86 destdir="${build-quick.dir}/classes/detach-plugin"
87 compilerpathref="quick.classpath"
88 params="${scalac.args.quick}"
89 srcdir="${src.dir}/detach/plugin"
90 jvmargs="${scalacfork.jvmargs}">
91 <include name="**/*.scala"/>
92 <compilationpath>
93 <pathelement location="${build-quick.dir}/classes/library"/>
94 <pathelement location="${build-quick.dir}/classes/compiler"/>
95 <pathelement location="${build-quick.dir}/classes/detach-plugin"/>
96 <pathelement location="${lib.dir}/forkjoin.jar"/>
97 </compilationpath>
98 </scalacfork>
99 <copy
100 file="${src.dir}/detach/plugin/scalac-plugin.xml"
101 todir="${build-quick.dir}/classes/detach-plugin"
102 />
103 <mkdir dir="${build-quick.dir}/classes/detach-library"/>
104 <scalacfork
105 destdir="${build-quick.dir}/classes/detach-library"
106 compilerpathref="quick.classpath"
107 params="${scalac.args.quick}"
108 srcdir="${src.dir}/detach/library"
109 jvmargs="${scalacfork.jvmargs}">
110 <include name="**/*.scala"/>
111 <compilationpath>
112 <pathelement location="${build-quick.dir}/classes/library"/>
113 <pathelement location="${lib.dir}/forkjoin.jar"/>
114 </compilationpath>
115 </scalacfork>
116 <touch file="${build-quick.dir}/plugins.complete" verbose="no"/>
117 <stopwatch name="quick.done.timer" action="total"/>
118 </target>
119
120 <!-- ===========================================================================
121 PACKED QUICK BUILD (PACK)
122 ============================================================================ -->
123
124 <target name="pack.start" depends="quick.done"/>
125
126 <target name="pack.pre-lib" depends="pack.start">
127 <uptodate
128 property="pack.lib.available"
129 targetfile="${build-pack.dir}/lib/scala-detach.jar"
130 srcfile="${build-quick.dir}/plugins.complete"/>
131 </target>
132
133 <target name="pack.lib" depends="pack.pre-lib" unless="pack.lib.available">
134 <mkdir dir="${build-pack.dir}/misc/scala-devel/plugins"/>
135 <jar destfile="${build-pack.dir}/misc/scala-devel/plugins/detach.jar">
136 <fileset dir="${build-quick.dir}/classes/detach-plugin"/>
137 </jar>
138 <mkdir dir="${build-pack.dir}/lib"/>
139 <jar destfile="${build-pack.dir}/lib/scala-detach.jar">
140 <fileset dir="${build-quick.dir}/classes/detach-library">
141 <include name="scala/**"/>
142 </fileset>
143 </jar>
144 </target>
145
146 <target name="pack.done" depends="pack.lib">
147 <path id="pack.classpath">
148 <pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
149 <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
150 <pathelement location="${build-pack.dir}/lib/scala-detach.jar"/>
151 <pathelement location="${build-pack.dir}/lib/scala-partest.jar"/>
152 <pathelement location="${build-pack.dir}/lib/scalap.jar"/>
153 <pathelement location="${ant.home}/lib/ant.jar"/>
154 <pathelement location="${lib.dir}/jline.jar"/>
155 </path>
156 <taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.classpath"/>
157 <taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.classpath"/>
158 </target>
159
160 <target name="pack.clean">
161 <delete includeemptydirs="yes" quiet="yes" failonerror="no">
162 <fileset dir="${build-pack.dir}/lib" includes="scala-detach.jar"/>
163 <fileset dir="${build-pack.dir}/misc/scala-devel/plugins" includes="detach.jar"/>
164 </delete>
165 </target>
166
167 <!-- ===========================================================================
168 TEST SUITE
169 ============================================================================ -->
170
171 <target name="test.suite" depends="pack.done">
172 <property name="partest.srcdir" value="files" />
173 <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java"
174 timeout="2400000"
175 srcdir="${partest.srcdir}"
176 scalacopts="${scalac.args.optimise} -Xpluginsdir ${build-pack.dir}/misc/scala-devel/plugins -Xplugin-require:detach -P:detach:enable">
177 <compilationpath>
178 <path refid="pack.classpath"/>
179 <fileset dir="${partest.dir}/files/lib" includes="*.jar" />
180 </compilationpath>
181 <negtests dir="${partest.dir}/${partest.srcdir}/detach-neg" includes="*.scala"/>
182 <runtests dir="${partest.dir}/${partest.srcdir}/detach-run" includes="*.scala"/>
183 </partest>
184 </target>
185
186 </project>
Something went wrong with that request. Please try again.