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:
dion committed 2003-06-30 05:56:07 +00:00
1 parent d8e2d5b4b6
commit c6ecd68d0e
4 files changed
+100 -3

No files matched your search

+70 -1
View File
@@ -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 -->
<!--==================================================================-->