-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
79 lines (69 loc) · 2.7 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
<project name="SmartRunner" default="run-spec" basedir=".">
<property name="src.java.dir" value="${basedir}/src/java" />
<property name="src.web.dir" value="${basedir}/src/web" />
<property name="build.dir" value="${basedir}/build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="manifest" value="${build.dir}/MANIFEST.MF" />
<property name="phantomjs.dir" value="${basedir}/phantomjs" />
<property name="runner_jar" location="${build.dir}/${ant.project.name}.jar" />
<path id="rhino_jar">
<pathelement location="${basedir}/lib/js_rhino_1_7R3.jar" />
</path>
<target name="clean">
<echo>===============================</echo>
<echo>${ant.project.name}: clean </echo>
<echo>===============================</echo>
<delete dir="${build.dir}" />
</target>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
</target>
<target name="complie" depends="init">
<echo>===============================</echo>
<echo>${ant.project.name}: compile </echo>
<echo>===============================</echo>
<javac destdir="${classes.dir}" includeantruntime="false" debug="on" encoding="UTF-8">
<src path="${src.java.dir}" />
<classpath refid="rhino_jar" />
</javac>
<copy todir="${classes.dir}">
<fileset dir="${src.java.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="jar" depends="complie">
<echo>===============================</echo>
<echo>${ant.project.name}: jar </echo>
<echo>===============================</echo>
<echo file="${manifest}">Main-Class: smart.SpecRunner
Class-Path: ../lib/js_rhino_1_7R3.jar</echo>
<jar destfile="${build.dir}/${ant.project.name}.jar" manifest="${manifest}" duplicate="preserve">
<fileset dir="${classes.dir}" />
</jar>
</target>
<target name="run-spec" depends="jar">
<echo>===============================</echo>
<echo>${ant.project.name}: run-spec </echo>
<echo>===============================</echo>
<java fork="true" jar="${runner_jar}" failonerror="true">
<arg value="js/Song.js" />
<arg value="js/Player.js" />
<arg value="spec/SpecHelper.js" />
<arg value="spec/PlayerSpec.js" />
<jvmarg value="-Dfile.encoding=utf-8" />
<jvmarg value="-Xmx512m" />
</java>
<echo message="" />
</target>
<target name="run-with-phantomjs">
<echo>==========================================</echo>
<echo>${ant.project.name}: run-with-phantomjs </echo>
<echo>==========================================</echo>
<exec executable="cmd" failonerror="true" dir="${src.web.dir}">
<arg line="/c ${phantomjs.dir}/phantomjs.exe ${phantomjs.dir}/run-jasmine.js SpecRunner.html" />
</exec>
<echo message="" />
</target>
</project>