external-tools support for eclipse 2.1
Note: this is not thoroughly tested git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113554 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d8e2d5b4b6
commit
c6ecd68d0e
@ -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/>
|
||||
|
||||
@ -243,6 +244,74 @@
|
||||
|
||||
</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 -->
|
||||
<!--==================================================================-->
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -66,6 +66,28 @@ ${eclipse workspace}/.metadata/.plugins/org.eclipse.ui.externaltools/externaltoo
|
||||
</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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user