summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-04-05 09:49:14 +0000
committerRobert Gemmell <robbie@apache.org>2011-04-05 09:49:14 +0000
commit46af59d8cf7b8ab05e0a3e4db969d19c791deaed (patch)
treee4a4a8f1de1825add864bb015ca8b36f58879fdf
parent2b13c21b7bbe49834703b3ec882750e5afc74ecc (diff)
downloadqpid-python-46af59d8cf7b8ab05e0a3e4db969d19c791deaed.tar.gz
QPID-3181: addition of new task 'eclipse' to the Java build system to support the creation of .classpath and .project files for the Eclipse IDE. Relies on http://ant-eclipse.sourceforge.net/
Applied patch from Keith Wall <keith.wall@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1088946 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/build.xml3
-rw-r--r--qpid/java/common.xml19
-rw-r--r--qpid/java/module.xml81
3 files changed, 103 insertions, 0 deletions
diff --git a/qpid/java/build.xml b/qpid/java/build.xml
index f9ed71d31d..7164ae1f9f 100644
--- a/qpid/java/build.xml
+++ b/qpid/java/build.xml
@@ -292,4 +292,7 @@
</findbugs>
</target>
+ <target name="eclipse" description="build eclipse project and classpath files">
+ <iterate target="eclipse"/>
+ </target>
</project>
diff --git a/qpid/java/common.xml b/qpid/java/common.xml
index a8d9c0dea4..30a442c90c 100644
--- a/qpid/java/common.xml
+++ b/qpid/java/common.xml
@@ -63,6 +63,11 @@
<property name="mllib.dir" value="${project.root}/../python" />
<property name="findbugs.dir" value="${project.root}/lib/findbugs" />
+ <!-- properties used to control Ant Eclipse for Eclipse classpath/project files etc -->
+ <property name="eclipse.updatealways" value="false"/>
+ <property name="eclipse.compilercompliance" value="5.0"/>
+ <property name="eclipse.container" value="JVM 1.5"/>
+
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<include name="cobertura.jar" />
@@ -322,6 +327,20 @@
results directory:
${build.results}
+
+ ant eclipse
+
+ Generates project and classpath files for the Eclispe IDE. Requires that
+ the Ant Eclipse task (http://ant-eclipse.sourceforge.net/) has been installed
+ in $ANT_HOME/lib.
+
+ The following system properties will be passed to the task. These can be usefully
+ overridden from the command line.
+
+ eclipse.updatealways - forces Eclipse files to be regenerated even if they are newer then the build.xml (default ${eclipse.updatealways}).
+ eclipse.container - controls the Eclipse container (default ${eclipse.container}).
+ eclipse.compilercompliance" - controls the Eclipse compiler compliance (default ${eclipse.compilercompliance}).
+
</echo>
</target>
diff --git a/qpid/java/module.xml b/qpid/java/module.xml
index 7ce9dca7e6..602d5cf17d 100644
--- a/qpid/java/module.xml
+++ b/qpid/java/module.xml
@@ -75,6 +75,7 @@
<property name="module.coverage" location="${module.build}/coverage"/>
<property name="cobertura.datafile" location="${module.instrumented}/cobetura.ser"/>
+
<available property="module.test.src.exists" file="${module.test.src}"/>
<available property="module.etc.exists" file="${module.etc}"/>
<available property="module.bin.exists" file="${module.bin}"/>
@@ -823,4 +824,84 @@ qpid.name=${project.name}
<touch file="${velocity.timestamp}" />
</target>
+ <target name="eclipse" depends="eclipse-setup,eclipse-project,eclipse-source-only,eclipse-source-and-test"/>
+
+ <target name="eclipse-setup">
+ <taskdef name="eclipse" classname="prantl.ant.eclipse.EclipseTask" />
+
+ <!-- Build set of directories representing the dependencies -->
+
+ <dirset id="eclipse.required.projectdirs.path" dir="${project.root}" includes="${module.depends} ${module.test.depends} neverBeEmpty">
+ <!-- Select only those projects from module.depends that contain a build.xml. This serves to exclude dependencies that
+ don't become Eclipse projects e.g. broker-plugins and common-tests -->
+ <present targetdir="${project.root}">
+ <mapper type="glob" from="*" to="*/build.xml"/>
+ </present>
+ </dirset>
+
+ <!-- Convert from the set of directories into Eclipse project names proceeded by forward slashes -->
+
+ <pathconvert property="eclipse.required.projectnames" refid="eclipse.required.projectdirs.path" pathsep=" " dirsep="-">
+ <map from="${project.root}${file.separator}" to=''/>
+ </pathconvert>
+ <map property="eclipse.required.slashedprojectnames" value="${eclipse.required.projectnames}" join="${path.separator}">
+ <globmapper from="*" to="/*"/>
+ </map>
+
+ <echo message="Ant module dependencies : ${module.depends} ${module.test.depends} converted to Eclipse required project(s): ${eclipse.required.slashedprojectnames}"/>
+ <path id="eclipse.required.slashedprojectnames.path">
+ <pathelement path="${eclipse.required.slashedprojectnames}"/>
+ </path>
+ </target>
+
+ <!-- Create the Eclipse .project -->
+ <target name="eclipse-project">
+ <eclipse updatealways="${eclipse.updatealways}">
+ <project name="${module.name}"/>
+
+ <!-- If the Eclipse task were to ever support the generation of
+ linked resources, we would configure it to generate
+ the following:
+
+ scratch_src -> ${module.precompiled}
+
+ in each project. This would avoid the 'linked sources'
+ manual step documented on the Wiki.
+ -->
+ </eclipse>
+ </target>
+
+ <!-- Create the Eclipse .classpath -->
+ <target name="eclipse-source-only" unless="module.test.src.exists">
+ <eclipse updatealways="${eclipse.updatealways}">
+ <settings>
+ <jdtcore compilercompliance="${eclipse.compilercompliance}" />
+ </settings>
+ <classpath>
+ <container path="${eclipse.container}" />
+ <source path="${module.src}" />
+ <source pathref="eclipse.required.slashedprojectnames.path" />
+ <library pathref="module.libs"/>
+ <output path="classes" />
+ </classpath>
+ </eclipse>
+ </target>
+
+ <!-- Create the Eclipse .classpath -->
+ <target name="eclipse-source-and-test" if="module.test.src.exists">
+ <eclipse updatealways="${eclipse.updatealways}">
+ <settings>
+ <jdtcore compilercompliance="${eclipse.compilercompliance}" />
+ </settings>
+ <classpath>
+ <container path="${eclipse.container}" />
+ <source path="${module.src}" />
+ <source path="${module.test.src}" />
+ <source pathref="eclipse.required.slashedprojectnames.path" />
+ <library pathref="module.libs"/>
+ <library pathref="module.test.libs"/>
+ <output path="classes" />
+ </classpath>
+ </eclipse>
+ </target>
</project>