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}"/> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 71 | <property name="bin" value="@dot"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 72 | </target> |
| 73 | |
| 74 | <target name="extract-batch-compiler" depends="init"> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 75 | <property name="target.folder" value="${basedir}/../org.eclipse.jdt.core.compiler.batch/${bin}"/> |
Stephan Herrmann | 918c05c | 2012-12-16 20:09:49 +0100 | [diff] [blame] | 76 | <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] | 77 | <!-- {ObjectTeams: more replacement (strategy no longer maintained in JDT?) --> |
Stephan Herrmann | 5ba5c29 | 2014-08-10 19:34:32 +0200 | [diff] [blame] | 78 | <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] | 79 | <!-- SH}--> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 80 | <echo message="Extract .class file and properties for the batch compiler to ${ecj-temp-folder}" /> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 81 | <copy todir="${ecj-temp-folder}"> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 82 | <fileset dir="${basedir}/../org.eclipse.jdt.core.compiler.batch/${bin}"> <!--{ObjectTeams : changed from target/classes SH} --> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 83 | <include name="org/eclipse/jdt/internal/compiler/**"/> |
| 84 | <include name="org/eclipse/jdt/core/compiler/**"/> |
| 85 | <!--{ObjectTeams:--> |
Stephan Herrmann | d196f5b | 2010-04-02 02:52:04 +0000 | [diff] [blame] | 86 | <include name="org/eclipse/objectteams/otdt/core/compiler/**"/> |
| 87 | <include name="org/eclipse/objectteams/otdt/internal/core/compiler/**"/> |
| 88 | <include name="org/eclipse/objectteams/otdt/core/exceptions/**"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 89 | <include name="org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class"/> |
| 90 | <!-- SH} --> |
| 91 | <exclude name="**/package.htm*"/> |
| 92 | <exclude name="org/eclipse/jdt/core/compiler/CompilationParticipant*.class"/> |
| 93 | <exclude name="org/eclipse/jdt/core/compiler/BuildContext.class"/> |
| 94 | <exclude name="org/eclipse/jdt/core/compiler/IScanner.class"/> |
| 95 | <exclude name="org/eclipse/jdt/core/compiler/ITerminalSymbols*.class"/> |
| 96 | <exclude name="org/eclipse/jdt/core/compiler/ReconcileContext*.class"/> |
| 97 | <exclude name="org/eclipse/jdt/internal/compiler/DocumentElementParser*.class"/> |
| 98 | <exclude name="org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class"/> |
| 99 | <exclude name="org/eclipse/jdt/internal/compiler/ISourceElementRequestor*.class"/> |
| 100 | <exclude name="org/eclipse/jdt/internal/compiler/SourceElementParser*.class"/> |
| 101 | <exclude name="org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter*.class"/> |
| 102 | <exclude name="org/eclipse/jdt/internal/compiler/SourceJavadocParser*.class"/> |
| 103 | <exclude name="org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter*.class"/> |
| 104 | </fileset> |
| 105 | </copy> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 106 | </target> |
| 107 | |
| 108 | <target name="extract-ant-adapter-compiler" depends="init"> |
Stephan Herrmann | 5e8e56c | 2022-12-30 22:33:08 +0100 | [diff] [blame] | 109 | <property name="target.folder" value="${basedir}/../org.eclipse.jdt.core.compiler.batch/${bin}"/> |
| 110 | <echo message="Extract .class file and properties for the ant adapter from ${target.folder} to ${ecj-temp-folder}" /> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 111 | <mkdir dir="${ecj-temp-folder}"/> |
| 112 | <copy todir="${ecj-temp-folder}"> |
Stephan Herrmann | 5e8e56c | 2022-12-30 22:33:08 +0100 | [diff] [blame] | 113 | <fileset dir="${basedir}/../org.eclipse.jdt.core.compiler.batch/${bin}"> |
Stephan Herrmann | b33126e | 2022-12-26 18:19:40 +0100 | [diff] [blame] | 114 | <include name="org/eclipse/jdt/internal/antadapter/*.*"/> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 115 | <include name="org/eclipse/jdt/core/JDTCompilerAdapter*.*"/> |
Stephan Herrmann | b33126e | 2022-12-26 18:19:40 +0100 | [diff] [blame] | 116 | </fileset> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 117 | </copy> |
| 118 | </target> |
| 119 | |
| 120 | <target name="export" depends="init"> |
| 121 | <property name="buildLabel" value="head" /> |
| 122 | <property name="dest" value="../../ecj-export" /> |
| 123 | <mkdir dir="${dest}" /> |
| 124 | <!-- {ObjectTeams: changed name from ecj to ecotj. SH} --> |
| 125 | <echo message="UPDATE ecotj-${buildLabel}.jar" /> |
| 126 | <delete file="${dest}/ecotj-${buildLabel}.jar" failonerror="false"/> |
| 127 | <copy todir="${ecj-temp-folder}"> |
| 128 | <fileset dir="scripts/binary" /> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 129 | <fileset dir="scripts" includes="ecj.1"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 130 | </copy> |
| 131 | <replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/> |
| 132 | <zip zipfile="${dest}/ecotj-${buildLabel}.jar"> |
| 133 | <fileset dir="${ecj-temp-folder}"> |
| 134 | <include name="**/*"/> |
| 135 | </fileset> |
| 136 | <fileset dir="scripts"> |
| 137 | <include name="about.html" /> |
| 138 | </fileset> |
| 139 | </zip> |
| 140 | |
Stephan Herrmann | 016c426 | 2010-10-20 22:02:18 +0000 | [diff] [blame] | 141 | <echo message="UPDATE ecotjsrc-${buildLabel}.jar" /> |
| 142 | <delete file="${dest}/ecotjsrc-${buildLabel}.jar" failonerror="false"/> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 143 | <!-- SH} --> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 144 | <copy todir="${ecj-temp-src-folder}"> |
| 145 | <fileset dir="scripts/source" /> |
| 146 | </copy> |
Stephan Herrmann | 1a8ea8f | 2012-09-18 15:10:52 +0200 | [diff] [blame] | 147 | <copy todir="${ecj-temp-src-folder}/scripts/binary"> |
| 148 | <fileset dir="scripts/binary" /> |
| 149 | </copy> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 150 | <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] | 151 | <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] | 152 | <zip zipfile="${dest}/ecjsrc-${buildLabel}.jar"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 153 | <zipfileset dir="ecj-temp-src-folder" /> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 154 | <fileset dir="${ecj-temp-folder}"> |
Stephan Herrmann | 1a8ea8f | 2012-09-18 15:10:52 +0200 | [diff] [blame] | 155 | <include name="**/messages.properties"/> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 156 | <include name="ecj.1"/> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 157 | </fileset> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 158 | <zipfileset dir="${basedir}/../org.eclipse.jdt.core.compiler.batch/${bin}"> |
| 159 | <exclude name="org/eclipse/jdt/internal/compiler/batch/messages.properties"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 160 | <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/> |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 161 | <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 162 | </zipfileset> |
| 163 | <zipfileset dir="scripts"> |
| 164 | <include name="about.html" /> |
| 165 | <include name="build.xml" /> |
| 166 | </zipfileset> |
| 167 | </zip> |
| 168 | <antcall target="cleanup"/> |
| 169 | </target> |
| 170 | |
| 171 | <target name="export_src_bin"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 172 | <property name="dest" value="../../ecj-export" /> |
| 173 | <mkdir dir="${dest}" /> |
| 174 | <echo message="UPDATE ecj_all.jar" /> |
| 175 | <delete file="${dest}/ecj_all.jar" failonerror="false"/> |
| 176 | <mkdir dir="${ecj-temp-src-folder}/src" /> |
| 177 | <copy todir="${ecj-temp-folder}"> |
Stephan Herrmann | bc9c668 | 2014-05-15 22:48:38 +0200 | [diff] [blame] | 178 | <fileset dir="scripts" includes="ecj.1"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 179 | <fileset dir="scripts/binary" /> |
| 180 | </copy> |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 181 | <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] | 182 | |
| 183 | <copy todir="${ecj-temp-src-folder}/src"> |
Stephan Herrmann | 8e48e23 | 2022-12-30 12:15:35 +0100 | [diff] [blame] | 184 | <fileset dir="${basedir}/../org.eclipse.jdt.core.compiler.batch/src"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 185 | <exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/> |
Stephan Herrmann | 4a05b5f | 2012-05-17 21:11:23 +0200 | [diff] [blame] | 186 | <exclude name="org/eclipse/jdt/core/BuildJarIndex.java"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 187 | </fileset> |
| 188 | </copy> |
| 189 | |
Stephan Herrmann | b046a49 | 2012-08-10 16:50:55 +0200 | [diff] [blame] | 190 | <zip zipfile="${dest}/ecj-${buildLabel}.jar"> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 191 | <fileset dir="${ecj-temp-folder}"> |
| 192 | <include name="**/*"/> |
| 193 | <include name="about.html"/> |
| 194 | </fileset> |
| 195 | <fileset dir="${ecj-temp-src-folder}"> |
| 196 | <exclude name="META-INF/**"/> |
| 197 | </fileset> |
| 198 | <fileset dir="scripts"> |
| 199 | <include name="about.html" /> |
| 200 | </fileset> |
| 201 | </zip> |
| 202 | |
| 203 | <delete dir="${ecj-temp-src-folder}" failonerror="false"/> |
| 204 | </target> |
| 205 | |
| 206 | <target name="cleanup"> |
| 207 | <delete dir="${ecj-temp-folder}" failonerror="false"/> |
| 208 | <delete dir="${ecj-temp-src-folder}" failonerror="false"/> |
| 209 | </target> |
| 210 | |
| 211 | <target name="export-all" depends="init"> |
| 212 | <antcall target="extract-batch-compiler"/> |
| 213 | <antcall target="extract-ant-adapter-compiler"/> |
Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 214 | <antcall target="export_src_bin"/> |
| 215 | <antcall target="export"/> |
| 216 | <antcall target="cleanup"/> |
| 217 | </target> |
| 218 | </project> |