Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Stephan Herrmann | 8f4b321 | 2010-05-22 16:38:56 +0000 | [diff] [blame] | 2 | |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 3 | <!-- |
Stephan Herrmann | 6ed41b1 | 2021-02-17 23:59:42 +0100 | [diff] [blame] | 4 | Copyright (c) 2007, 2020 IBM Corporation and others. |
Stephan Herrmann | aa0c80c | 2018-09-08 22:11:53 +0200 | [diff] [blame] | 5 | |
| 6 | This program and the accompanying materials |
| 7 | are made available under the terms of the Eclipse Public License 2.0 |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 8 | which accompanies this distribution, and is available at |
Stephan Herrmann | aa0c80c | 2018-09-08 22:11:53 +0200 | [diff] [blame] | 9 | https://www.eclipse.org/legal/epl-2.0/ |
| 10 | |
| 11 | SPDX-License-Identifier: EPL-2.0 |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 12 | |
| 13 | Contributors: |
| 14 | IBM Corporation - initial API and implementation |
| 15 | Technical University Berlin - extended API and implementation |
| 16 | --> |
| 17 | |
| 18 | <!-- build script to create a batch compiler from org.eclipse.jdt.core --> |
| 19 | <project name="Eclipse Batch Compiler" default="export-all" basedir=".."> |
| 20 | <target name="init"> |
| 21 | <tstamp/> |
Stephan Herrmann | 2c5bf48 | 2013-06-25 16:20:32 +0200 | [diff] [blame] | 22 | <property name="bundleVersion" value="3.10.0.qualifier"/> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 23 | <fail unless="bundleVersion" message="Property 'bundleVersion' must be provided by caller"/> |
| 24 | <condition property="bundleVersionOK"> |
Stephan Herrmann | 2c5bf48 | 2013-06-25 16:20:32 +0200 | [diff] [blame] | 25 | <matches pattern="\d+\.\d+\.\d+.*" string="${bundleVersion}"/> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 26 | </condition> |
Stephan Herrmann | 6a72b27 | 2013-07-14 17:29:27 +0200 | [diff] [blame] | 27 | <fail message="bundleVersion variable had unexpected format. Should be digits.digits.digits,ANY but was ${bundleVersion}" unless="bundleVersionOK"/> |
Stephan Herrmann | 6ed41b1 | 2021-02-17 23:59:42 +0100 | [diff] [blame] | 28 | <loadresource property="bundleVersionMajor"> |
| 29 | <string value="${bundleVersion}"/> |
| 30 | <filterchain> |
| 31 | <tokenfilter> |
| 32 | <replaceregex pattern="^(\d+)\.(\d+)\.(\d+)\.(.*)$" replace="\1"/> |
| 33 | </tokenfilter> |
| 34 | </filterchain> |
| 35 | </loadresource> |
| 36 | <loadresource property="bundleVersionMinor"> |
| 37 | <string value="${bundleVersion}"/> |
| 38 | <filterchain> |
| 39 | <tokenfilter> |
| 40 | <replaceregex pattern="^(\d+)\.(\d+)\.(\d+)\.(.*)$" replace="\2"/> |
| 41 | </tokenfilter> |
| 42 | </filterchain> |
| 43 | </loadresource> |
| 44 | <loadresource property="bundleVersionService"> |
| 45 | <string value="${bundleVersion}"/> |
| 46 | <filterchain> |
| 47 | <tokenfilter> |
| 48 | <replaceregex pattern="^(\d+)\.(\d+)\.(\d+)\.(.*)$" replace="\3"/> |
| 49 | </tokenfilter> |
| 50 | </filterchain> |
| 51 | </loadresource> |
| 52 | <loadresource property="bundleVersionQualifer"> |
| 53 | <string value="${bundleVersion}"/> |
| 54 | <filterchain> |
| 55 | <tokenfilter> |
| 56 | <replaceregex pattern="^(\d+)\.(\d+)\.(\d+)\.(.*)$" replace="\4"/> |
| 57 | </tokenfilter> |
| 58 | </filterchain> |
| 59 | </loadresource> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 60 | <!--{ObjectTeams: debug: --> |
Stephan Herrmann | 5775ef0 | 2012-09-23 19:23:31 +0200 | [diff] [blame] | 61 | <echo message="bundleVersion: ${bundleVersion}"/> |
| 62 | <echo message="bundleVersionMajor: ${bundleVersionMajor}"/> |
| 63 | <echo message="bundleVersionMinor: ${bundleVersionMinor}"/> |
| 64 | <echo message="bundleVersionService: ${bundleVersionService}"/> |
| 65 | <echo message="bundleVersionQualifier: ${bundleVersionQualifer}"/> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 66 | <!-- SH} --> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 67 | <property name="ecj-temp-folder" value="${basedir}/ecj-temp-folder" /> |
| 68 | <property name="ecj-temp-src-folder" value="${basedir}/ecj-temp-src-folder" /> |
| 69 | <mkdir dir="${ecj-temp-src-folder}" /> |
| 70 | <mkdir dir="${ecj-temp-folder}"/> |
| 71 | </target> |
| 72 | |
| 73 | <target name="extract-batch-compiler" depends="init"> |
| 74 | <property name="target.folder" value="${basedir}/bin"/> |
Stephan Herrmann | 918c05c | 2012-12-16 20:09:49 +0100 | [diff] [blame] | 75 | <replace file="${target.folder}/org/eclipse/jdt/internal/compiler/batch/messages.properties" token="bundle_qualifier" value="${bundleVersionQualifer}"/> |
Stephan Herrmann | f4d5e21 | 2014-06-10 19:54:03 +0200 | [diff] [blame] | 76 | <!-- {ObjectTeams: more replacement (strategy no longer maintained in JDT?) --> |
Stephan Herrmann | 5ba5c29 | 2014-08-10 19:34:32 +0200 | [diff] [blame] | 77 | <replace file="${target.folder}/org/eclipse/jdt/internal/compiler/batch/messages.properties" token="bundle_version" value="${bundleVersionMajor}.${bundleVersionMinor}.${bundleVersionService}"/> |
Stephan Herrmann | f4d5e21 | 2014-06-10 19:54:03 +0200 | [diff] [blame] | 78 | <!-- SH}--> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 79 | <echo message="Extract .class file and properties for the batch compiler" /> |
| 80 | <copy todir="${ecj-temp-folder}"> |
| 81 | <fileset dir="${target.folder}"> |
| 82 | <include name="org/eclipse/jdt/internal/compiler/**"/> |
| 83 | <include name="org/eclipse/jdt/core/compiler/**"/> |
| 84 | <!--{ObjectTeams:--> |
Stephan Herrmann | d196f5b | 2010-04-02 02:52:04 +0000 | [diff] [blame] | 85 | <include name="org/eclipse/objectteams/otdt/core/compiler/**"/> |
| 86 | <include name="org/eclipse/objectteams/otdt/internal/core/compiler/**"/> |
| 87 | <include name="org/eclipse/objectteams/otdt/core/exceptions/**"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 88 | <include name="org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class"/> |
| 89 | <!-- SH} --> |
| 90 | <exclude name="**/package.htm*"/> |
| 91 | <exclude name="org/eclipse/jdt/core/compiler/CompilationParticipant*.class"/> |
| 92 | <exclude name="org/eclipse/jdt/core/compiler/BuildContext.class"/> |
| 93 | <exclude name="org/eclipse/jdt/core/compiler/IScanner.class"/> |
| 94 | <exclude name="org/eclipse/jdt/core/compiler/ITerminalSymbols*.class"/> |
| 95 | <exclude name="org/eclipse/jdt/core/compiler/ReconcileContext*.class"/> |
| 96 | <exclude name="org/eclipse/jdt/internal/compiler/DocumentElementParser*.class"/> |
| 97 | <exclude name="org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class"/> |
| 98 | <exclude name="org/eclipse/jdt/internal/compiler/ISourceElementRequestor*.class"/> |
| 99 | <exclude name="org/eclipse/jdt/internal/compiler/SourceElementParser*.class"/> |
| 100 | <exclude name="org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter*.class"/> |
| 101 | <exclude name="org/eclipse/jdt/internal/compiler/SourceJavadocParser*.class"/> |
| 102 | <exclude name="org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter*.class"/> |
| 103 | </fileset> |
| 104 | </copy> |
Stephan Herrmann | 2ba6e97 | 2016-11-10 21:31:01 +0100 | [diff] [blame] | 105 | <!-- {ObjectTeams: add apt and tool: --> |
Stephan Herrmann | 1b38059 | 2017-12-05 23:13:43 +0100 | [diff] [blame] | 106 | <property name="compiler.apt" value="${build.root.dir}/eclipse/plugins/${jdt.compiler.apt}"/> |
Stephan Herrmann | 2ba6e97 | 2016-11-10 21:31:01 +0100 | [diff] [blame] | 107 | <echo message="compiler.apt=${compiler.apt}"/> |
| 108 | <unzip src="${compiler.apt}" dest="${ecj-temp-folder}"> |
| 109 | <patternset> |
| 110 | <include name="**/*.class"/> |
| 111 | <include name="**/*.properties"/> |
| 112 | </patternset> |
| 113 | </unzip> |
Stephan Herrmann | 25ac953 | 2016-11-10 22:04:40 +0100 | [diff] [blame] | 114 | <property name="compiler.tool" value="${build.root.dir}/eclipse/plugins/${jdt.compiler.tool}"/> |
Stephan Herrmann | 2ba6e97 | 2016-11-10 21:31:01 +0100 | [diff] [blame] | 115 | <echo message="compiler.tool=${compiler.tool}"/> |
| 116 | <unzip src="${compiler.tool}" dest="${ecj-temp-folder}"> |
| 117 | <patternset> |
| 118 | <include name="**/*.class"/> |
| 119 | <include name="**/*.properties"/> |
| 120 | </patternset> |
| 121 | </unzip> |
| 122 | <!-- SH} --> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 123 | </target> |
| 124 | |
| 125 | <target name="extract-_jsr199" depends="init"> |
| 126 | <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.tool/bin"/> |
Stephan Herrmann | 2ba6e97 | 2016-11-10 21:31:01 +0100 | [diff] [blame] | 127 | <echo message="Extract .class file and properties for the jsr199" /> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 128 | <copy todir="${ecj-temp-folder}" failonerror="false"> |
| 129 | <fileset dir="${target.folder}"/> |
| 130 | </copy> |
| 131 | </target> |
| 132 | |
| 133 | <target name="extract-_jsr269" depends="init"> |
| 134 | <property name="jsr_project" value="org.eclipse.jdt.compiler.apt"/> |
| 135 | <property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.apt/bin"/> |
Stephan Herrmann | 2ba6e97 | 2016-11-10 21:31:01 +0100 | [diff] [blame] | 136 | <echo message="Extract .class file and properties for the jsr269" /> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 137 | <copy todir="${ecj-temp-folder}" failonerror="false"> |
| 138 | <fileset dir="${target.folder}"/> |
| 139 | </copy> |
| 140 | </target> |
| 141 | |
| 142 | <target name="extract-ant-adapter-compiler" depends="init"> |
| 143 | <property name="target.folder" value="${basedir}/antbin"/> |
| 144 | <echo message="Extract .class file and properties for the ant adapter" /> |
| 145 | <mkdir dir="${ecj-temp-folder}"/> |
| 146 | <copy todir="${ecj-temp-folder}"> |
| 147 | <fileset dir="${target.folder}"> |
| 148 | <exclude name="org/eclipse/jdt/core/CheckDebugAttributes*.*"/> |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 149 | <exclude name="org/eclipse/jdt/core/BuildJarIndex*.*"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 150 | </fileset> |
| 151 | </copy> |
| 152 | </target> |
| 153 | |
| 154 | <target name="export" depends="init"> |
| 155 | <property name="buildLabel" value="head" /> |
| 156 | <property name="dest" value="../../ecj-export" /> |
| 157 | <mkdir dir="${dest}" /> |
| 158 | <!-- {ObjectTeams: changed name from ecj to ecotj. SH} --> |
| 159 | <echo message="UPDATE ecotj-${buildLabel}.jar" /> |
| 160 | <delete file="${dest}/ecotj-${buildLabel}.jar" failonerror="false"/> |
| 161 | <copy todir="${ecj-temp-folder}"> |
| 162 | <fileset dir="scripts/binary" /> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 163 | <fileset dir="scripts" includes="ecj.1"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 164 | </copy> |
| 165 | <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/> |
| 166 | <zip zipfile="${dest}/ecotj-${buildLabel}.jar"> |
| 167 | <fileset dir="${ecj-temp-folder}"> |
| 168 | <include name="**/*"/> |
| 169 | </fileset> |
| 170 | <fileset dir="scripts"> |
| 171 | <include name="about.html" /> |
| 172 | </fileset> |
| 173 | </zip> |
| 174 | |
Stephan Herrmann | 016c426 | 2010-10-20 22:02:18 +0000 | [diff] [blame] | 175 | <echo message="UPDATE ecotjsrc-${buildLabel}.jar" /> |
| 176 | <delete file="${dest}/ecotjsrc-${buildLabel}.jar" failonerror="false"/> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 177 | <!-- SH} --> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 178 | <copy todir="${ecj-temp-src-folder}"> |
| 179 | <fileset dir="scripts/source" /> |
| 180 | </copy> |
Stephan Herrmann | 1a8ea8f | 2012-09-18 15:10:52 +0200 | [diff] [blame] | 181 | <copy todir="${ecj-temp-src-folder}/scripts/binary"> |
| 182 | <fileset dir="scripts/binary" /> |
| 183 | </copy> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 184 | <replace file="${ecj-temp-src-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/> |
Stephan Herrmann | 1a8ea8f | 2012-09-18 15:10:52 +0200 | [diff] [blame] | 185 | <replace file="${ecj-temp-src-folder}/scripts/binary/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 186 | <zip zipfile="${dest}/ecjsrc-${buildLabel}.jar"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 187 | <zipfileset dir="ecj-temp-src-folder" /> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 188 | <zipfileset dir="batch"> |
| 189 | <exclude name="org/eclipse/jdt/internal/compiler/batch/messages.properties"/> |
| 190 | </zipfileset> |
| 191 | <fileset dir="${ecj-temp-folder}"> |
Stephan Herrmann | 1a8ea8f | 2012-09-18 15:10:52 +0200 | [diff] [blame] | 192 | <include name="**/messages.properties"/> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 193 | <include name="ecj.1"/> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 194 | </fileset> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 195 | <zipfileset dir="compiler" /> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 196 | <zipfileset dir="antadapter"> |
| 197 | <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/> |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 198 | <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 199 | </zipfileset> |
| 200 | <zipfileset dir="scripts"> |
| 201 | <include name="about.html" /> |
| 202 | <include name="build.xml" /> |
| 203 | </zipfileset> |
| 204 | </zip> |
| 205 | <antcall target="cleanup"/> |
| 206 | </target> |
| 207 | |
| 208 | <target name="export_src_bin"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 209 | <property name="dest" value="../../ecj-export" /> |
| 210 | <mkdir dir="${dest}" /> |
| 211 | <echo message="UPDATE ecj_all.jar" /> |
| 212 | <delete file="${dest}/ecj_all.jar" failonerror="false"/> |
| 213 | <mkdir dir="${ecj-temp-src-folder}/src" /> |
| 214 | <copy todir="${ecj-temp-folder}"> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 215 | <fileset dir="scripts" includes="ecj.1"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 216 | <fileset dir="scripts/binary" /> |
| 217 | </copy> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 218 | <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${bundleVersionQualifer}"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 219 | |
| 220 | <copy todir="${ecj-temp-src-folder}/src"> |
| 221 | <fileset dir="batch" /> |
| 222 | <fileset dir="compiler" /> |
| 223 | <fileset dir="antadapter"> |
| 224 | <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/> |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 225 | <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 226 | </fileset> |
| 227 | </copy> |
| 228 | |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 229 | <zip zipfile="${dest}/ecj-${buildLabel}.jar"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 230 | <fileset dir="${ecj-temp-folder}"> |
| 231 | <include name="**/*"/> |
| 232 | <include name="about.html"/> |
| 233 | </fileset> |
| 234 | <fileset dir="${ecj-temp-src-folder}"> |
| 235 | <exclude name="META-INF/**"/> |
| 236 | </fileset> |
| 237 | <fileset dir="scripts"> |
| 238 | <include name="about.html" /> |
| 239 | </fileset> |
| 240 | </zip> |
| 241 | |
| 242 | <delete dir="${ecj-temp-src-folder}" failonerror="false"/> |
| 243 | </target> |
| 244 | |
| 245 | <target name="cleanup"> |
| 246 | <delete dir="${ecj-temp-folder}" failonerror="false"/> |
| 247 | <delete dir="${ecj-temp-src-folder}" failonerror="false"/> |
| 248 | </target> |
| 249 | |
| 250 | <target name="export-all" depends="init"> |
| 251 | <antcall target="extract-batch-compiler"/> |
| 252 | <antcall target="extract-ant-adapter-compiler"/> |
| 253 | <antcall target="extract-_jsr199"/> |
| 254 | <antcall target="extract-_jsr269"/> |
| 255 | <antcall target="export_src_bin"/> |
| 256 | <antcall target="export"/> |
| 257 | <antcall target="cleanup"/> |
| 258 | </target> |
| 259 | </project> |