Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] patch proposal for AJDT build files

#: Matt Chapman changed the world a bit at a time by saying on  11/18/2005 11:47 AM :#
Alex,

We should not change the build.xml files directly, except for the
toplevel one in the UpdateSite project. This is because they are
generated by AJDT's own "Create Ant Build File with AspectJ Support"
functionality. This allows us to easily regenerate the build files
when we move to building on a different version of eclipse. We can of
course change the files generated by changing the AJDT function
itself, but then the files generated have to be appropriate in the
general case, not specific to building AJDT.

I see. I have forgot about this. Sorry.


The location of the ajde and weaver jars is defined in terms of the
aspectj.plugin.home and aspectj.weaver.home properties, and so these
could be set by the toplevel build.xml in UpdateSite. This would
indeed simplify the process of building an update site off the build
machine, as the paths would only need to be changed in one place.

Regards,


Attached is the patch for UpdateSite build.xml according to the above points. It will load a local.properties file. If there you define other values for those 2 homes, than everything is oke. Otherwise the default values generated by "Create Ant Build File with AspectJ Support" will be used.

Indeed this would remove the 1st issue I had.

Now I am wondering, what I can do about the 2nd one with Eclipse plugins dependencies. I guess that many users are checkout CVS/SVN sourcecodes outside workspace (this allow to have your projects independent of Eclipse and allow you to easily upgrade Eclipse versions).



./alex
--
.w( the_mindstorm )p.

Matt.

On 17/11/05, Alexandru Popescu <the.mindstorm.mailinglist@xxxxxxxxx> wrote:
Hi!

I would like to propose a possible patch for the AJDT build.xml files, but I want to let you know
before doing it and to find out your feeling about it.

Mainly it is meant to solve 2 of the problems I was facing while trying to build AJDT. The current
behavior is to be preserved as default values.

So, the patch would contain roughly the following changes:

1/ a customizable local.properties placed under UpdateSite subproject.

It would be used to define the following 3 properties:

- aspectj.plugin.home => used to pick the ajde.jar
- aspectj.weaver.home => used to pick aspectjweaver.jar
- eclipse.jars.home => used to pick the jar dependencies from Eclipse

2/ build.xml changes:

the only changes to be made inside each build.xml are the following:

<property file="../UpdateSite/local.properties" />
<property name="aspectj.plugin.home" value="default_value_here" />
<property name="aspectj.weaver.home" value="default_value_here" />
<property name="eclipse.jars.home" value="../.." /> <!-- this is the current default value -->

and than all references inside <forkclasspath> would be prefixed with ${eclipse.jars.home}.

There is also a simplification possible against pasteing this ${eclipse.jars.home} in so many places:

<forkclasspath>
        <fileset dir="${eclipse.jars.home}/plugins">
                <include name="..." />
        </fileset>
</forkclasspath>

The benefit of applying these changes are at least to me obvious:
- you will have a single location to provide the versions of aspectj plugin, weaver and also eclipse
- everybody would be able to build without needing to checkout the sources in a specified location
and/or modify the set of build.xml

If you agree with this patch, I can definitely do the changes immediately in all build.xml-s and
submit it (whatever format you like: either like a unified patch file, or as new build.xml files).

Please let me know what do you think

./alex
--
.w( the_mindstorm )p.


_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev

_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev




!DSPAM:437da347540809089212102!



<?xml version="1.0" ?>
<!-- writen for Ant 1.5.1 -->
<project name="org.eclipse.aspectj.updatesite" default="feature-pack">

<!--

This is the master build file that will build all the subprojects in turn
and create a packaged AJDT release.

The properties specified here override those in the subproject build files when
running a master build. 

