antlets/checkstyle/src xbuild.xml,NONE,1.1 tasks.properties,NONE,1.1

[email protected] Wed, 25 Feb 2004 14:09:49 -0800
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/antlets/checkstyle/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14395/checkstyle/src

Added Files:
	xbuild.xml tasks.properties 
Log Message:
use get to retrieve jars from internet

--- NEW FILE: xbuild.xml ---
<?xml version="1.0"?>
<project default="checkstyle.report" name="checkstyle.antlet">
    <description>
      Checks that the sourcecode conforms to a specific coding convention and style.
      It can also be useful to check that every file has the correct license in it and
      appropriate javadocs.
    </description>

  <dirname property="checkstyle.antlet.dir" file="${ant.file.checkstyle.antlet}"/>
  <property name="checkstyle.antlet.build.dir" value="${project.build.dir}/checkstyle"/>  
  <property name="checkstyle.repository" value="http://www.ibiblio.org/maven/checkstyle/jars/"/>
  <property name="checkstyle.jar" value="checkstyle-3.3.jar"/>
  <property name="checkstyle-optional.jar" value="checkstyle-optional-3.3.jar"/>
  <property name="antlr.repository" value="http://www.ibiblio.org/maven/antlr/jars/"/>
  <property name="antlr.jar" value="antlr-2.7.1.jar"/>
  <property name="regexp.repository" value="http://www.ibiblio.org/maven/regexp/jars/"/>
  <property name="regexp.jar" value="regexp-1.3.jar"/>
  <property name="commons-beanutils.repository" value="http://www.ibiblio.org/maven/commons-beanutils/jars/"/>
  <property name="commons-beanutils.jar" value="commons-beanutils-1.6.jar"/>
  <property name="commons-collections.repository" value="http://www.ibiblio.org/maven/commons-collections/jars/"/>
  <property name="commons-collections.jar" value="commons-collections-2.1.jar"/>
  <property name="commons-logging.repository" value="http://www.ibiblio.org/maven/commons-logging/jars/"/>
  <property name="commons-logging.jar" value="commons-logging-1.0.3.jar"/>


	<target name="-checkstyle.init">
      <property name="checkstyle.antlet.xdocs.dir" value="${build.dir}/documentation/content/xdocs/reports"/> 

    <mkdir dir="${checkstyle.antlet.build.dir}"/>
    <mkdir dir="${checkstyle.antlet.dir}/lib"/>

    <get
         src="${checkstyle.repository}${checkstyle.jar}"
         dest="${checkstyle.antlet.dir}/lib/${checkstyle.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${checkstyle.repository}${checkstyle-optional.jar}"
         dest="${checkstyle.antlet.dir}/lib/${checkstyle-optional.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${antlr.repository}${antlr.jar}"
         dest="${checkstyle.antlet.dir}/lib/${antlr.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${regexp.repository}${regexp.jar}"
         dest="${checkstyle.antlet.dir}/lib/${regexp.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${commons-beanutils.repository}${commons-beanutils.jar}"
         dest="${checkstyle.antlet.dir}/lib/${commons-beanutils.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${commons-collections.repository}${commons-collections.jar}"
         dest="${checkstyle.antlet.dir}/lib/${commons-collections.jar}"
         verbose="true" usetimestamp="true"/>
    <get
         src="${commons-logging.repository}${commons-logging.jar}"
         dest="${checkstyle.antlet.dir}/lib/${commons-logging.jar}"
         verbose="true" usetimestamp="true"/>

	    <!-- Classpath for my jars -->
	    <path id="checkstyle.classpath">
	       <fileset dir="${checkstyle.antlet.dir}/lib">
	         <include name="*.jar"/>
	       </fileset>
	    </path>
	    <taskdef file="${checkstyle.antlet.dir}/tasks.properties" classpathref="checkstyle.classpath"/>
    </target>

    <target name="checkstyle.xml" 
    	    depends="-checkstyle.init"
    	    description="Checks the style of the sourcecode">

        <dirname property="checkstyle.antlet.src.basedir" file="${basedir}/${project.src.dir}/foo.txt"/> 

        <echo message="source dir is ${checkstyle.antlet.src.basedir}"/>

        <!-- if the property file is set in properties.xml prepend the
        basedir to it otherwise use the cents default properties file -->
        <condition property="checkstyle.properties"
          value="${basedir}/${centipede.tools.antlets.checkstyle.properties}">
          <isset
            property="centipede.tools.antlets.checkstyle.properties"/>
        </condition>
        
        <!-- The path to the the checkstyle properties file-->
        <property name="checkstyle.properties"
            value="${checkstyle.antlet.dir}/conf/checkstyle.properties"/>

        
        <!-- Halt if an error is found during validation -->
        <property name="centipede.tools.antlets.checkstyle.failOnViolation"
            value="false">
        </property>

		<!-- properties="${checkstyle.properties}" -->
        <checkstyle config="${checkstyle.antlet.dir}/conf/sun_checks.xml"
            failOnViolation="${centipede.tools.antlets.checkstyle.failOnViolation}">
            <property key="checkstyle.basedir"
            value="${checkstyle.antlet.src.basedir}"/>
            <property key="checkstyle.cache.file" value="${checkstyle.antlet.build.dir}/checkstyle.cache"/>
            <formatter type="xml" toFile="${checkstyle.antlet.build.dir}/checkstyle_errors.xml"/>

            <fileset dir="${project.src.dir}">
                <include name="**/*.java"/>
            </fileset>

        </checkstyle>
	</target>
	
	<target name="checkstyle.report" depends="checkstyle.xml">
        <!-- Make  report xdoc -->
        <style in="${checkstyle.antlet.build.dir}/checkstyle_errors.xml"
               out="${checkstyle.antlet.xdocs.dir}/checkstyle.xml"
               style="${checkstyle.antlet.dir}/resources/stylesheets/checkstyle2xdocs.xsl">
               <param name="basedir" expression="${checkstyle.antlet.src.basedir}"/>
        </style>
    </target>

    <target name="checkstyle-screen-output" 
    	    depends="-checkstyle.init"
    	    description="Checkes the style of the sourcecode and outputs results 
          to the screen for integratiion into a development environment">

        <!-- if the property file is set in properties.xml prepend the
        basedir to it otherwise use the cents default properties file -->
        <condition property="checkstyle.properties"
          value="${basedir}/${centipede.tools.antlets.checkstyle.properties}">
          <isset
            property="centipede.tools.antlets.checkstyle.properties"/>
        </condition> 
                
        <!-- The path to the the checkstyle properties file-->
        <property name="checkstyle.properties"
            value="${checkstyle.antlet.dir}/conf/checkstyle.properties"/>

        <!-- Halt if an error is found during validation -->
        <property name="centipede.tools.antlets.checkstyle.failOnViolation"
            value="false"/>

        <checkstyle properties="${checkstyle.properties}"
            failOnViolation="${centipede.tools.antlets.checkstyle.failOnViolation}">
            <property key="checkstyle.cache.file" value="${checkstyle.antlet.build.dir}/checkstyle.cache"/>

            <fileset dir="${project.src.dir}">
                <include name="**/*.java"/>
            </fileset>

        </checkstyle>

        
    </target>

</project>

--- NEW FILE: tasks.properties ---

#checkstyle tasks
checkstyle=com.puppycrawl.tools.checkstyle.CheckStyleTask





-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click