OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
3 for details. All rights reserved. Use of this source code is governed by a | |
4 BSD-style license that can be found in the LICENSE file. | |
5 --> | |
6 <project default="dist"> | |
7 <import file="sources.xml"/> | |
8 <import file="test_sources.xml"/> | |
9 <import file="corelib_sources.xml"/> | |
10 <import file="compiler_corelib_sources.xml"/> | |
11 <import file="domlib_sources.xml"/> | |
12 <import file="htmllib_sources.xml"/> | |
13 <import file="jsonlib_sources.xml"/> | |
14 <import file="isolatelib_sources.xml"/> | |
15 | |
16 <!-- | |
17 The file build.properties does not exist. If provided, properties can be cus
tomized. | |
18 --> | |
19 <property file="build.properties" /> | |
20 | |
21 <!-- | |
22 Configuration properties. | |
23 --> | |
24 <property name="build.dir" value="out"/> | |
25 | |
26 <property name="build.classes.dir" value="${build.dir}/classes"/> | |
27 | |
28 <property name="build.test.classes.dir" value="${build.dir}/test/classes"/> | |
29 | |
30 <property name="dartc.jar" value="${build.dir}/dartc.jar"/> | |
31 | |
32 <property name="dist.dir" value="${build.dir}/dist"/> | |
33 | |
34 <property name="test.report.dir" value="${build.dir}/test"/> | |
35 | |
36 <property name="third_party.dir" value="../third_party"/> | |
37 | |
38 <property name="test_py" location="../tools/test.py"/> | |
39 | |
40 <!-- | |
41 Define buildtime and runtime classpaths. | |
42 --> | |
43 <path id="classpath.compile"> | |
44 <pathelement location="${third_party.dir}/args4j/2.0.12/args4j-2.0.12.jar"/> | |
45 <pathelement location="${third_party.dir}/guava/r09/guava-r09.jar"/> | |
46 <pathelement location="${third_party.dir}/json/r2_20080312/json.jar"/> | |
47 </path> | |
48 | |
49 <path id="classpath.runtime"> | |
50 <path refid="classpath.compile"/> | |
51 </path> | |
52 | |
53 <path id="classpath.compile.tests"> | |
54 <path refid="classpath.compile"/> | |
55 <pathelement location="${build.classes.dir}"/> | |
56 <pathelement location="${third_party.dir}/junit/v4_8_2/junit.jar"/> | |
57 </path> | |
58 | |
59 <path id="classpath.run.tests"> | |
60 <path refid="classpath.compile.tests"/> | |
61 <pathelement location="${build.test.classes.dir}"/> | |
62 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-core-1.3.0R
C2.jar"/> | |
63 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-generator-1
.3.0RC2.jar"/> | |
64 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-integration
-1.3.0RC2.jar"/> | |
65 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-library-1.3
.0RC2.jar"/> | |
66 </path> | |
67 | |
68 <target name="compile" description="Compiles all of the java source and copies
resources to the classes directory."> | |
69 <!-- | |
70 Ensure the necessary subdirectories exist. | |
71 --> | |
72 <mkdir dir="${build.classes.dir}"/> | |
73 | |
74 <javac destdir="${build.classes.dir}" | |
75 sourcepath="" | |
76 srcdir="java" | |
77 includes="${java_sources}" | |
78 fork="true" | |
79 debug="true"> | |
80 <classpath refid="classpath.compile"/> | |
81 </javac> | |
82 <!-- | |
83 Copy all non-java resources. | |
84 --> | |
85 <copy todir="${build.classes.dir}"> | |
86 <filelist refid="java_resources"/> | |
87 </copy> | |
88 </target> | |
89 | |
90 <!-- | |
91 We rely on GYP to call these targets when the dartc dependencies change, hen
ce this | |
92 ant file cannot be used standalone. | |
93 --> | |
94 <target name="compile-tests" depends="compile" description="Compiles all of th
e java tests and copies the resources to the test classes directory." > | |
95 <mkdir dir="${build.test.classes.dir}"/> | |
96 <javac destdir="${build.test.classes.dir}" | |
97 sourcepath="" | |
98 srcdir="javatests" | |
99 includes="${javatests_sources}" | |
100 excludes="com/google/dart/compiler/vm/**" | |
101 fork="true" | |
102 debug="true"> | |
103 <classpath refid="classpath.compile.tests"/> | |
104 </javac> | |
105 <!-- | |
106 Copy the non-java resources. | |
107 --> | |
108 <copy todir="${build.test.classes.dir}"> | |
109 <filelist refid="javatests_resources"/> | |
110 </copy> | |
111 </target> | |
112 | |
113 <target name="dartc.jar" depends="compile" description="Creates a jar for dart
c without bundling the dependencies."> | |
114 <jar destfile="${dartc.jar}" basedir="${build.classes.dir}" manifest="dartc.
mf"/> | |
115 </target> | |
116 | |
117 <target name="dist" depends="dartc.jar" description="Creates a directory that
contains a standalone distribution for dartc."> | |
118 <!-- | |
119 Ensure the necessary subdirectories exist. | |
120 --> | |
121 <mkdir dir="${dist.dir}/bin"/> | |
122 <mkdir dir="${dist.dir}/lib"/> | |
123 | |
124 <!-- | |
125 Copy the dart jar to the lib folder. | |
126 --> | |
127 <copy file="${dartc.jar}" todir="${dist.dir}/lib"/> | |
128 | |
129 <!-- | |
130 Re-root the classpaths from third_party into the lib folder of the distro. | |
131 --> | |
132 <pathconvert property="dartc.classpath.runtime.unix" targetos="unix" refid="
classpath.runtime"> | |
133 <regexpmapper from="${third_party.dir}/(.*)" to="$DARTC_LIBS/\1"/> | |
134 </pathconvert> | |
135 | |
136 <copy file="scripts/dartc.sh" tofile="${dist.dir}/bin/dartc"> | |
137 <filterset> | |
138 <filter token="CLASSPATH" value="$DARTC_LIBS/dartc.jar:$DARTC_LIBS/corel
ib.jar:$DARTC_LIBS/domlib.jar:$DARTC_LIBS/htmllib.jar:$DARTC_LIBS/jsonlib.jar:$D
ARTC_LIBS/isolatelib.jar:${dartc.classpath.runtime.unix}"/> | |
139 </filterset> | |
140 </copy> | |
141 <chmod file="${dist.dir}/bin/dartc" perm="a+rx"/> | |
142 | |
143 <!-- | |
144 TODO: The following files are not strictly due to dist, move them out. | |
145 --> | |
146 <copy todir="${build.dir}"> | |
147 <fileset dir="scripts"> | |
148 <include name="dartc_run.sh"/> | |
149 <include name="dartc_metrics.sh"/> | |
150 </fileset> | |
151 <filterset> | |
152 <filter token="CLASSPATH" value="$DARTC_LIBS/dartc.jar:$DARTC_LIBS/corel
ib.jar:$DARTC_LIBS/domlib.jar:$DARTC_LIBS/htmllib.jar:$DARTC_LIBS/jsonlib.jar:$D
ARTC_LIBS/isolatelib.jar:${dartc.classpath.runtime.unix}"/> | |
153 </filterset> | |
154 </copy> | |
155 <chmod file="${build.dir}/dartc_run.sh" perm="a+rx"/> | |
156 <chmod file="${build.dir}/dartc_metrics.sh" perm="a+rx"/> | |
157 | |
158 <!-- | |
159 Copy of all of the dartc dependencies to the lib folder. | |
160 --> | |
161 <copy todir="${dist.dir}/lib"> | |
162 <path refid="classpath.runtime"/> | |
163 <regexpmapper from="${third_party.dir}/(.*)" to="\1"/> | |
164 </copy> | |
165 </target> | |
166 | |
167 <target name="clean" description="Deletes the build output directory."> | |
168 <delete dir="${build.dir}"/> | |
169 <delete dir="${dist.dir}"/> | |
170 </target> | |
171 | |
172 <target name="tests.jar" depends="compile-tests"> | |
173 <jar destfile="${build.dir}/tests.jar" basedir="${build.test.classes.dir}"/> | |
174 </target> | |
175 </project> | |
OLD | NEW |