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="org.eclipse.jdt.junit4.runtime" default="export" basedir="..">
<!-- build script to create a plugin from org.eclipse.jdt.ui -->

	<target name="init">
		<tstamp/>
		<property name="destdir"	value="../../plugin-export" />
		<property name="plugin"		value="org.eclipse.jdt.junit4.runtime" />
		<property name="qualifier" value="zzz${DSTAMP}-${TSTAMP}" />
		
		<!-- define property ${plugin_version} by reading version from MANIFEST.MF: -->
		<tempfile property="plugin_version_file" suffix=".plugin_version.tmp" destdir="${destdir}"/>
		<copy file="META-INF/MANIFEST.MF" tofile="${plugin_version_file}"/>
		<replaceregexp file="${plugin_version_file}" match=".*Bundle-Version: ((\d)+\.(\d)+\.(\d)+\.)qualifier.*" replace="plugin_version=_\1${qualifier}" flags="s" />
		<property file="${plugin_version_file}"/>
		<delete file="${plugin_version_file}" />
		
		<property name="dest"		value="${destdir}/${plugin}${plugin_version}" />
		<property name="destjar"	value="${destdir}/${plugin}${plugin_version}.jar" />
	</target>

	<target name="build" depends="init">
    	<eclipse.incrementalBuild project="${plugin}" kind="incr"/>
	</target>

	<target name="export" depends="build">
		<mkdir dir="${destdir}" />
		<delete dir="${dest}" />
		<mkdir dir="${dest}" />
		
		<copy todir="${dest}/META-INF">
			<fileset dir="META-INF" />
		</copy>		
		
		<replaceregexp file="${dest}/META-INF/MANIFEST.MF" match="Bundle-Version: ((\d)+\.(\d)+\.(\d)+\.)qualifier" replace="Bundle-Version: \1${qualifier}" byline="true" />
		
		<delete file="${destjar}" />
		<zip zipfile="${destjar}">
			<fileset dir=".">
			  <include name="plugin.xml" />
			  <include name="plugin.properties" />
			</fileset>
			<fileset dir="bin" />
			
		    <zipfileset dir="src" prefix="src" />
		    
			<fileset dir="${dest}">
			  <include name="META-INF/**" />
			</fileset>
		</zip>
		
		<delete dir="${dest}" />
		
	</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.