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