Changeset 1126

Show
Ignore:
Timestamp:
12/06/07 20:28:30 (9 months ago)
Author:
richi
Message:

added phing targets for 'deploying' and checking coding standards ('phing copy-standards' & 'phing check-standards')

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.xml

    r696 r1126  
    4949    </if> 
    5050  </target> 
     51   
     52  <!-- workaround for PHP_CodeSniffer bug #11886 --> 
     53  <target name="copy-standards" description="copy stubbles standards into PHP_CodeSniffer 'Standards' dir"> 
     54    <phing phingfile="${build.base.dir}/stubbles/build.xml" target="copy-standards" inheritAll="false" /> 
     55  </target> 
     56   
     57  <target name="check-standards" description="check coding standards"> 
     58    <phing phingfile="${build.base.dir}/stubbles/build.xml" target="check-standards" inheritAll="false" /> 
     59  </target> 
    5160 
     61  <!-- deprecated --> 
    5262  <target name="check-style" description="check coding standards"> 
    5363    <echo>----------------------------------</echo> 
  • trunk/build/stubbles/build.xml

    r1074 r1126  
    222222    </delete> 
    223223  </target> 
    224  
     224   
     225  <!-- workaround for PHP_CodeSniffer bug #11886 --> 
     226  <target name="copy-standards" description="copy stubbles standards into PHP_CodeSniffer 'Standards' dir"> 
     227    <echo>----------------------------------</echo> 
     228    <echo>| Copy Coding Standards          |</echo> 
     229    <echo>----------------------------------</echo> 
     230    <php expression="exec('pear config-get php_dir');" returnProperty="pearDir"/> 
     231    <property name="codeSniffer.standardsDir" value="${pearDir}/PHP/CodeSniffer/Standards/stubbles"/> 
     232    <delete dir="${codeSniffer.standardsDir}" failonerror="true" /> 
     233    <copy toDir="${codeSniffer.standardsDir}" overwrite="true"> 
     234      <fileset dir="${project.basedir}/../../src/main/php/org/stubbles/codeSniffer/stubbles">  
     235        <include name="**/*.php" /> 
     236      </fileset> 
     237    </copy> 
     238  </target> 
     239   
     240  <target name="check-standards" description="check coding standards"> 
     241    <echo>----------------------------------</echo> 
     242    <echo>| Checking CS of source files    |</echo> 
     243    <echo>----------------------------------</echo> 
     244    <input propertyname="namespace" promptChar=":">which stubbles namespace should be checked</input> 
     245    <exec command="phpcs --standard=stubbles ${project.basedir}/../../src/main/php/net/stubbles/${namespace}" passthru="true"/> 
     246  </target> 
     247   
     248  <!-- deprecated --> 
    225249  <target name="check-style" description="check coding standards"> 
    226250    <echo>----------------------------------</echo>