alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<project name="Build specific targets and properties" default="noDefault" basedir=".">

	<property name="postingDirectory" value="${buildDirectory}" />
	<property name="equinoxPostingDirectory" value="${postingDirectory}/../../equinox/drops" />
	<property name="publishingContent" value="${equinox.build.configs}/../publishingFiles" />

	<target name="publish">
		<antcall target="updateTestManifests" />
		<available classname="org.eclipse.releng.generators.EclipseTestResultsGenerator" property="class" value="org.eclipse.releng.generators.EclipseTestResultsGenerator" />
		<taskdef name="indexResults" classname="${class}" />

		<!-- generate md5s and sha1s for bundle -->
		<mkdir dir="${equinoxPostingDirectory}/${buildLabel}/checksum" />

		<exec executable="sh" dir="${equinoxPostingDirectory}/${buildLabel}">
			<arg line="${equinox.build.configs}/../../extras/produceChecksum" />
		</exec>

		<!--post clickThroughs-->
		<copy todir="${equinoxPostingDirectory}/${buildLabel}">
			<fileset dir="${buildDirectory}/maps/org.eclipse.releng" includes="clickThroughs/" />
		</copy>

		<!--copy compile logs to this posting directory-->
		<copy todir="${equinoxPostingDirectory}/${buildLabel}" overwrite="true">
			<fileset dir="${postingDirectory}/${buildLabel}" includes="compilelogs/**/plugins/org.eclipse.osgi*/**,compilelogs/**/plugins/org.eclipse.equinox*/**" excludes="compilelogs/**/plugins/org.eclipse.osgi.test*/**" />
		</copy>

		<!--temporary hack to copy orbit files to equinox download directory -->
		<copy todir="${equinoxPostingDirectory}/${buildLabel}" overwrite="true">
			<fileset dir="${buildDirectory}/plugins" includes="javax.servlet_*,org.apache.commons.logging_*,org.mortbay.jetty_*" />
		</copy>

		<!--post directory.txt-->
		<copy file="${buildDirectory}/directory.txt" todir="${equinoxPostingDirectory}/${buildLabel}" />

		<copy todir="${equinoxPostingDirectory}/${buildLabel}">
			<fileset dir="${publishingContent}/staticDropFiles" />
		</copy>

		<!--regenerate the index page with links to test results-->
		<indexResults isBuildTested="false" sendMail="false" buildType="${buildType}" dropTokenList="%equinox%,%framework%,%extrabundles%,%other%,%incubator%,%provisioning%,%launchers%" xmlDirectoryName="${postingDirectory}/testresults/xml" dropDirectoryName="${equinoxPostingDirectory}/${buildLabel}" testResultsTemplateFileName="${publishingContent}/templateFiles/testResults.php.template" dropTemplateFileName="${publishingContent}/templateFiles/index.php.template" testResultsHtmlFileName="testResults.php" dropHtmlFileName="index.php" hrefTestResultsTargetPath="../../../downloads/drops/${buildLabel}/testresults/html" hrefCompileLogsTargetPath="compilelogs" compileLogsDirectoryName="${equinoxPostingDirectory}/${buildLabel}/compilelogs" testManifestFileName="${publishingContent}/testManifest.xml" />
		<tstamp>
			<format property="TODAY" pattern="MMMM d, yyyy" />
		</tstamp>

		<!--  Insert Build Type descriptor  -->
		<condition property="typeDescription" value="Integration">
			<equals arg1="${buildType}" arg2="I" />
		</condition>
		<condition property="typeDescription" value="Nightly">
			<equals arg1="${buildType}" arg2="N" />
		</condition>
		<condition property="typeDescription" value="Release">
			<equals arg1="${buildType}" arg2="R" />
		</condition>
		<condition property="typeDescription" value="Stable">
			<equals arg1="${buildType}" arg2="S" />
		</condition>
		<condition property="typeDescription" value="Maintenance">
			<equals arg1="${buildType}" arg2="M" />
		</condition>
		<condition property="typeDescription" value="Test">
			<equals arg1="${buildType}" arg2="T" />
		</condition>

		<replace file="${equinoxPostingDirectory}/${buildLabel}/index.php" token="@type@" value="${typeDescription}" />

		<!--  Insert Build Date  -->
		<replace file="${equinoxPostingDirectory}/${buildLabel}/index.php" token="@date@" value="${TODAY}" />

		<!--  Insert Build Name  -->
		<replace file="${equinoxPostingDirectory}/${buildLabel}/index.php" token="@buildid@" value="${buildId}" />

		<!--  Update timestamp on file to permit overwrite through Ant copy task  -->
		<touch file="${equinoxPostingDirectory}/${buildLabel}/index.php" />
		<!--  Insert ftp url for drop directory  -->
		<replace file="${equinoxPostingDirectory}/${buildLabel}/index.php" token="@buildlabel@" value="${buildLabel}" />

	</target>


	<target name="updateTestManifests">
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.app" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.supplement" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.device" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.event" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.launcher" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.log" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.initializer" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.metatype" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.useradmin" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.osgi" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.osgi.util" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.osgi.services" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.registry" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.preferences" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.common" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.cm" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.ds" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.http" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.http.jetty" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.io" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.ip" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.jsp.jasper" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.jsp.jasper.registry" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.http.registry" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.http.servlet" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.http.servletbridge" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.servletbridge" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.transforms.hook" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.transforms.xslt" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.util" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.eclipse.equinox.wireadmin" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="javax.servlet" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="javax.servlet.jsp" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.apache.commons.logging" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.apache.commons.el" />
		</antcall>
		<antcall target="updateTestManifest">
			<param name="bundle.id" value="org.mortbay.jetty" />
		</antcall>
	</target>

	<!-- ===================================================================== -->
	<!-- Helper targets -->
	<!-- ===================================================================== -->
	<target name="updateTestManifest">
		<apply executable="ls" output="${buildDirectory}/${bundle.id}.txt" dir="${equinoxPostingDirectory}/${buildLabel}">
			<fileset dir="${equinoxPostingDirectory}/${buildLabel}">
				<patternset>
					<include name="${bundle.id}_*.jar" />
				</patternset>
			</fileset>
		</apply>

		<replaceregexp file="${buildDirectory}/${bundle.id}.txt" match="/.+/" replace="" />
		<replaceregexp file="${buildDirectory}/${bundle.id}.txt" match="\.jar" replace="" />
		<replaceregexp file="${buildDirectory}/${bundle.id}.txt" match="\n" replace="" />
		<loadfile property="bundle.jar" srcFile="${buildDirectory}/${bundle.id}.txt" failonerror="off" />
		<delete file="${buildDirectory}/${bundle.id}.txt" failonerror="false" />
		<replace file="${equinox.build.configs}/../publishingFiles/testManifest.xml" token="@${bundle.id}@" value="${bundle.jar}" />
	</target>


	<target name="unziplauncherfragment">
		<!--unzip binary version of equinox launcher fragments into ${baseLocation} so they are available to be used in the build-->
		<property name="output" value="${buildDirectory}/${bundle.id}.txt" />
		<apply executable="ls" output="${output}" dir="${p2InstallBaseLocation}/plugins">
			<fileset dir="${p2InstallBaseLocation}/plugins">
				<patternset>
					<include name="${bundle.id}*.jar" />
				</patternset>
			</fileset>
		</apply>
		<replaceregexp file="${buildDirectory}/${bundle.id}.txt" match="\.jar" replace="" />
		<replaceregexp file="${buildDirectory}/${bundle.id}.txt" match="\n" replace="" />
		<loadfile property="bundledir" srcFile="${output}" failonerror="off" />
		<delete file="${buildDirectory}/${bundle.id}.txt" failonerror="false" />
		<exec executable="unzip" dir="${p2InstallBaseLocation}/plugins">
			<arg line="-q ${bundledir}.jar -d ${bundledir}" />
		</exec>
		<move file="${bundledir}.jar" tofile="${bundledir}.jar.bak" failonerror="false" />
	</target>

	<target name="build.p2.installer.product">
		<property name="p2InstallBaseLocation" value="${buildDirectory}/tmpsite/eclipse" />
		<antcall target="unziplauncherfragment">
			<param name="bundle.id" value="org.eclipse.equinox.launcher.win32.win32.x86_1" />
			<param name="p2InstallBaseLocation" value="${buildDirectory}/tmpsite/eclipse" />
		</antcall>
		<antcall target="unziplauncherfragment">
			<param name="bundle.id" value="org.eclipse.equinox.launcher.gtk.linux.x86_1" />
			<param name="p2InstallBaseLocation" value="${buildDirectory}/tmpsite/eclipse" />
		</antcall>
		<antcall target="unziplauncherfragment">
			<param name="bundle.id" value="org.eclipse.equinox.launcher.carbon.macosx_" />
			<param name="p2InstallBaseLocation" value="${buildDirectory}/tmpsite/eclipse" />
		</antcall>

		<!-- unzip delta pack in a temporary location to get binary versions of launchers for product build -->
		<property name="pPath" value="${buildDirectory}/${buildId}/p2launchertmp" />
		<unzip src="${postingDirectory}/${buildLabel}/eclipse-${buildId}-delta-pack.zip" dest="${pPath}">
			<patternset>
				<include name="eclipse/features/" />
			</patternset>
		</unzip>

		<property name="tmpdatadir" value="${equinox.build.configs}/equinox.p2.installer/data" />
		<mkdir dir="${tmpdatadir}" />
		<java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar" dir="${eclipse.pdebuild.scripts}/productBuild" fork="true" failonerror="false" jvm="${java15-home}/bin/java">
			<jvmarg value="-Xmx768M" />
			<arg value="-data" />
			<arg file="${tmpdatadir}" />
			<arg value="-application" />
			<arg value="org.eclipse.ant.core.antRunner" />
			<arg value="-buildfile" />
			<arg value="${equinox.build.configs}/equinox.p2.installer/productBuild.xml" />
			<arg value="-DbuildId=${buildId}" />
			<arg value="-DbuildLabel=${buildLabel}" />
			<arg value="-Dbuilder=${equinox.build.configs}/equinox.p2.installer" />
			<arg value="-DbuildDirectory=${buildDirectory}/${buildId}/tmp" />
			<arg value="-DbaseLocation=${p2InstallBaseLocation}" />
			<arg value="-DeclipseBuildDirectory=${buildDirectory}" />
			<arg value="-DpluginPath=${pPath}/eclipse/features" />
			<arg value="-DequinoxPostingDirectory=${equinoxPostingDirectory}" />
		</java>
	</target>



	<!-- ===================================================================== -->
	<!-- Default target                                                        -->
	<!-- ===================================================================== -->
	<target name="noDefault">
		<echo message="You must specify a target when invoking this file" />
	</target>

</project>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.