blob: 8b27117b711f8d744fc8ba84e1332ba0fc69bb04 [file] [log] [blame]
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00001<?xml version="1.0" encoding="UTF-8"?>
Stephan Herrmann8f4b3212010-05-22 16:38:56 +00002
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00003 <!--
4 Copyright (c) 2007, 2009 IBM Corporation and others.
5 All rights reserved. This program and the accompanying materials
6 are made available under the terms of the Eclipse Public License v1.0
7 which accompanies this distribution, and is available at
8 http://www.eclipse.org/legal/epl-v10.html
9
10 Contributors:
11 IBM Corporation - initial API and implementation
12 Technical University Berlin - extended API and implementation
13 -->
14
15<!-- build script to create a batch compiler from org.eclipse.jdt.core -->
16<project name="Eclipse Batch Compiler" default="export-all" basedir="..">
17 <target name="init">
18 <tstamp/>
19 <property name="ecj-temp-folder" value="${basedir}/ecj-temp-folder" />
20 <property name="ecj-temp-src-folder" value="${basedir}/ecj-temp-src-folder" />
21 <mkdir dir="${ecj-temp-src-folder}" />
22 <mkdir dir="${ecj-temp-folder}"/>
23 </target>
24
25 <target name="extract-batch-compiler" depends="init">
26 <property name="target.folder" value="${basedir}/bin"/>
27 <echo message="Extract .class file and properties for the batch compiler" />
28 <copy todir="${ecj-temp-folder}">
29 <fileset dir="${target.folder}">
30 <include name="org/eclipse/jdt/internal/compiler/**"/>
31 <include name="org/eclipse/jdt/core/compiler/**"/>
32<!--{ObjectTeams:-->
Stephan Herrmannd196f5b2010-04-02 02:52:04 +000033 <include name="org/eclipse/objectteams/otdt/core/compiler/**"/>
34 <include name="org/eclipse/objectteams/otdt/internal/core/compiler/**"/>
35 <include name="org/eclipse/objectteams/otdt/core/exceptions/**"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000036 <include name="org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class"/>
37<!-- SH} -->
38 <exclude name="**/package.htm*"/>
39 <exclude name="org/eclipse/jdt/core/compiler/CompilationParticipant*.class"/>
40 <exclude name="org/eclipse/jdt/core/compiler/BuildContext.class"/>
41 <exclude name="org/eclipse/jdt/core/compiler/IScanner.class"/>
42 <exclude name="org/eclipse/jdt/core/compiler/ITerminalSymbols*.class"/>
43 <exclude name="org/eclipse/jdt/core/compiler/ReconcileContext*.class"/>
44 <exclude name="org/eclipse/jdt/internal/compiler/DocumentElementParser*.class"/>
45 <exclude name="org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class"/>
46 <exclude name="org/eclipse/jdt/internal/compiler/ISourceElementRequestor*.class"/>
47 <exclude name="org/eclipse/jdt/internal/compiler/SourceElementParser*.class"/>
48 <exclude name="org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter*.class"/>
49 <exclude name="org/eclipse/jdt/internal/compiler/SourceJavadocParser*.class"/>
50 <exclude name="org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter*.class"/>
51 </fileset>
52 </copy>
53 </target>
54
55 <target name="extract-_jsr199" depends="init">
56 <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.tool/bin"/>
57 <echo message="Extract .class file and properties for the jsr199" />
58 <copy todir="${ecj-temp-folder}" failonerror="false">
59 <fileset dir="${target.folder}"/>
60 </copy>
61 </target>
62
63 <target name="extract-_jsr269" depends="init">
64 <property name="jsr_project" value="org.eclipse.jdt.compiler.apt"/>
65 <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.apt/bin"/>
66 <echo message="Extract .class file and properties for the jsr269" />
67 <copy todir="${ecj-temp-folder}" failonerror="false">
68 <fileset dir="${target.folder}"/>
69 </copy>
70 </target>
71
72 <target name="extract-ant-adapter-compiler" depends="init">
73 <property name="target.folder" value="${basedir}/antbin"/>
74 <echo message="Extract .class file and properties for the ant adapter" />
75 <mkdir dir="${ecj-temp-folder}"/>
76 <copy todir="${ecj-temp-folder}">
77 <fileset dir="${target.folder}">
78 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes*.*"/>
79 </fileset>
80 </copy>
81 </target>
82
83 <target name="export" depends="init">
84 <property name="buildLabel" value="head" />
85 <property name="dest" value="../../ecj-export" />
86 <mkdir dir="${dest}" />
87<!-- {ObjectTeams: changed name from ecj to ecotj. SH} -->
88 <echo message="UPDATE ecotj-${buildLabel}.jar" />
89 <delete file="${dest}/ecotj-${buildLabel}.jar" failonerror="false"/>
90 <copy todir="${ecj-temp-folder}">
91 <fileset dir="scripts/binary" />
92 </copy>
93 <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
94 <zip zipfile="${dest}/ecotj-${buildLabel}.jar">
95 <fileset dir="${ecj-temp-folder}">
96 <include name="**/*"/>
97 </fileset>
98 <fileset dir="scripts">
99 <include name="about.html" />
100 </fileset>
101 </zip>
102
103
104 <echo message="UPDATE ecotjsrc-${buildLabel}.zip" />
105 <delete file="${dest}/ecotjsrc-${buildLabel}.zip" failonerror="false"/>
106 <copy todir="${ecj-temp-src-folder}">
107 <fileset dir="scripts/source" />
108 </copy>
109 <replace file="${ecj-temp-src-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
110 <zip zipfile="${dest}/ecotjsrc-${buildLabel}.zip">
111 <zipfileset dir="ecj-temp-src-folder" />
112 <zipfileset dir="batch" />
113 <zipfileset dir="compiler" />
114<!-- {ObjectTeams: -->
115 <zipfileset dir="util">
116 <exclude name="org/objectteams/otdt/core/util/**"/>
117 </zipfileset>
118<!-- SH} -->
119 <zipfileset dir="antadapter">
120 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
121 </zipfileset>
122 <zipfileset dir="scripts">
123 <include name="about.html" />
124 <include name="build.xml" />
125 </zipfileset>
126 </zip>
127 <antcall target="cleanup"/>
128 </target>
129
130 <target name="export_src_bin">
131 <property name="buildLabel" value="head" />
132 <property name="dest" value="../../ecj-export" />
133 <mkdir dir="${dest}" />
134 <echo message="UPDATE ecj_all.jar" />
135 <delete file="${dest}/ecj_all.jar" failonerror="false"/>
136 <mkdir dir="${ecj-temp-src-folder}/src" />
137 <copy todir="${ecj-temp-folder}">
138 <fileset dir="scripts/binary" />
139 </copy>
140 <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
141
142 <copy todir="${ecj-temp-src-folder}/src">
143 <fileset dir="batch" />
144 <fileset dir="compiler" />
145 <fileset dir="antadapter">
146 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
147 </fileset>
148 </copy>
149
150 <zip zipfile="${dest}/ecj_all.jar">
151 <fileset dir="${ecj-temp-folder}">
152 <include name="**/*"/>
153 <include name="about.html"/>
154 </fileset>
155 <fileset dir="${ecj-temp-src-folder}">
156 <exclude name="META-INF/**"/>
157 </fileset>
158 <fileset dir="scripts">
159 <include name="about.html" />
160 </fileset>
161 </zip>
162
163 <delete dir="${ecj-temp-src-folder}" failonerror="false"/>
164 </target>
165
166 <target name="cleanup">
167 <delete dir="${ecj-temp-folder}" failonerror="false"/>
168 <delete dir="${ecj-temp-src-folder}" failonerror="false"/>
169 </target>
170
171 <target name="export-all" depends="init">
172 <antcall target="extract-batch-compiler"/>
173 <antcall target="extract-ant-adapter-compiler"/>
174 <antcall target="extract-_jsr199"/>
175 <antcall target="extract-_jsr269"/>
176 <antcall target="export_src_bin"/>
177 <antcall target="export"/>
178 <antcall target="cleanup"/>
179 </target>
180</project>