blob: 2049fcc3701aba3261405bdd1523bf61820fd15e [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2007, 2009 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
IBM Corporation - initial API and implementation
Technical University Berlin - extended API and implementation
-->
<!-- build script to create a batch compiler from org.eclipse.jdt.core -->
<project name="Eclipse Batch Compiler" default="export-all" basedir="..">
<target name="init">
<tstamp/>
<property name="ecj-temp-folder" value="${basedir}/ecj-temp-folder" />
<property name="ecj-temp-src-folder" value="${basedir}/ecj-temp-src-folder" />
<mkdir dir="${ecj-temp-src-folder}" />
<mkdir dir="${ecj-temp-folder}"/>
</target>
<target name="extract-batch-compiler" depends="init">
<property name="target.folder" value="${basedir}/bin"/>
<echo message="Extract .class file and properties for the batch compiler" />
<copy todir="${ecj-temp-folder}">
<fileset dir="${target.folder}">
<include name="org/eclipse/jdt/internal/compiler/**"/>
<include name="org/eclipse/jdt/core/compiler/**"/>
<!--{ObjectTeams:-->
<include name="org/eclipse/objectteams/otdt/core/compiler/**"/>
<include name="org/eclipse/objectteams/otdt/internal/core/compiler/**"/>
<include name="org/eclipse/objectteams/otdt/core/exceptions/**"/>
<include name="org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class"/>
<!-- SH} -->
<exclude name="**/package.htm*"/>
<exclude name="org/eclipse/jdt/core/compiler/CompilationParticipant*.class"/>
<exclude name="org/eclipse/jdt/core/compiler/BuildContext.class"/>
<exclude name="org/eclipse/jdt/core/compiler/IScanner.class"/>
<exclude name="org/eclipse/jdt/core/compiler/ITerminalSymbols*.class"/>
<exclude name="org/eclipse/jdt/core/compiler/ReconcileContext*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/DocumentElementParser*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/ISourceElementRequestor*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/SourceElementParser*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/SourceJavadocParser*.class"/>
<exclude name="org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter*.class"/>
</fileset>
</copy>
</target>
<target name="extract-_jsr199" depends="init">
<property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.tool/bin"/>
<echo message="Extract .class file and properties for the jsr199" />
<copy todir="${ecj-temp-folder}" failonerror="false">
<fileset dir="${target.folder}"/>
</copy>
</target>
<target name="extract-_jsr269" depends="init">
<property name="jsr_project" value="org.eclipse.jdt.compiler.apt"/>
<property name="target.folder" value="${basedir}/../org.eclipse.jdt.compiler.apt/bin"/>
<echo message="Extract .class file and properties for the jsr269" />
<copy todir="${ecj-temp-folder}" failonerror="false">
<fileset dir="${target.folder}"/>
</copy>
</target>
<target name="extract-ant-adapter-compiler" depends="init">
<property name="target.folder" value="${basedir}/antbin"/>
<echo message="Extract .class file and properties for the ant adapter" />
<mkdir dir="${ecj-temp-folder}"/>
<copy todir="${ecj-temp-folder}">
<fileset dir="${target.folder}">
<exclude name="org/eclipse/jdt/core/CheckDebugAttributes*.*"/>
</fileset>
</copy>
</target>
<target name="export" depends="init">
<property name="buildLabel" value="head" />
<property name="dest" value="../../ecj-export" />
<mkdir dir="${dest}" />
<!-- {ObjectTeams: changed name from ecj to ecotj. SH} -->
<echo message="UPDATE ecotj-${buildLabel}.jar" />
<delete file="${dest}/ecotj-${buildLabel}.jar" failonerror="false"/>
<copy todir="${ecj-temp-folder}">
<fileset dir="scripts/binary" />
</copy>
<replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
<zip zipfile="${dest}/ecotj-${buildLabel}.jar">
<fileset dir="${ecj-temp-folder}">
<include name="**/*"/>
</fileset>
<fileset dir="scripts">
<include name="about.html" />
</fileset>
</zip>
<echo message="UPDATE ecotjsrc-${buildLabel}.zip" />
<delete file="${dest}/ecotjsrc-${buildLabel}.zip" failonerror="false"/>
<copy todir="${ecj-temp-src-folder}">
<fileset dir="scripts/source" />
</copy>
<replace file="${ecj-temp-src-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
<zip zipfile="${dest}/ecotjsrc-${buildLabel}.zip">
<zipfileset dir="ecj-temp-src-folder" />
<zipfileset dir="batch" />
<zipfileset dir="compiler" />
<!-- {ObjectTeams: -->
<zipfileset dir="util">
<exclude name="org/objectteams/otdt/core/util/**"/>
</zipfileset>
<!-- SH} -->
<zipfileset dir="antadapter">
<exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
</zipfileset>
<zipfileset dir="scripts">
<include name="about.html" />
<include name="build.xml" />
</zipfileset>
</zip>
<antcall target="cleanup"/>
</target>
<target name="export_src_bin">
<property name="buildLabel" value="head" />
<property name="dest" value="../../ecj-export" />
<mkdir dir="${dest}" />
<echo message="UPDATE ecj_all.jar" />
<delete file="${dest}/ecj_all.jar" failonerror="false"/>
<mkdir dir="${ecj-temp-src-folder}/src" />
<copy todir="${ecj-temp-folder}">
<fileset dir="scripts/binary" />
</copy>
<replace file="${ecj-temp-folder}/META-INF/MANIFEST.MF" token="qualifier" value="${buildLabel}"/>
<copy todir="${ecj-temp-src-folder}/src">
<fileset dir="batch" />
<fileset dir="compiler" />
<fileset dir="antadapter">
<exclude name="org/eclipse/jdt/core/CheckDebugAttributes.java"/>
</fileset>
</copy>
<zip zipfile="${dest}/ecj_all.jar">
<fileset dir="${ecj-temp-folder}">
<include name="**/*"/>
<include name="about.html"/>
</fileset>
<fileset dir="${ecj-temp-src-folder}">
<exclude name="META-INF/**"/>
</fileset>
<fileset dir="scripts">
<include name="about.html" />
</fileset>
</zip>
<delete dir="${ecj-temp-src-folder}" failonerror="false"/>
</target>
<target name="cleanup">
<delete dir="${ecj-temp-folder}" failonerror="false"/>
<delete dir="${ecj-temp-src-folder}" failonerror="false"/>
</target>
<target name="export-all" depends="init">
<antcall target="extract-batch-compiler"/>
<antcall target="extract-ant-adapter-compiler"/>
<antcall target="extract-_jsr199"/>
<antcall target="extract-_jsr269"/>
<antcall target="export_src_bin"/>
<antcall target="export"/>
<antcall target="cleanup"/>
</target>
</project>