blob: 4ea66ed0c59caa432a97ecd061932fb8fd252ec7 (
plain) (
blame)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a simplified build file for Scala on Debian -->
<!-- $Id -->
<project name="scala" default="build">
<property environment="env"/>
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
<!-- Base properties -->
<property name="topdir" value="${basedir}/.."/>
<property name="debian.dir" value="${topdir}/debian"/>
<property name="docs.dir" value="${topdir}/docs"/>
<property name="examples.pdir" value="${docs.dir}"/>
<property name="examples.dir" value="${examples.pdir}/examples"/>
<property name="lib.dir" value="${topdir}/lib"/>
<property name="src.dir" value="${topdir}/src"/>
<property name="properties" value="${debian.dir}/build.properties"/>
<!-- User properties -->
<property file="${properties}"/>
<!-- General properties -->
<property name="copyright.holder" value="LAMP/EPFL"/>
<!-- Javac configuration properties -->
<property name="jc.source" value="1.4"/>
<property name="jc.target" value="1.4"/>
<property name="jc.deprecation" value="true"/>
<!-- Location of pre-compiled libraries -->
<property name="starr.lib.jar" value="${lib.dir}/scala-library.jar"/>
<property name="starr.comp.jar" value="${lib.dir}/scala-compiler.jar"/>
<property name="fjbg.jar" value="${lib.dir}/fjbg.jar"/>
<property name="ant.jar" value="/usr/share/java/ant.jar"/>
<!-- Location of build products properties -->
<property name="build.dir" value="${topdir}/simpbuild"/>
<property name="api.dir" value="${build.dir}/api"/>
<property name="tooldocs.dir" value="${build.dir}/manual"/>
<!-- Location of source and build elements names properties -->
<property name="lib.dir.name" value="library"/>
<property name="comp.dir.name" value="compiler"/>
<property name="dbc.dir.name" value="dbc"/>
<property name="src.lib.dir" value="${src.dir}/${lib.dir.name}"/>
<property name="src.comp.dir" value="${src.dir}/${comp.dir.name}"/>
<property name="src.dbc.dir" value="${src.dir}/${dbc.dir.name}"/>
<property name="exec.dir.name" value="exec"/>
<!-- Location of structure of the distribution properties -->
<property name="dist.sbaz.dir" value="${build.dir}/sbaz"/>
<property name="dist.name" value="scala"/>
<property name="lib.jar.name" value="${dist.name}-${lib.dir.name}.jar"/>
<property name="lib-dbc.jar.name" value="${dist.name}-dbc.jar"/>
<property name="comp.jar.name" value="${dist.name}-${comp.dir.name}.jar"/>
<property name="scala.exec.name" value="${dist.name}"/>
<property name="scalac.exec.name" value="scalac"/>
<property name="scaladoc.exec.name" value="scaladoc"/>
<property name="scalaint.exec.name" value="scalaint"/>
<!-- Shorcut names -->
<property name="build.lib.dir" value="${build.dir}/${lib.dir.name}"/>
<property name="build.comp.dir" value="${build.dir}/${comp.dir.name}"/>
<property name="build.dbc.dir" value="${build.dir}/${dbc.dir.name}"/>
<property name="build.jar.dir" value="${build.dir}/lib"/>
<property name="build.bin.dir" value="${build.dir}/bin"/>
<property name="build.manual.dir" value="${build.dir}/manual.classes"/>
<property name="api.lib.pdir" value="${api.dir}/${lib.dir.name}"/>
<property name="api.lib.dir" value="${api.lib.pdir}/api"/>
<property name="api.comp.pdir" value="${api.dir}/${comp.dir.name}"/>
<property name="api.comp.dir" value="${api.comp.pdir}/api"/>
<!-- sbaz properties -->
<property name="sbaz.lib.name" value="${dist.name}-library"/>
<property name="sbaz.dev.name" value="${dist.name}-devel"/>
<property name="sbaz.test.name" value="${dist.name}-test"/>
<property name="sbaz.scala.name" value="${dist.name}"/>
<property name="sbaz.universe" value="http://scala.epfl.ch/downloads/packages"/>
<!-- Testing if everything is in place -->
<echo level="verbose" message="starr.lib.jar=${starr.lib.jar}"/>
<fail message="STARR library in 'lib/' is not available">
<condition><not><and>
<available
classname="scala.Predef"
classpath="${starr.lib.jar}"
/>
<available
classname="scala.List"
classpath="${starr.lib.jar}"
/>
<available
classname="scala.runtime.ObjectRef"
classpath="${starr.lib.jar}"
/>
</and></not></condition>
</fail>
<echo level="verbose" message="starr.comp.jar=${starr.comp.jar}"/>
<fail message="STARR compiler in 'lib/' is not available">
<condition><not>
<available
classname="scala.tools.ant.Scalac"
classpath="${starr.comp.jar}:${starr.lib.jar}"
/>
</not></condition>
</fail>
<echo level="verbose" message="fjbg.jar=${fjbg.jar}"/>
<fail message="FJBG library in 'lib/' is not available">
<condition><not>
<available
classname="ch.epfl.lamp.fjbg.JCode"
classpath="${fjbg.jar}"
/>
</not></condition>
</fail>
<path id="starr.classpath">
<pathelement location="${fjbg.jar}"/>
<pathelement location="${starr.lib.jar}"/>
<pathelement location="${starr.comp.jar}"/>
</path>
<property name="os.type" value="UNIX"/>
<!-- Printing out some information about what environment I am running in -->
<echo
level="info"
message="OS: ${os.type} (${os.name} ${os.arch} ${os.version});"
/>
<echo
level="info"
message="Java: ${java.version} ('${java.home}');"
/>
<echo
level="info"
message="JVM: ${java.vm.name} ${java.vm.version};"
/>
<echo
level="info"
message="Ant: ${ant.version}."
/>
<!-- Generating version number -->
<property file="${topdir}/build.number"/>
<property
name="version.number"
value="${version.major}.${version.minor}.${version.patch}"
/>
<echo level="verbose" message="version.number=${version.number}"/>
<!-- Creating tasks -->
<taskdef
name="starr"
classname="scala.tools.ant.Scalac"
classpathref="starr.classpath"
/>
<taskdef
name="starrtool"
classname="scala.tools.ant.ScalaTool"
classpathref="starr.classpath"
/>
<taskdef
name="starrdoc"
classname="scala.tools.ant.Scaladoc"
classpathref="starr.classpath"
/>
<taskdef
name="starrsbaz"
classname="scala.tools.ant.ScalaBazaar"
classpathref="starr.classpath"
/>
<macrodef name="emit">
<attribute name="command"/>
<sequential>
<mkdir dir="${tooldocs.dir}"/>
<mkdir dir="${tooldocs.dir}/man1"/>
<java classname="scala.tools.docutil.EmitHtml"
output="${tooldocs.dir}/@{command}.html"
fork="false" logError="yes"
failonerror="true"
>
<arg value="scala.man1.@{command}"/>
<classpath>
<pathelement location="${build.manual.dir}"/>
<path refid="starr.classpath"/>
</classpath>
</java>
<java classname="scala.tools.docutil.EmitManPage"
output="${tooldocs.dir}/man1/@{command}.1"
fork="false" logError="yes"
failonerror="true"
>
<arg value="scala.man1.@{command}"/>
<classpath>
<pathelement location="${build.manual.dir}"/>
<path refid="starr.classpath"/>
</classpath>
</java>
</sequential>
</macrodef>
<target name="build">
<!-- Build library -->
<mkdir dir="${build.lib.dir}"/>
<javac
srcdir="${src.lib.dir}"
destdir="${build.lib.dir}"
source="${jc.source}"
target="${jc.target}"
deprecation="${jc.deprecation}"
>
<include name="**/*.java"/>
</javac>
<starr
srcdir="${src.lib.dir}"
destdir="${build.lib.dir}"
usepredefs="no"
>
<classpath>
<pathelement location="${build.lib.dir}"/> <!-- XXX ??? -->
</classpath>
<include name="scala/Predef.scala"/>
<include name="scala/runtime/ScalaRunTime.scala"/>
</starr>
<starr
srcdir="${src.lib.dir}"
destdir="${build.lib.dir}"
>
<classpath>
<pathelement location="${build.lib.dir}"/>
</classpath>
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
<exclude name="scala/runtime/ScalaRunTime.scala"/>
<exclude name="scala/dbc/**"/>
</starr>
<!-- Build compiler -->
<mkdir dir="${build.comp.dir}"/>
<starr
srcdir="${src.comp.dir}"
destdir="${build.comp.dir}"
>
<classpath>
<pathelement location="${build.lib.dir}"/>
<pathelement location="${ant.jar}"/>
<path refid="starr.classpath"/>
</classpath>
<include name="**/*.scala"/>
</starr>
<!-- Build DBC -->
<mkdir dir="${build.dbc.dir}"/>
<starr
srcdir="${src.dbc.dir}"
destdir="${build.dbc.dir}"
>
<classpath>
<pathelement location="${build.lib.dir}"/>
<pathelement location="${build.comp.dir}"/>
</classpath>
<include name="**/*.scala"/>
</starr>
<!-- Build jars -->
<mkdir dir="${build.jar.dir}"/>
<jar destfile="${build.jar.dir}/${comp.jar.name}">
<fileset dir="${build.comp.dir}"/>
<zipfileset src="${fjbg.jar}"/>
<fileset dir="${src.lib.dir}">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
<fileset dir="${src.comp.dir}">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
<manifest>
<attribute name="Signature-Version" value="${version.number}"/>
</manifest>
</jar>
<jar destfile="${build.jar.dir}/${lib.jar.name}">
<fileset dir="${build.lib.dir}"/>
<manifest>
<attribute name="Signature-Version" value="${version.number}"/>
</manifest>
</jar>
<jar destfile="${build.jar.dir}/${lib-dbc.jar.name}">
<fileset dir="${build.dbc.dir}"/>
<manifest>
<attribute name="Signature-Version" value="${version.number}"/>
</manifest>
</jar>
<!-- build tool scripts -->
<mkdir dir="${build.bin.dir}"/>
<starrtool
file="${build.bin.dir}/${scala.exec.name}"
version="${version.number}"
copyright="${copyright}"
name="Scala code runner"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="-Xmx256M -Xms16M"
/>
<starrtool
file="${build.bin.dir}/${scalac.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
version="${version.number}"
copyright="${copyright}"
javaFlags="-Xmx256M -Xms16M"
/>
<starrtool
file="${build.bin.dir}/${scaladoc.exec.name}"
name="Scala doc generator"
class="scala.tools.nsc.Main"
toolflags="-doc"
version="${version.number}"
copyright="${copyright}"
javaFlags="-Xmx256M -Xms16M"
/>
</target>
<target name="docs.lib">
<mkdir dir="${api.lib.dir}"/>
<starrdoc
srcdir="${src.dir}"
destdir="${api.lib.dir}"
sourcepath=""
windowtitle="Scala Library Documentation"
documenttitle="<div>Scala 2v${version.number}</div>"
>
<classpath>
<pathelement location="${build.jar.dir}/${lib.jar.name}"/>
</classpath>
<include name="${dbc.dir.name}/**/*.scala"/>
<include name="${lib.dir.name}/**/*.scala"/>
</starrdoc>
</target>
<target name="docs.manual">
<mkdir dir="${build.manual.dir}"/>
<starr srcdir="${topdir}/src/manual" destdir="${build.manual.dir}">
<classpath>
<path refid="starr.classpath"/>
</classpath>
</starr>
<emit command="scala"/>
<emit command="scalac"/>
<emit command="scaladoc"/>
<emit command="scalap"/>
<copy todir="${tooldocs.dir}">
<fileset dir="${src.dir}/manual/scala/tools/docutil/resources">
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
</fileset>
</copy>
</target>
<target name="docs" depends="docs.lib, docs.manual"/>
<target name="dist"
depends="build, docs"
>
<!-- Create the SBaz packages -->
<mkdir dir="${dist.sbaz.dir}"/>
<!-- Create the Scala library package -->
<starrsbaz
file="${dist.sbaz.dir}/${sbaz.lib.name}-${version.number}.sbp"
adfile="${dist.sbaz.dir}/${sbaz.lib.name}-${version.number}.advert"
name="${sbaz.lib.name}"
version="${version.number}"
desc="The Scala library. This is the minimal requirement to run any Scala program."
link="${sbaz.universe}/${sbaz.lib.name}-${version.number}.sbp"
>
<libset dir="${build.jar.dir}" includes="${lib.jar.name},${lib-dbc.jar.name}"/>
</starrsbaz>
<!-- Create the Scala developper package -->
<starrsbaz
file="${dist.sbaz.dir}/${sbaz.dev.name}-${version.number}.sbp"
adfile="${dist.sbaz.dir}/${sbaz.dev.name}-${version.number}.advert"
name="${sbaz.dev.name}"
version="${version.number}"
desc="The Scala developper tools. This contains everything that is required to write, test and document new Scala programs, as well as all developper documentation."
depends="${sbaz.lib.name}"
link="${sbaz.universe}/${sbaz.dev.name}-${version.number}.sbp"
>
<binset dir="${build.bin.dir}" includes="**"/>
<libset dir="${build.jar.dir}" includes="${comp.jar.name}"/>
<manset dir="${tooldocs.dir}" includes="man1/*.1"/>
<docset dir="${docs.dir}" includes="README,LICENSE"/>
<docset dir="${api.lib.pdir}" includes="api/**"/>
<docset dir="${tooldocs.dir}" includes="*.html"/>
</starrsbaz>
<!-- Creates the empty umbrella Scala package -->
<starrsbaz
file="${dist.sbaz.dir}/${sbaz.scala.name}-${version.number}.sbp"
adfile="${dist.sbaz.dir}/${sbaz.scala.name}-${version.number}.advert"
name="${sbaz.scala.name}"
version="${version.number}"
desc="The base Scala package that contains everything needed to start using Scala."
depends="${sbaz.lib.name},${sbaz.dev.name}"
link="${sbaz.universe}/${sbaz.scala.name}-${version.number}.sbp"
/>
<!-- Creates the Scala test package -->
<starrsbaz
file="${dist.sbaz.dir}/${sbaz.test.name}-${version.number}.sbp"
adfile="${dist.sbaz.dir}/${sbaz.test.name}-${version.number}.advert"
name="${sbaz.test.name}"
version="${version.number}"
desc="The Scala test package contains everything needed to test Scala."
link="${sbaz.universe}/${sbaz.test.name}-${version.number}.sbp"
>
<binset
dir="${topdir}/test"
includes="scalatest"
/>
<miscset
dir="${topdir}/test"
includes="files/**/*.check,files/**/*.java,files/**/*.scala,files/**/*.args,files/cli/**/*.check.*"
/>
</starrsbaz>
</target>
<target name="install" depends="dist">
<exec executable="sbaz">
<arg line="-v install -f ${dist.sbaz.dir}/${sbaz.lib.name}-${version.number}.sbp"/>
</exec>
<exec executable="sbaz">
<arg line="-v install -f ${dist.sbaz.dir}/${sbaz.dev.name}-${version.number}.sbp"/>
</exec>
<exec executable="sbaz">
<arg line="-v install -f ${dist.sbaz.dir}/${sbaz.test.name}-${version.number}.sbp"/>
</exec>
<exec executable="sbaz">
<arg line="-v install -f ${dist.sbaz.dir}/${sbaz.scala.name}-${version.number}.sbp"/>
</exec>
</target>
<target name="clean">
<delete
dir="${build.dir}"
includeemptydirs="yes"
quiet="yes"
failonerror="no"
/>
</target>
</project>
|