You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by kn...@apache.org on 2003/03/10 22:30:36 UTC

cvs commit: jakarta-turbine-maven/src/plugins-build/shell project.properties plugin.jelly .cvsignore project.xml plugin.properties

knielsen    2003/03/10 13:30:36

  Added:       src/plugins-build/shell/xdocs navigation.xml changes.xml
                        goals.xml properties.xml index.xml
               src/plugins-build/shell project.properties plugin.jelly
                        .cvsignore project.xml plugin.properties
  Log:
  Plugin that allows one to generate files that allows tab completion for maven goals for different shells, currently only zsh is supported
  
  Revision  Changes    Path
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <project name="Maven Eclipse Plugin">
  
    <title>Maven Eclipse Plugin</title>
  
    <body>
      <links>
        <item name="Maven"   href="http://jakarta.apache.org/turbine/maven/"/>
        <item name="zsh" href="http://www.zsh.org/"/>
      </links>
      <menu name="Overview">
        <item name="Goals" href="/goals.html" />
        <item name="Properties" href="/properties.html" />
      </menu>
    </body>
  </project>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
    <properties>
      <title>Changes</title>
      <author email="apache@kav.dk">Kasper Nielsen</author>
    </properties>
  
    <body>
      <release version="1.0" date="2003-03-10">
        <action dev="knielsen" type="add">
          Initial release
        </action>
      </release>
    </body>
  </document>
  
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/xdocs/goals.xml
  
  Index: goals.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>ShellScript Plugin Goals</title>
      <author email="apache@kav.dk">Kasper Nielsen</author>
    </properties>
  
    <body>
      <goals>
        <goal>
          <name>sheel</name>
          <description>
              The default goal. This goal simply executes the 
              <a href="#shell:zsh">shell:zsh</a> goal for now
          </description>
        </goal>
          
        <goal>
          <name>shell:zsh</name>
            <description>
              Generates a <code>_maven</code> file for the ZSH shell
            </description>
          </goal>
  
      </goals>
    </body>
  </document>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>Shell Properties</title>
        <author email="apache@kav.dk">Kasper Nielsen</author>
    </properties>
  
    <body>
      <section name="Shell Settings">
        <table>
          <tr><th>Property</th><th>Optional?</th><th>Description</th></tr>
          <tr>
            <td>maven.shell.zsh.dir</td>
            <td>Yes</td>
            <td>
  			Location of the <a href="http://www.eclipse.org">Zsh</a>
  			function directory.
  			<p>
  			  If this parameter is specified, the <a href="goals.html#shell:zsh">
  			  shell:zsh</a> goal will use it as the destination to copy the generated file.
  			  Otherwise it will be put into the build dir.
              </p>
            </td>
          </tr>
          <tr>
            <td>maven.shell.zsh.nodesc</td>
            <td>Yes</td>
            <td>
  			Do not generate descriptions for tab completion
            </td>
          </tr>
      </section>
    </body>
  </document>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Shell Plugin</title>
      <author email="apache@kav.dk">Kasper Nielsen</author>
    </properties>
  
    <body>
      <section name="Maven Eclipse Plugin">
        <p>
          This plug-in provides the ability to generate shell script files
  		that allows for tab completion.
        </p>
        <p> 
          For more information on the functionality provided by this plugin,
          please see the <a href="goals.html">Goals</a> document.
        </p>
        <p>
          For more information on how to customise the functionality provided
          by this plugin, please see the <a href="properties.html">properties</a>
          document.
        </p>
      </section>
   </body>
  </document>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/project.properties
  
  Index: project.properties
  ===================================================================
  # -------------------------------------------------------------------
  # P R O J E C T  P R O P E R T I E S
  # -------------------------------------------------------------------
  maven.xdoc.date=left
  maven.xdoc.version=${pom.currentVersion}
  maven.license.licenseFile=${basedir}/../../../LICENSE.txt
  
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <project xmlns:j="jelly:core"
  	xmlns:test="test">
  
    <!--==================================================================-->
    <!-- Generate Eclipse .project and .classpath files                   -->
    <!--==================================================================-->    
    <goal name="shell"
      description="Generate Zsh files"
      />
  
    <goal name="shell:zsh"
      description="Generate Zsh files">
  
  		<j:set var="outputDir" value="${maven.shell.zsh.dir}"/>
  		<j:if test="${empty outputDir}">
  			<j:set var="outputDir" value="${maven.build.dir}"/>
  		</j:if>
  
  	<j:file name="${maven.build.dir}/_mavenzsh.tmp" omitXmlDeclaration="true" xmlns="dummy">
  	<![CDATA[
         #compdef maven
         case "$service" in
         
  maven)
   _arguments -s \
      '-D[Define a system property]' \
      '-E[Produce logging information without adornments]' \
      '-X[Produce execution debug output]' \
      '-b[Suppress logo banner]' \
      '-d[Set effective working directory]' \
      '-e[Produce exception stack traces]' \
      '-f[Set project file and effective working directory by finding the project file]' \
      '-g[Display available goals]' \
      '-h[Display help information]' \
      '-i[Display system information]' \
      '-o[Build is happening offline]' \
      '-p[Set project file]:Project File:_files -g \*.xml' \
      '-v[Display version information]' \
      ':Maven Goals:-@GREATER_THAN@mavengoals' \
      ':destination directory:_files -/' @AMBERSAND@@AMBERSAND@ return 0 
      ;;
    *)
  esac
  [[ -n "$state" ]] @AMBERSAND@@AMBERSAND@
  case "$state" in
  
    mavengoals)
    tmp=(
    
    ]]>
  	
  	<j:set var="mavenSession" value="${context.getMavenSession()}"/>
  	<j:set var="allGoals" value="${mavenSession.getAllGoalNames()}"/>
  	<j:new var="modList" className="java.util.ArrayList"/>
  	<j:set var="dummy" value="${modList.addAll(allGoals)}"/>
          <j:invokeStatic method="sort" className="java.util.Collections" var="dummy">
              <j:arg type="java.util.List" value="${modList}" />
          </j:invokeStatic>
  
      <j:forEach var="goal" items="${modList.iterator()}">
       <j:set var="escgoal" value='${goal.replaceAll(":","\\:")}'/> 
  
  
        <j:choose>
          <j:when test="${maven.shell.zdh.nodesc = 'true'}">
             <j:set var="desc" value="${mavenSession.getGoalDescription(goal)}"/>
             <j:set var="escdesc" value='${desc.replaceAll(":","\\:")}'/>
             <j:set var="point" value="'"/>
             <j:set var="pointesc" value='"'/>
             <j:set var="escdesc" value='${escdesc.replaceAll(point,pointesc)}'/>
          '${escgoal}:${escdesc}'          
          </j:when>
          <j:otherwise>
          '${escgoal}'          
          </j:otherwise>
        </j:choose></j:forEach>
  
  
    <![CDATA[
     )
       _describe 'Maven Goals' tmp --
    ;;
    
    esac
    ]]>
     </j:file>
     
  	<echo>Now start a new zsh shell</echo>
  	
      <filter token="AMBERSAND" value="&amp;"/>
      <filter token="LESSER_THAN" value="&lt;"/>
      <filter token="GREATER_THAN" value="&gt;"/>
      <copy file="${maven.build.dir}/_mavenzsh.tmp" tofile="${outputDir}/_maven" filtering="true"/>
      <delete file="${maven.build.dir}/_mavenzsh.tmp"/>
  
  
  	
    </goal>
  
  </project>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  velocity.log
  maven.log
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <extend>${basedir}/../project.xml</extend>
    <pomVersion>3</pomVersion>
    <id>maven-shell-plugin</id>
    <name>Maven Shell Plug-in</name>
    <currentVersion>1.0</currentVersion>
    <description>A plugin to generate various files for different shells to allow tab completion for maven goals</description>
    <shortDescription>Shell Plugin for Maven</shortDescription>
    <url>http://jakarta.apache.org/turbine/maven/reference/plugins/shell/</url>
  
    <siteDirectory>/www/jakarta.apache.org/turbine/maven/reference/plugins/shell/</siteDirectory>
  
    <repository>
      <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-turbine-maven/src/plugins-build/shell/</connection>
      <url>http://cvs.apache.org/viewcvs/jakarta-turbine-maven/src/plugins-build/shell/</url>
    </repository>
  
    <developers>
      
      <developer>
        <name>Kasper Nielsen</name>
        <id>knielsen</id>
        <email>apache@kav.dk</email>
        <organization></organization>
        <roles>
          <role>Developer</role>
        </roles>
      </developer>
    </developers>
  </project>
  
  
  
  1.1                  jakarta-turbine-maven/src/plugins-build/shell/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  # -------------------------------------------------------------------
  # P L U G I N  P R O P E R I E S
  # -------------------------------------------------------------------
  # Shell plugin.
  # -------------------------------------------------------------------
  
  # Generate Eclipse external tools mappings for the specified goals.
  # This accepts two values: 'all' for all the goals, 
  # and 'plugins' to generate only the plugins' default goals.
  # maven.shell.zsh.dir= /usr/zsh/functions
  maven.shell.zsh.nodesc = true