Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Build-ajdt1.5.xml

<?xml version="1.0"?>
<project name="ajdt-build" basedir="." default="all">

    <property name="cvs.repository" value=":pserver:anonymous@dev.eclipse.org:/cvsroot/tools"/>
    <property name="cvs.package" value="org.eclipse.ajdt/AJDT_src"/>
    <property name="checkoutdir" location="checkout/ajdt1.5"/>
    <property name="workdir" location="eclipse33/eclipse"/>
    <property name="external.build" value="true"/>
    <property name="ajdt.test.home" value="test"/>
    <property name="test.eclipse.home" value="${ajdt.test.home}/eclipse33"/>
    <property name="builddir" location="${workdir}/eclipse.build"/>
    <property name="java15-home" location="/home/build/jdk1.5.0"/>

<!-- the correct update site url needs to be selected below -->

<!-- development build version -->
<property name="update.url33" value="http://download.eclipse.org/tools/ajdt/33/dev/update/"/>

<!-- release build version -->
<!--  <property name="update.url33" value="http://download.eclipse.org/tools/ajdt/33/update/"/> -->


    <taskdef resource="com/ibm/lakeba/ant/taskdefs.properties" >
	 <classpath>
	     <pathelement path="checkresults.jar"/>
       </classpath>
    </taskdef>

    <target name="checkout" description="Update package from CVS">
        <delete dir="${checkoutdir}/org.eclipse.ajdt"/> 
        <mkdir dir="${checkoutdir}"/>
        <cvs cvsroot="${cvs.repository}" package="${cvs.package}" dest="${checkoutdir}" quiet="true"/>
    </target>

    <target name="work">
      <!-- Wipe any old versions of these plugins -->
      <delete includeEmptyDirs="true">
         <fileset dir="${workdir}">
            <include name="workspace/org.aspectj.*/"/>
            <include name="workspace/org.eclipse.ajdt*/"/>
            <include name="workspace/org.eclipse.aspectj*/"/>
            <include name="workspace/org.eclipse.contribution.visualiser*/"/>
            <include name="workspace/org.eclipse.contribution.xref*/"/>
            <include name="workspace/UpdateSite/"/>
            <include name="plugins/org.eclipse.ajdt.build*"/>
         </fileset>
      </delete>

      <!-- copy source into workspace -->
      <copy todir="${workdir}/workspace">
        <fileset dir="${checkoutdir}/org.eclipse.ajdt/AJDT_src/">
          <include name="**"/>
          <exclude name="org.eclipse.ajdt.build*/"/>
        </fileset>
      </copy>
    </target>

    <target name="pdebuild">
        <delete dir="${builddir}"/>
        <java fork="true" dir="eclipse32/eclipse/plugins/org.eclipse.pde.build_3.2.0.v20060601/scripts"
            jar="eclipse32/eclipse/startup.jar">
           <arg value="-application"/>
           <arg value="org.eclipse.ant.core.antRunner"/>
           <arg value="-Dbuilder=${workdir}/workspace/UpdateSite/"/>
           <arg value="-Dbase=${workdir}/.."/>
           <arg value="-DbuildDirectory=${builddir}"/>
           <arg value="-verbose"/>
        </java>
   </target>

    <target name="process">
        <!-- unzip the generated features -->
        <unzip src="${builddir}/I.TestBuild/org.eclipse.ajdt-TestBuild.zip"
            dest="${builddir}/final"/>
        <unzip src="${builddir}/I.TestBuild/org.eclipse.aspectj.feature_tests-TestBuild.zip"
            dest="${builddir}/tests"/>
        <!-- extract and save feature version -->
        <fileset id="feature.file" dir="${builddir}/final/eclipse/features/">
            <include name="org.eclipse.ajdt_*/feature.xml"/>
        </fileset>
        <pathconvert property="featurexml" refid="feature.file"/>
        <xmlproperty file="${featurexml}" collapseAttributes="true"/>
        <echo file="${builddir}/version.properties"
             message="feature.version=${feature.version}"/>
        <!-- zip the AJDT feature back up at the right directory level -->
        <property name="archive" value="ajdt_${feature.version}_archive.zip"/>
        <zip destfile="${builddir}/${archive}" basedir="${builddir}/final/eclipse"/>
        <!-- add feature id and tidy up update site -->
        <replace file="${builddir}/updateSite/site.xml" token="@AJFVERSION@"            
             value="${feature.version}"/>
        <delete includeEmptyDirs="true">
          <fileset dir="${builddir}/updateSite/features/">
            <include name="*tests*"/>
         </fileset>
        </delete>
        <!-- fix up source plugin -->
    	<delete>
    	    <fileset dir="${builddir}/updateSite/plugins">
    		<include name="*.source_*"/>
    	    </fileset>
            <!-- spyoung remove test plugins from update site dir -->
            <fileset dir="${builddir}/updateSite/plugins">
            <include name="*.tests_*"/>
    	    </fileset>
    	</delete>
    	<zip destfile="${builddir}/updateSite/plugins/org.eclipse.ajdt.source_${feature.version}.jar"
    	    basedir="${builddir}/final/eclipse/plugins/org.eclipse.ajdt.source_${feature.version}"/>
         <antcall target="optimizeUpdateSite" />
    </target>

    <target name="setup-test-eclipse">
      <!-- Wipe any old versions of these plugins from the test Eclipse -->
      <delete includeEmptyDirs="true">
         <fileset dir="${test.eclipse.home}">
            <include name="features/org.eclipse.aspectj*/"/>
            <include name="features/org.eclipse.ajdt*/"/>
            <include name="plugins/org.aspectj.*/"/>
            <include name="plugins/org.eclipse.ajdt*/"/>
            <include name="plugins/org.eclipse.aspectj*/"/>
            <include name="plugins/org.eclipse.contribution.visualiser*/"/>
            <include name="plugins/org.eclipse.contribution.xref*/"/>
         </fileset>
      </delete>

      <!-- Install the fresh AJDT plugins to the test Eclipse -->
      <copy todir="${test.eclipse.home}">
         <fileset dir="${builddir}/final/eclipse/"/>
      </copy>
      <copy todir="${test.eclipse.home}">
         <fileset dir="${builddir}/tests/eclipse/"/>
      </copy>

    </target>

    <target name="run-test-eclipse">
      <!-- Run the plugin test harness using Java -->
      <exec dir="." executable="./run-tests-33.sh" />
    </target>

    <target name="copy-test-results">
      <!-- Copy the xml output files created by the plugin test harness to a temp location from where it can be merged into build log -->
      <delete dir="${ajdt.test.home}/plugin-test-output33"/>
      <copy overwrite="true" file="${test.eclipse.home}/org.eclipse.ajdt.ui.tests.xml" todir="${ajdt.test.home}/plugin-test-output33" />
      <copy overwrite="true" file="${test.eclipse.home}/org.eclipse.ajdt.core.tests.xml" todir="${ajdt.test.home}/plugin-test-output33" />
    </target>

    <target name="check-results">
       <!-- Will set property only if failures detected -->
       <checkutresults property="ajdt.junit.failed"
         file="${ajdt.test.home}/plugin-test-output33/org.eclipse.ajdt.ui.tests.xml"/>
       <checkutresults property="ajdt.junit.failed"
         file="${ajdt.test.home}/plugin-test-output33/org.eclipse.ajdt.core.tests.xml"/>
    </target>

    <target name="check-tests-failed" if="ajdt.junit.failed">
	   <fail>JUnit plugin tests failed: ${ajdt.junit.failed}</fail>	
    </target>

    <target name="publish">
      <!-- make the zip file available as a build artifact -->
      <delete dir="${workdir}/dist"/>
      <mkdir dir="${workdir}/dist"/>

      <copy todir="${workdir}/dist">
         <fileset dir="${builddir}">
           <include name="ajdt_*_archive.zip"/>
         </fileset>
      </copy>
    </target>

    <!-- Run the site optimizer over the update site directory, prior to uploading to the update server - spyoung -->
    <target name="optimizeUpdateSite">
        <!-- Step 1 - process all the JARs and mark them for packing -->
        <java jar="eclipse32/eclipse/startup.jar" fork="true" failonerror="true"
            jvm="${java15-home}/bin/java"> 
            <arg value="-application" /> 
            <arg value="org.eclipse.update.core.siteOptimizer" /> 
            <arg line="-jarProcessor -processAll -repack -verbose" />
            <arg line="-outputDir ${builddir}/updateSite" />
            <arg value="${builddir}/updateSite" /> 
        </java> 

        <!-- Step 2 - "repack" all the JARs (i.e actaully pack them!) -->
        <java jar="eclipse32/eclipse/startup.jar" fork="true" failonerror="true"
            jvm="${java15-home}/bin/java"> 
            <arg value="-application" /> 
            <arg value="org.eclipse.update.core.siteOptimizer" /> 
            <arg line="-jarProcessor -pack -verbose" />
            <arg line="-outputDir ${builddir}/updateSite" />
            <arg value="${builddir}/updateSite" /> 
        </java> 
    </target>

    <target name="upload">
      <ant antfile="upload-build1.5.xml" inheritAll="false"/>
    </target>

    <target name="build" depends="checkout,work,pdebuild,process"/>

    <target name="tests" depends="setup-test-eclipse,run-test-eclipse,copy-test-results,check-results,check-tests-failed"/>

    <target name="all" depends="build,tests,publish,upload"/>
</project>

Back to the top