smor        2002/07/10 15:25:10

  Modified:    src/plugins/checkstyle plugin.jelly
  Log:
  Now, the "checkstyle" goal checks if the LICENSE.txt file exists.
  If it doesn't, it shows a warning and does not attempt to run
  "checkstyle:generate-report".
  
  Revision  Changes    Path
  1.7       +28 -1     jakarta-turbine-maven/src/plugins/checkstyle/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/checkstyle/plugin.jelly,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- plugin.jelly      8 Jul 2002 16:47:24 -0000       1.6
  +++ plugin.jelly      10 Jul 2002 22:25:10 -0000      1.7
  @@ -20,7 +20,7 @@
   
     <goal name="checkstyle"
           description="Generate code convention conformance reports"
  -        prereqs="checkstyle:generate-report"/>
  +        prereqs="checkstyle:check-license-file"/>
   
     <goal 
       name="checkstyle:generate-report"
  @@ -54,6 +54,33 @@
       </dvsl>
   
       </j:if>
  +
  +  </goal>
  +
  +  <goal name="checkstyle:check-license-file"
  +        description="Checks the existence of the LICENSE.txt file">
  +
  +    <available file="${basedir}/LICENSE.txt" 
  +      property="maven.checkstyle.license.exists"/>
  +    <j:set var="licenseExists" value="${maven.checkstyle.license.exists}X"/>
  +
  +    <j:when test="${licenseExists == 'X'}">
  +      <echo>
  +        =======================================================================
  +        =                             W A R N I N G                           =
  +        =======================================================================
  +        =  Your project doesn't contain any LICENSE.txt file. Checktyle needs =
  +        =  it to check the existence of the License in your source files. If  =
  +        =  it can't find this file, it throws an error.                       =
  +        =  A temporary solution is to create an empty LICENSE.txt file.       =
  +        =  Though, we recommend that you edit this License.                   =
  +        =======================================================================
  +      </echo>
  +    </j:when>
  +
  +    <j:when test="${maven.checkstyle.license.exists}">
  +      <attainGoal name="checkstyle:generate-report"/>
  +    </j:when>
   
     </goal>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to