dion 2003/06/29 22:56:07 Modified: src/plugins-build/eclipse/xdocs changes.xml goals.xml src/plugins-build/eclipse plugin.jelly project.xml Log: external-tools support for eclipse 2.1 Note: this is not thoroughly tested Revision Changes Path 1.4 +7 -1 maven/src/plugins-build/eclipse/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven/src/plugins-build/eclipse/xdocs/changes.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- changes.xml 9 May 2003 08:42:21 -0000 1.3 +++ changes.xml 30 Jun 2003 05:56:07 -0000 1.4 @@ -6,7 +6,13 @@ </properties> <body> - <release version="1.3" date="In CVS"> + <release version="1.4" date="In CVS"> + <action dev="dion" type="add"> + Added support for Eclipse 2.1 external tools + </action> + </release> + + <release version="1.3" date="Unknown"> <action dev="michal" type="add"> Smarter generation of .classpath file. ${basedir} prefix is cut off if present in any path. 1.4 +22 -0 maven/src/plugins-build/eclipse/xdocs/goals.xml Index: goals.xml =================================================================== RCS file: /home/cvs/maven/src/plugins-build/eclipse/xdocs/goals.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- goals.xml 10 Apr 2003 06:39:37 -0000 1.3 +++ goals.xml 30 Jun 2003 05:56:07 -0000 1.4 @@ -66,6 +66,28 @@ </description> </goal> + <goal> + <name>eclipse:external-tools-21</name> + <description> + <p> + Generates an external tool file for each default goal available to + a Maven project into the <code>${maven.build.dir}/eclipse/</code> directory + </p> + <p> + If the <a href="properties.html">${maven.eclipse.workspace}</a> + property is set, the file is copied to the correct location within + that workspace + </p> + <p> + If the <a href="properties.html">${maven.eclipse.workspace}</a> + is <strong>not</strong> set, the files should be manually copied to + <source> +${your eclipse workspace}/.metadata/.plugins/org.eclipse.debug.core/.launches/ + </source> + </p> + </description> + </goal> + <a name="eclipse:add-maven-repo" /> <goal> <name>eclipse:add-maven-repo</name> 1.19 +70 -1 maven/src/plugins-build/eclipse/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven/src/plugins-build/eclipse/plugin.jelly,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- plugin.jelly 10 Jun 2003 10:17:26 -0000 1.18 +++ plugin.jelly 30 Jun 2003 05:56:07 -0000 1.19 @@ -3,7 +3,8 @@ <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" - xmlns:test="test"> + xmlns:test="test" + xmlns:util="jelly:util"> <test:dependency-handle/> @@ -242,6 +243,74 @@ </j:if> </goal> + + <!--==================================================================--> + <!-- Generate Eclipse mappings for Maven goals --> + <!--==================================================================--> + <goal name="eclipse:external-tools-21" + description="Generate an Eclipse 2.1 external tool for each goal"> + <ant:mkdir dir="${maven.build.dir}/eclipse/"/> + + <ant:echo>Creating external tools </ant:echo> + + <j:set var="os" value="${os.name}" /> + <j:set var="windows" value="${os.toLowerCase().indexOf('windows') != '-1'}"/> + <ant:echo>Adapting the generated file for a ${os} box.</ant:echo> + + <!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... --> + <j:set var="tool.loc" value="${maven.home}${file.separator}bin${file.separator}maven"/> + <j:if test="${windows}"> + <j:set var="tool.loc" value="${tool.loc}.bat"/> + </j:if> + + <j:set var="project" value="${org.apache.commons.jelly.werkz.Project}"/> + <j:set var="allGoals" value="${maven.eclipse.goals}" /> + <j:set var="session" value="${maven.session}"/> + <j:forEach var="goal" items="${session.allGoalNames}"> + <util:replace var="goalName" oldChar=":" newChar="-" value="${goal}"/> + + <j:set var="fileName" value="${maven.build.dir}/eclipse/maven ${goalName}.launch"/> + + <j:set var="maven.eclipse.generate" value="false"/> + <j:choose> + <j:when test="${allGoals == 'all'}"> + <j:set var="maven.eclipse.generate" value="true"/> + </j:when> + <j:otherwise> + <j:if test="${goal.indexOf(':') == '-1'}"> + <j:set var="maven.eclipse.generate" value="true"/> + </j:if> + </j:otherwise> + </j:choose> + + <j:if test="${maven.eclipse.generate}"> + <ant:echo>Generating ${fileName}</ant:echo> + <j:file name="${fileName}" prettyPrint="true" xmlns="dummy"> + <j:import file="${plugin.resources}/templates/launch.jelly" inherit="true"/> + </j:file> + </j:if> + </j:forEach> + + <j:set var="ws" value="${maven.eclipse.workspace}X" /> + <j:if test='${ws != "X"}'> + <j:set var="toDir" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.debug.core/.launches/" /> + <ant:copy todir="${toDir}"> + <ant:fileset dir="${maven.build.dir}/eclipse/" includes="*.launch" /> + </ant:copy> + </j:if> + + <j:if test='${ws == "X"}'> + <ant:echo> + Please set maven.eclipse.workspace to the location of your eclipse workspace. + Alternatively, copy + ${maven.build.dir}/eclipse/*.launch + to + [maven.eclipse.workspace]/.metadata/.plugins/org.eclipse.debug.core/.launches/ + </ant:echo> + </j:if> + + </goal> + <!--==================================================================--> <!-- Add MAVEN_REPO to classpath variables --> 1.11 +1 -1 maven/src/plugins-build/eclipse/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/maven/src/plugins-build/eclipse/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- project.xml 9 Apr 2003 01:06:45 -0000 1.10 +++ project.xml 30 Jun 2003 05:56:07 -0000 1.11 @@ -5,7 +5,7 @@ <pomVersion>3</pomVersion> <id>maven-eclipse-plugin</id> <name>Maven Eclipse Plug-in</name> - <currentVersion>1.3</currentVersion> + <currentVersion>1.4-SNAPSHOT</currentVersion> <description>A plugin to generate various files for the Eclipse IDE and ease the use of Maven within that environment</description> <shortDescription>Eclipse Plugin for Maven</shortDescription> <url>http://maven.apache.org/reference/plugins/eclipse/</url>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]