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 | |
10 <!-- | |
11 The file build.properties does not exist. If provided, properties can be cus
tomized. | |
12 --> | |
13 <property file="build.properties" /> | |
14 | |
15 <!-- | |
16 Configuration properties. | |
17 --> | |
18 <property name="build.dir" value="out"/> | |
19 | |
20 <property name="build.classes.dir" value="${build.dir}/classes"/> | |
21 | |
22 <property name="build.test.classes.dir" value="${build.dir}/test/classes"/> | |
23 | |
24 <property name="dart_analyzer.jar" value="${build.dir}/dart_analyzer.jar"/> | |
25 | |
26 <property name="dist.dir" value="${build.dir}/dist"/> | |
27 | |
28 <property name="test.report.dir" value="${build.dir}/test"/> | |
29 | |
30 <property name="third_party.dir" value="../third_party"/> | |
31 | |
32 <property name="test_py" location="../tools/test.py"/> | |
33 | |
34 <!-- | |
35 Define buildtime and runtime classpaths. | |
36 --> | |
37 <path id="classpath.compile"> | |
38 <pathelement location="${third_party.dir}/args4j/2.0.12/args4j-2.0.12.jar"/> | |
39 <pathelement location="${third_party.dir}/guava/r13/guava-13.0.1.jar"/> | |
40 <pathelement location="${third_party.dir}/json/r2_20080312/json.jar"/> | |
41 </path> | |
42 | |
43 <path id="classpath.runtime"> | |
44 <path refid="classpath.compile"/> | |
45 </path> | |
46 | |
47 <path id="classpath.compile.tests"> | |
48 <path refid="classpath.compile"/> | |
49 <pathelement location="${build.classes.dir}"/> | |
50 <pathelement location="${third_party.dir}/junit/v4_8_2/junit.jar"/> | |
51 </path> | |
52 | |
53 <path id="classpath.run.tests"> | |
54 <path refid="classpath.compile.tests"/> | |
55 <pathelement location="${build.test.classes.dir}"/> | |
56 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-core-1.3.0R
C2.jar"/> | |
57 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-generator-1
.3.0RC2.jar"/> | |
58 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-integration
-1.3.0RC2.jar"/> | |
59 <pathelement location="${third_party.dir}/hamcrest/v1_3/hamcrest-library-1.3
.0RC2.jar"/> | |
60 <pathelement location="${third_party.dir}/fest/fest-util-1.1.6.jar"/> | |
61 <pathelement location="${third_party.dir}/fest/fest-assert-1.4.jar"/> | |
62 </path> | |
63 | |
64 <target name="compile" description="Compiles all of the java source and copies
resources to the classes directory."> | |
65 <!-- | |
66 Ensure the necessary subdirectories exist. | |
67 --> | |
68 <mkdir dir="${build.classes.dir}"/> | |
69 | |
70 <javac destdir="${build.classes.dir}" | |
71 sourcepath="" | |
72 srcdir="java" | |
73 includes="${java_sources}" | |
74 fork="true" | |
75 debug="true" | |
76 source="1.6" | |
77 target="1.6" | |
78 includeAntRuntime="false"> | |
79 <classpath refid="classpath.compile"/> | |
80 </javac> | |
81 <!-- | |
82 Copy all non-java resources. | |
83 --> | |
84 <copy todir="${build.classes.dir}"> | |
85 <filelist refid="java_resources"/> | |
86 </copy> | |
87 </target> | |
88 | |
89 <!-- | |
90 We rely on GYP to call these targets when dependencies change, hence this | |
91 ant file cannot be used standalone. | |
92 --> | |
93 <target name="compile-tests" depends="compile" description="Compiles all of th
e java tests and copies the resources to the test classes directory." > | |
94 <mkdir dir="${build.test.classes.dir}"/> | |
95 <javac destdir="${build.test.classes.dir}" | |
96 sourcepath="" | |
97 srcdir="javatests" | |
98 includes="${javatests_sources}" | |
99 excludes="com/google/dart/compiler/vm/**" | |
100 fork="true" | |
101 debug="true" | |
102 source="1.6" | |
103 target="1.6" | |
104 includeAntRuntime="false"> | |
105 <classpath refid="classpath.compile.tests"/> | |
106 </javac> | |
107 <!-- | |
108 Copy the non-java resources. | |
109 --> | |
110 <copy todir="${build.test.classes.dir}"> | |
111 <filelist refid="javatests_resources"/> | |
112 </copy> | |
113 </target> | |
114 | |
115 <target name="dart_analyzer.jar" depends="compile" description="Creates a jar
without bundling the dependencies."> | |
116 <jar destfile="${dart_analyzer.jar}" basedir="${build.classes.dir}" | |
117 manifest="dart_analyzer.mf"/> | |
118 </target> | |
119 | |
120 <target name="dist" depends="dart_analyzer.jar" | |
121 description="Create a directory with a standalone distribution."> | |
122 <!-- | |
123 Ensure the necessary subdirectories exist. | |
124 --> | |
125 <mkdir dir="${dist.dir}/bin"/> | |
126 <mkdir dir="${dist.dir}/util"/> | |
127 <mkdir dir="${dist.dir}/util/analyzer"/> | |
128 | |
129 <!-- | |
130 Copy the dart jar to the lib folder. | |
131 --> | |
132 <copy file="${dart_analyzer.jar}" todir="${dist.dir}/util/analyzer"/> | |
133 | |
134 <!-- | |
135 Re-root the classpaths from third_party into the util folder of the distro
. | |
136 --> | |
137 <pathconvert property="analyzer.classpath.runtime.unix" targetos="unix" refi
d="classpath.runtime"> | |
138 <regexpmapper from="${third_party.dir}/(.*)" to="$DART_ANALYZER_LIBS/\1"/> | |
139 </pathconvert> | |
140 | |
141 <pathconvert property="analyzer.classpath.runtime.win" targetos="windows" re
fid="classpath.runtime"> | |
142 <regexpmapper from="(.*)third_party\\(.*)" to="%DART_ANALYZER_LIBS%\\\2"/> | |
143 </pathconvert> | |
144 | |
145 <copy file="scripts/dart_analyzer.sh" tofile="${dist.dir}/bin/dart_analyzer"
> | |
146 <filterset> | |
147 <filter token="CLASSPATH" value="$DART_ANALYZER_LIBS/dart_analyzer.jar:$
{analyzer.classpath.runtime.unix}"/> | |
148 </filterset> | |
149 </copy> | |
150 <chmod file="${dist.dir}/bin/dart_analyzer" perm="a+rx"/> | |
151 | |
152 <copy file="scripts/dart_analyzer.bat" tofile="${dist.dir}/bin/dart_analyzer
.bat"> | |
153 <filterset> | |
154 <filter | |
155 token="CLASSPATH" | |
156 value="%DART_ANALYZER_LIBS%\dart_analyzer.jar;${analyzer.classpath.run
time.win}"/> | |
157 </filterset> | |
158 </copy> | |
159 | |
160 <!-- | |
161 TODO: The following files are not strictly due to dist, move them out. | |
162 --> | |
163 <copy todir="${build.dir}"> | |
164 <fileset dir="scripts"> | |
165 <include name="analyzer_metrics.sh"/> | |
166 </fileset> | |
167 <filterset> | |
168 <filter token="CLASSPATH" value="$DART_ANALYZER_LIBS/dart_analyzer.jar:$
{analyzer.classpath.runtime.unix}"/> | |
169 </filterset> | |
170 </copy> | |
171 <chmod file="${build.dir}/analyzer_metrics.sh" perm="a+rx"/> | |
172 | |
173 <!-- | |
174 Copy of all dependencies to the util folder. | |
175 --> | |
176 <copy todir="${dist.dir}/util/analyzer"> | |
177 <path refid="classpath.runtime"/> | |
178 <regexpmapper from="(.*)third_party[/\\](.*)" to="\2"/> | |
179 </copy> | |
180 </target> | |
181 | |
182 <target name="clean" description="Deletes the build output directory."> | |
183 <delete dir="${build.dir}"/> | |
184 <delete dir="${dist.dir}"/> | |
185 </target> | |
186 | |
187 <target name="tests.jar" depends="compile-tests"> | |
188 <jar destfile="${build.dir}/tests.jar" basedir="${build.test.classes.dir}"/> | |
189 </target> | |
190 </project> | |
OLD | NEW |