The key targets are:
* clean (obvious),
* ajdejars (which recreates the jars in the ajde plugin from an aspectj
  distribution
* update-site which builds everything and creates an update-site
* publish, which uploads the update-site to ajdt/dev/update on eclipse.org
* release, which uploads the update-site to ajdt/update on eclipse.org

to run the last two targets you need an account on dev.eclipse.org
-->

<!--
	a place to allow overwritting:
	- aspectj.plugin.home
	- aspectj.weaver.home
-->
<property file="local.properties" />
	
<property name="cctimestamp" value="DEVELOPMENT" /> <!-- set by CruiseControl -->
<property name="ajdt.version.file" location="ajdtbuildversion.txt" /> <!-- set by CruiseControl -->
<property name="aspectj.feature.version" value="1.3.0.${cctimestamp}" />
<property name="ajdt.version" value="1.3.0.${cctimestamp}" />
<property name="ajde.version" value="1.5.0.${cctimestamp}" />
<property name="xref.version" value="1.3.0.${cctimestamp}" />
<property name="aspectj.release.name" value="1.5.0 M5" />
<property name="aspectj.version" value="1.5.0" />
<property name="visualiser.version" value="2.2.0.${cctimestamp}"/>
	
<property name="temp.folder" value="temp-folder" />

<description>
Creates an update site structure for AspectJ
</description>

<target name="init">
  <mkdir dir="dist"/>
  <mkdir dir="fpack_dist"/>
  <delete file="ajdt_${aspectj.feature.version}_archive.zip"/>
	
  <!-- write out build id for later use by performance tests -->
  <echo message="${ajdt.version}" file="${ajdt.version.file}"/>
</target>

<target name="clean" depends="init" >
  <delete dir="dist"/>
  <delete dir="fpack_dist"/>
  <ant dir="../org.aspectj.runtime" inheritAll="true" target="clean" />
  <ant dir="../org.aspectj.weaver" inheritAll="true" target="clean" />
  <ant dir="../org.aspectj.ajde" inheritAll="true" target="clean" />
  <ant dir="../org.eclipse.ajdt.core" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.ajdt.ui" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.ajdt.examples" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.aspectj" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.aspectj.feature" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.contribution.visualiser" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.contribution.visualiser.tests" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.ajdt.core.tests" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.ajdt.ui.tests" inheritAll="true" target="clean"/>
<!--  <ant dir="../org.eclipse.ajdt.tests.performance" inheritAll="true" target="clean"/> -->
  <ant dir="../org.eclipse.contribution.xref.core" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.contribution.xref.core.tests" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.contribution.xref.ui" inheritAll="true" target="clean"/>
  <ant dir="../org.eclipse.contribution.xref.ui.tests" inheritAll="true" target="clean"/>
</target>

	
<target name="feature-pack" depends="update-site"
	    description="Build zip of plugins that can be unzipped in eclipse install dir">
	<echo message="Constructing feature pack for AJDT ${aspectj.feature.version}"/>
	<mkdir dir="fpack_dist/plugins"/>
	<mkdir dir="fpack_dist/features"/>
	
	<copy todir="fpack_dist/." file="readme.txt"/>
	<mkdir dir="fpack_dist/features/org.eclipse.aspectj_${aspectj.feature.version}"/>
	<unzip dest="fpack_dist/features/org.eclipse.aspectj_${aspectj.feature.version}"
	        src="dist/features/org.eclipse.aspectj_${aspectj.feature.version}.jar"/>	
	
	<mkdir dir="fpack_dist/plugins/org.eclipse.aspectj_${aspectj.feature.version}"/>
	<unzip dest="fpack_dist/plugins/org.eclipse.aspectj_${aspectj.feature.version}"
	        src="dist/plugins/org.eclipse.aspectj_${aspectj.feature.version}.jar"/>	

	<copy todir="fpack_dist/plugins/"
		file="dist/plugins/org.eclipse.ajdt.core_${ajdt.version}.jar"/>

	<copy todir="fpack_dist/plugins/"
		file="dist/plugins/org.eclipse.ajdt.ui_${ajdt.version}.jar"/>

	<mkdir dir="fpack_dist/plugins/org.eclipse.ajdt.examples_${ajdt.version}"/>
	<unzip dest="fpack_dist/plugins/org.eclipse.ajdt.examples_${ajdt.version}"
	        src="dist/plugins/org.eclipse.ajdt.examples_${ajdt.version}.jar"/>	
		
	<mkdir dir="fpack_dist/plugins/org.aspectj.runtime_${ajde.version}"/>
	<unzip dest="fpack_dist/plugins/org.aspectj.runtime_${ajde.version}"
	        src="dist/plugins/org.aspectj.runtime_${ajde.version}.jar"/>
	
	<mkdir dir="fpack_dist/plugins/org.aspectj.weaver_${ajde.version}"/>
	<unzip dest="fpack_dist/plugins/org.aspectj.weaver_${ajde.version}"
	        src="dist/plugins/org.aspectj.weaver_${ajde.version}.jar"/>

	<mkdir dir="fpack_dist/plugins/org.aspectj.ajde_${ajde.version}"/>
	<unzip dest="fpack_dist/plugins/org.aspectj.ajde_${ajde.version}"
	        src="dist/plugins/org.aspectj.ajde_${ajde.version}.jar"/>

	<copy todir="fpack_dist/plugins/"
		file="dist/plugins/org.eclipse.contribution.xref.core_${xref.version}.jar"/>

	<copy todir="fpack_dist/plugins/"
		file="dist/plugins/org.eclipse.contribution.xref.ui_${xref.version}.jar"/>

	<copy todir="fpack_dist/plugins/"
		file="dist/plugins/org.eclipse.contribution.visualiser_${visualiser.version}.jar"/>

	<!-- Add source plugin -->
	<ant dir="../org.eclipse.ajdt.source"/>
	<move file="../org.eclipse.ajdt.source/src/org.aspectj.ajde" tofile="../org.eclipse.ajdt.source/src/org.aspectj.ajde_${ajde.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.aspectj.weaver" tofile="../org.eclipse.ajdt.source/src/org.aspectj.weaver_${ajde.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.core" tofile="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.core_${ajdt.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.ui" tofile="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.ui_${ajdt.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.examples" tofile="../org.eclipse.ajdt.source/src/org.eclipse.ajdt.examples_${ajdt.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.contribution.xref.core" tofile="../org.eclipse.ajdt.source/src/org.eclipse.contribution.xref.core_${xref.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.contribution.xref.ui" tofile="../org.eclipse.ajdt.source/src/org.eclipse.contribution.xref.ui_${xref.version}"/>
	<move file="../org.eclipse.ajdt.source/src/org.eclipse.contribution.visualiser" tofile="../org.eclipse.ajdt.source/src/org.eclipse.contribution.visualiser_${visualiser.version}"/>

	<mkdir dir="fpack_dist/plugins/org.eclipse.ajdt.source_${ajdt.version}"/>
	<copy todir="fpack_dist/plugins/org.eclipse.ajdt.source_${ajdt.version}">
		<fileset dir="../org.eclipse.ajdt.source">
			<exclude name="build.*"/>
			<exclude name="META-INF/MANIFEST.MF" />
		</fileset>
	</copy>
	<copy file="../org.eclipse.ajdt.source/META-INF/MANIFEST.MF" tofile="fpack_dist/plugins/org.eclipse.ajdt.source_${ajdt.version}/META-INF/MANIFEST.MF">
	 	<filterset begintoken="9" endtoken="9">
	 		<filter token="2.2.2" value="${ajdt.version}"/>
	 	</filterset>
	</copy>
	<zip destfile= "dist/plugins/org.eclipse.ajdt.source_${ajdt.version}.jar" >
	    <fileset dir="fpack_dist/plugins/org.eclipse.ajdt.source_${ajdt.version}"/>
	</zip>
	
	<zip destfile="ajdt_${aspectj.feature.version}_archive.zip"
		 basedir="fpack_dist"/>
</target>

	<target name="insert-version" if="file.to.update">
		<mkdir dir="${temp.folder}"/>
		<basename property="filename" file="${file.to.update}"/>
		<delete file="${temp.folder}/${filename}"/>
		<copy file="${file.to.update}" tofile="${temp.folder}/${filename}"/>
		<replace file="${file.to.update}" token="DEVELOPMENT" value="${cctimestamp}"/>
		<!--
		<copy file="${temp.folder}/${filename}" tofile="${file.to.update}">
		 	<filterset begintoken="9" endtoken="9">
		 		<filter token="2.2.2" value="${version}"/>
		 	</filterset>
		 </copy>
		 -->
	</target>
	
	<target name="test">
		<antcall target="insert-version">
			<param name="file.to.update" value="../org.eclipse.ajdt.core/build.xml"/>
		</antcall>		
	</target>
	
	<target name="restore" if="file.to.update">
		<basename property="filename" file="${file.to.update}"/>
		 <move file="${temp.folder}/${filename}" tofile="${file.to.update}" overwrite="true"/>
	</target>
		 			
	<target name="build-plugin" if="plugin-name">
		<antcall target="insert-version">
			<param name="file.to.update" value="../${plugin-name}/META-INF/MANIFEST.MF"/>
			<param name="version" value="${version}"/>
		</antcall>
		<antcall target="insert-version">
			<param name="file.to.update" value="../${plugin-name}/build.xml"/>
			<param name="version" value="${version}"/>
		</antcall>
	    <ant dir="../${plugin-name}" target="build.update.jar" inheritAll="true"/>
	    <ant dir="../${plugin-name}" target="build.sources" inheritAll="true"/>
		<!-- put originals back -->
		<antcall target="restore">
			<param name="file.to.update" value="../${plugin-name}/META-INF/MANIFEST.MF"/>
		</antcall>
		<antcall target="restore">
			<param name="file.to.update" value="../${plugin-name}/build.xml"/>
		</antcall>
	</target>
	
<target name="update-site" depends="init"
 description="Build the update site structure">
 
 <ant dir="../org.aspectj.runtime" inheritAll="true" />
 <ant dir="../org.aspectj.weaver" inheritAll="true" />
 <ant dir="../org.aspectj.ajde" inheritAll="true" />
	
	<!-- Visualiser and tests -->
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.visualiser"/>
		<param name="version" value="${visualiser.version}"/>
	</antcall>
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.visualiser.tests"/>
		<param name="version" value="${visualiser.version}"/>
	</antcall>

	<!-- XREF CORE and tests -->		
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.xref.core"/>
		<param name="version" value="${xref.version}"/>
	</antcall>
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.xref.core.tests"/>
		<param name="version" value="${xref.version}"/>
	</antcall>

	<!-- XREF UI and tests -->		
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.xref.ui"/>
		<param name="version" value="${xref.version}"/>
	</antcall>
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.contribution.xref.ui.tests"/>
		<param name="version" value="${xref.version}"/>
	</antcall>
	
	<!-- AJDT CORE and tests -->
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.ajdt.core"/>
		<param name="version" value="${ajdt.version}"/>
	</antcall>
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.ajdt.core.tests"/>
		<param name="version" value="${ajdt.version}"/>
	</antcall>

	<!-- AJDT UI and tests -->
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.ajdt.ui"/>
		<param name="version" value="${ajdt.version}"/>
	</antcall>
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.ajdt.ui.tests"/>
		<param name="version" value="${ajdt.version}"/>
	</antcall>
	
    <!-- Examples plugin -->
	<antcall target="build-plugin">
		<param name="plugin-name" value="org.eclipse.ajdt.examples"/>
		<param name="version" value="${ajdt.version}"/>
	</antcall>

 <ant dir="../org.eclipse.aspectj" inheritAll="true" />
 <ant dir="../org.eclipse.aspectj.feature" inheritAll="true" />

<!-- <ant dir="../org.eclipse.ajdt.tests.performance" inheritAll="true" /> -->
	
 <copy file="site.xml" todir="dist">
 	<filterset>
 		<filter token="AJFVERSION" value="${aspectj.feature.version}"/>
 	</filterset>
 </copy>
 <copy file="../org.eclipse.aspectj.feature/dist/org.eclipse.aspectj_${aspectj.feature.version}.jar"
       todir="dist/features" />
 <copy file="../org.eclipse.aspectj/dist/org.eclipse.aspectj_${aspectj.feature.version}.jar"
       todir="dist/plugins" />
 <copy file="../org.eclipse.ajdt.core/org.eclipse.ajdt.core_${ajdt.version}.jar"
       todir="dist/plugins" />
 <copy file="../org.eclipse.ajdt.ui/org.eclipse.ajdt.ui_${ajdt.version}.jar"
	   todir="dist/plugins" />
 <copy file="../org.eclipse.ajdt.examples/org.eclipse.ajdt.examples_${ajdt.version}.jar"
       todir="dist/plugins" />
 <copy file="../org.aspectj.runtime/dist/org.aspectj.runtime_${ajde.version}.jar"
       todir="dist/plugins" />  
 <copy file="../org.aspectj.weaver/dist/org.aspectj.weaver_${ajde.version}.jar"
       todir="dist/plugins" />
 <copy file="../org.aspectj.ajde/dist/org.aspectj.ajde_${ajde.version}.jar"
	   todir="dist/plugins" />  
 <copy file="../org.eclipse.contribution.visualiser/org.eclipse.contribution.visualiser_${visualiser.version}.jar"
       todir="dist/plugins" />     
 <copy file="../org.eclipse.contribution.xref.core/org.eclipse.contribution.xref.core_${xref.version}.jar"
	   todir="dist/plugins" />
 <copy file="../org.eclipse.contribution.xref.ui/org.eclipse.contribution.xref.ui_${xref.version}.jar"
	   todir="dist/plugins" />
</target>

</project>
Index: build.xml
===================================================================
RCS file: /home/technology/org.eclipse.ajdt/AJDT_src/UpdateSite/build.xml,v
retrieving revision 1.37
diff -u -r1.37 build.xml
--- build.xml	16 Nov 2005 14:19:57 -0000	1.37
+++ build.xml	18 Nov 2005 10:15:48 -0000
@@ -21,6 +21,13 @@
 to run the last two targets you need an account on dev.eclipse.org
 -->
 
+<!--
+	a place to allow overwritting:
+	- aspectj.plugin.home
+	- aspectj.weaver.home
+-->
+<property file="local.properties" />
+	
 <property name="cctimestamp" value="DEVELOPMENT" /> <!-- set by CruiseControl -->
 <property name="ajdt.version.file" location="ajdtbuildversion.txt" /> <!-- set by CruiseControl -->
 <property name="aspectj.feature.version" value="1.3.0.${cctimestamp}" />
# customize AJDT build environment
# rename it to local.properties and define the values

#aspectj.plugin.home=../org.aspectj.ajde
#aspectj.weaver.home=../org.aspectj.weaver

Back to the top