blob: b350e7fe98a6cf4af61ee08ddd1018435b9b8132 [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 Herrmann4a05b5f2012-05-17 21:11:23 +02003<!--
Stephan Herrmannbc9c6682014-05-15 22:48:38 +02004 Copyright (c) 2007, 2014 IBM Corporation and others.
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00005 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/>
Stephan Herrmann2c5bf482013-06-25 16:20:32 +020019 <property name="bundleVersion" value="3.10.0.qualifier"/>
Stephan Herrmannb046a492012-08-10 16:50:55 +020020 <fail unless="bundleVersion" message="Property 'bundleVersion' must be provided by caller"/>
21 <condition property="bundleVersionOK">
Stephan Herrmann2c5bf482013-06-25 16:20:32 +020022 <matches pattern="\d+\.\d+\.\d+.*" string="${bundleVersion}"/>
Stephan Herrmannb046a492012-08-10 16:50:55 +020023 </condition>
Stephan Herrmann6a72b272013-07-14 17:29:27 +020024 <fail message="bundleVersion variable had unexpected format. Should be digits.digits.digits,ANY but was ${bundleVersion}" unless="bundleVersionOK"/>
Stephan Herrmannb046a492012-08-10 16:50:55 +020025 <script language="javascript">
26 var bundleVersion = project.getProperty("bundleVersion");
27 var pattern = new RegExp(/^(\d+)\.(\d+)\.(\d+)\.(.*)$/);
28 var sArray = pattern.exec(bundleVersion); // sArray 0 is "whole match"
29 project.setProperty("bundleVersionMajor", sArray[1]);
30 project.setProperty("bundleVersionMinor", sArray[2]);
31 project.setProperty("bundleVersionService", sArray[3]);
32 project.setProperty("bundleVersionQualifer", sArray[4])
33 </script>
Stephan Herrmannbc9c6682014-05-15 22:48:38 +020034<!--{ObjectTeams: debug: -->
Stephan Herrmann5775ef02012-09-23 19:23:31 +020035 <echo message="bundleVersion: ${bundleVersion}"/>
36 <echo message="bundleVersionMajor: ${bundleVersionMajor}"/>
37 <echo message="bundleVersionMinor: ${bundleVersionMinor}"/>
38 <echo message="bundleVersionService: ${bundleVersionService}"/>
39 <echo message="bundleVersionQualifier: ${bundleVersionQualifer}"/>
Stephan Herrmannbc9c6682014-05-15 22:48:38 +020040<!-- SH} -->
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000041 <property name="ecj-temp-folder" value="${basedir}/ecj-temp-folder" />
42 <property name="ecj-temp-src-folder" value="${basedir}/ecj-temp-src-folder" />
43 <mkdir dir="${ecj-temp-src-folder}" />
44 <mkdir dir="${ecj-temp-folder}"/>
45 </target>
46
47 <target name="extract-batch-compiler" depends="init">
48 <property name="target.folder" value="${basedir}/bin"/>
Stephan Herrmann918c05c2012-12-16 20:09:49 +010049 <replace file="${target.folder}/org/eclipse/jdt/internal/compiler/batch/messages.properties" token="bundle_qualifier" value="${bundleVersionQualifer}"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000050 <echo message="Extract .class file and properties for the batch compiler" />
51 <copy todir="${ecj-temp-folder}">
52 <fileset dir="${target.folder}">
53 <include name="org/eclipse/jdt/internal/compiler/**"/>
54 <include name="org/eclipse/jdt/core/compiler/**"/>
55<!--{ObjectTeams:-->
Stephan Herrmannd196f5b2010-04-02 02:52:04 +000056 <include name="org/eclipse/objectteams/otdt/core/compiler/**"/>
57 <include name="org/eclipse/objectteams/otdt/internal/core/compiler/**"/>
58 <include name="org/eclipse/objectteams/otdt/core/exceptions/**"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000059 <include name="org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class"/>
60<!-- SH} -->
61 <exclude name="**/package.htm*"/>
62 <exclude name="org/eclipse/jdt/core/compiler/CompilationParticipant*.class"/>
63 <exclude name="org/eclipse/jdt/core/compiler/BuildContext.class"/>
64 <exclude name="org/eclipse/jdt/core/compiler/IScanner.class"/>
65 <exclude name="org/eclipse/jdt/core/compiler/ITerminalSymbols*.class"/>
66 <exclude name="org/eclipse/jdt/core/compiler/ReconcileContext*.class"/>
67 <exclude name="org/eclipse/jdt/internal/compiler/DocumentElementParser*.class"/>
68 <exclude name="org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class"/>
69 <exclude name="org/eclipse/jdt/internal/compiler/ISourceElementRequestor*.class"/>
70 <exclude name="org/eclipse/jdt/internal/compiler/SourceElementParser*.class"/>
71 <exclude name="org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter*.class"/>
72 <exclude name="org/eclipse/jdt/internal/compiler/SourceJavadocParser*.class"/>
73 <exclude name="org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter*.class"/>
74 </fileset>
75 </copy>
76 </target>
77
78 <target name="extract-_jsr199" depends="init">
79 <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.tool/bin"/>
80 <echo message="Extract .class file and properties for the jsr199" />
81 <copy todir="${ecj-temp-folder}" failonerror="false">
82 <fileset dir="${target.folder}"/>
83 </copy>
84 </target>
85
86 <target name="extract-_jsr269" depends="init">
87 <property name="jsr_project" value="org.eclipse.jdt.compiler.apt"/>
88 <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.apt/bin"/>
89 <echo message="Extract .class file and properties for the jsr269" />
90 <copy todir="${ecj-temp-folder}" failonerror="false">
91 <fileset dir="${target.folder}"/>
92 </copy>
93 </target>
94
95 <target name="extract-ant-adapter-compiler" depends="init">
96 <property name="target.folder" value="${basedir}/antbin"/>
97 <echo message="Extract .class file and properties for the ant adapter" />
98 <mkdir dir="${ecj-temp-folder}"/>
99 <copy todir="${ecj-temp-folder}">
100 <fileset dir="${target.folder}">
101 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes*.*"/>
Stephan Herrmann4a05b5f2012-05-17 21:11:23 +0200102 <exclude name="org/eclipse/jdt/core/BuildJarIndex*.*"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000103 </fileset>
104 </copy>
105 </target>
106
107 <target name="export" depends="init">
108 <property name="buildLabel" value="head" />
109 <property name="dest" value="../../ecj-export" />
110 <mkdir dir="${dest}" />
111<!-- {ObjectTeams: changed name from ecj to ecotj. SH} -->
112 <echo message="UPDATE ecotj-${buildLabel}.jar" />
113 <delete file="${dest}/ecotj-${buildLabel}.jar" failonerror="false"/>
114 <copy todir="${ecj-temp-folder}">
115 <fileset dir="scripts/binary" />
Stephan Herrmannbc9c6682014-05-15 22:48:38 +0200116 <fileset dir="scripts" includes="ecj.1"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000117 </copy>
118 <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
119 <zip zipfile="${dest}/ecotj-${buildLabel}.jar">
120 <fileset dir="${ecj-temp-folder}">
121 <include name="**/*"/>
122 </fileset>
123 <fileset dir="scripts">
124 <include name="about.html" />
125 </fileset>
126 </zip>
127
Stephan Herrmann016c4262010-10-20 22:02:18 +0000128 <echo message="UPDATE ecotjsrc-${buildLabel}.jar" />
129 <delete file="${dest}/ecotjsrc-${buildLabel}.jar" failonerror="false"/>
Stephan Herrmannbc9c6682014-05-15 22:48:38 +0200130<!-- SH} -->
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000131 <copy todir="${ecj-temp-src-folder}">
132 <fileset dir="scripts/source" />
133 </copy>
Stephan Herrmann1a8ea8f2012-09-18 15:10:52 +0200134 <copy todir="${ecj-temp-src-folder}/scripts/binary">
135 <fileset dir="scripts/binary" />
136 </copy>
Stephan Herrmannb046a492012-08-10 16:50:55 +0200137 <replace file="${ecj-temp-src-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/>
Stephan Herrmann1a8ea8f2012-09-18 15:10:52 +0200138 <replace file="${ecj-temp-src-folder}/scripts/binary/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/>
Stephan Herrmannb046a492012-08-10 16:50:55 +0200139 <zip zipfile="${dest}/ecjsrc-${buildLabel}.jar">
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000140 <zipfileset dir="ecj-temp-src-folder" />
Stephan Herrmannb046a492012-08-10 16:50:55 +0200141 <zipfileset dir="batch">
142 <exclude name="org/eclipse/jdt/internal/compiler/batch/messages.properties"/>
143 </zipfileset>
144 <fileset dir="${ecj-temp-folder}">
Stephan Herrmann1a8ea8f2012-09-18 15:10:52 +0200145 <include name="**/messages.properties"/>
Stephan Herrmannbc9c6682014-05-15 22:48:38 +0200146 <include name="ecj.1"/>
Stephan Herrmannb046a492012-08-10 16:50:55 +0200147 </fileset>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000148 <zipfileset dir="compiler" />
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000149 <zipfileset dir="antadapter">
150 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
Stephan Herrmann4a05b5f2012-05-17 21:11:23 +0200151 <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000152 </zipfileset>
153 <zipfileset dir="scripts">
154 <include name="about.html" />
155 <include name="build.xml" />
156 </zipfileset>
157 </zip>
158 <antcall target="cleanup"/>
159 </target>
160
161 <target name="export_src_bin">
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000162 <property name="dest" value="../../ecj-export" />
163 <mkdir dir="${dest}" />
164 <echo message="UPDATE ecj_all.jar" />
165 <delete file="${dest}/ecj_all.jar" failonerror="false"/>
166 <mkdir dir="${ecj-temp-src-folder}/src" />
167 <copy todir="${ecj-temp-folder}">
Stephan Herrmannbc9c6682014-05-15 22:48:38 +0200168 <fileset dir="scripts" includes="ecj.1"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000169 <fileset dir="scripts/binary" />
170 </copy>
Stephan Herrmannb046a492012-08-10 16:50:55 +0200171 <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000172
173 <copy todir="${ecj-temp-src-folder}/src">
174 <fileset dir="batch" />
175 <fileset dir="compiler" />
176 <fileset dir="antadapter">
177 <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
Stephan Herrmann4a05b5f2012-05-17 21:11:23 +0200178 <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/>
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000179 </fileset>
180 </copy>
181
Stephan Herrmannb046a492012-08-10 16:50:55 +0200182 <zip zipfile="${dest}/ecj-${buildLabel}.jar">
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000183 <fileset dir="${ecj-temp-folder}">
184 <include name="**/*"/>
185 <include name="about.html"/>
186 </fileset>
187 <fileset dir="${ecj-temp-src-folder}">
188 <exclude name="META-INF/**"/>
189 </fileset>
190 <fileset dir="scripts">
191 <include name="about.html" />
192 </fileset>
193 </zip>
194
195 <delete dir="${ecj-temp-src-folder}" failonerror="false"/>
196 </target>
197
198 <target name="cleanup">
199 <delete dir="${ecj-temp-folder}" failonerror="false"/>
200 <delete dir="${ecj-temp-src-folder}" failonerror="false"/>
201 </target>
202
203 <target name="export-all" depends="init">
204 <antcall target="extract-batch-compiler"/>
205 <antcall target="extract-ant-adapter-compiler"/>
206 <antcall target="extract-_jsr199"/>
207 <antcall target="extract-_jsr269"/>
208 <antcall target="export_src_bin"/>
209 <antcall target="export"/>
210 <antcall target="cleanup"/>
211 </target>
212</project>