You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2003/11/25 16:56:18 UTC

cvs commit: maven-plugins/genapp plugin.jelly

jvanzyl     2003/11/25 07:56:18

  Modified:    genapp   plugin.jelly
  Log:
  o applying patches for
  
    MAVEN-1045
    MAVEN-1046
  
  Revision  Changes    Path
  1.4       +30 -15    maven-plugins/genapp/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/genapp/plugin.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.jelly	25 Aug 2003 09:43:14 -0000	1.3
  +++ plugin.jelly	25 Nov 2003 15:56:18 -0000	1.4
  @@ -15,24 +15,28 @@
        |
        -->
       <define:tag name="generate">
  -      <!-- Get the template -->
  -      <!-- create a temporary variable with no dots in the name to get around a jexl bug -->
  -      <j:set var="presettemplate" value="${template}"/>
  -      <j:if test="${empty(presettemplate)}">
  -        <i:ask question="${maven.genapp.prompt.template}" answer="template" default="${maven.genapp.default.template}"/>
  -      </j:if>
  -      
  -      <!-- If template is in the user's home directory, use it -->    
  -      <u:available file="${user.home}/.maven/template/${template}">
  -        <j:set var="maven.genapp.template.dir" value="${user.home}/.maven/template/${template}"/>
  -      </u:available>
  -      
  +      <!-- If a template directory is provided directly, then use it (and don't ask)! -->
         <j:set var="currenttemplatedir" value="${maven.genapp.template.dir}"/>
         <j:if test="${empty(currenttemplatedir)}">
  -        <!-- The template was not found in user.home, check in the plugin resources -->
  -        <u:available file="${plugin.resources}/${template}">
  -          <j:set var="maven.genapp.template.dir" value="${plugin.resources}/${template}"/>
  +        <!-- Get the template -->
  +        <!-- create a temporary variable with no dots in the name to get around a jexl bug -->
  +        <j:set var="presettemplate" value="${template}"/>
  +        <j:if test="${empty(presettemplate)}">
  +          <i:ask question="${maven.genapp.prompt.template}" answer="template" default="${maven.genapp.default.template}"/>
  +        </j:if>
  +      
  +        <!-- If template is in the user's home directory, use it -->    
  +        <u:available file="${user.home}/.maven/template/${template}">
  +          <j:set var="maven.genapp.template.dir" value="${user.home}/.maven/template/${template}"/>
           </u:available>
  +      
  +        <j:set var="currenttemplatedir" value="${maven.genapp.template.dir}"/>
  +        <j:if test="${empty(currenttemplatedir)}">
  +          <!-- The template was not found in user.home, check in the plugin resources -->
  +          <u:available file="${plugin.resources}/${template}">
  +            <j:set var="maven.genapp.template.dir" value="${plugin.resources}/${template}"/>
  +          </u:available>
  +        </j:if>
         </j:if>
         
         <j:set var="currenttemplatedir" value="${maven.genapp.template.dir}"/>
  @@ -117,6 +121,17 @@
             <j:forEach var="res" items="${maven.genapp.repackage.split}">
               <exclude name="src/${res}/**"/>
             </j:forEach>
  +        </ant:fileset>
  +      </ant:copy>
  +	  
  +      <!-- copy config files normally excluded by Ant default excludes -->
  +      <ant:copy todir="${basedir}">
  +        <ant:fileset dir="${maven.genapp.resources}" defaultexcludes="no">
  +          <ant:include name="**/.*"/>
  +          <ant:exclude name="**/.svn/**"/>
  +          <ant:exclude name="**/*~"/>
  +          <ant:exclude name="**/*.bak"/>
  +          <ant:exclude name="**/*.swp"/>
           </ant:fileset>
         </ant:copy>
         
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org