Changeset 1844

Show
Ignore:
Timestamp:
09/26/08 11:25:41 (3 months ago)
Author:
mikey
Message:

overhaul check-style target

Files:

Legend:

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

    r1836 r1844  
    362362  </target> 
    363363 
    364   <target name="checkstyle-pathcheck" unless="check-style.path"> 
    365     <input propertyname="check-style.path" defaultValue="main" validArgs="main,test" promptChar=":">which check path should be used</input> 
    366   </target> 
    367    
    368   <target name="checkstyle-namespacecheck" unless="check-style.namespace"> 
    369     <input propertyname="check-style.namespace" defaultValue="" promptChar=":">which stubbles namespace should be checked</input> 
    370   </target> 
    371    
    372   <target name="check-style" description="check coding standards" depends="checkstyle-pathcheck,checkstyle-namespacecheck"> 
     364  <target name="check-style" description="check coding standards"> 
    373365    <echo>----------------------------------</echo> 
    374366    <echo>| Checking CS of source files    |</echo> 
    375367    <echo>----------------------------------</echo> 
    376     <echo message="'check-style.path' is set to '${check-style.path}'"/> 
    377     <echo message="'check-style.namespace' is set to '${check-style.namespace}' ('' = all)"/> 
    378     <echo message="Ensure that the Stubbles Coding Standard is installed via PEAR (see http://svn.stubbles.net/dev/forge/codeSniffer/build)"/> 
    379     <exec command="phpcs --standard=Stubbles ${stubbles.base.dir}/src/${check-style.path}/php/net/stubbles/${check-style.namespace}" passthru="true"/> 
     368    <exec command="phpcs -i > phpcs.txt"/> 
     369    <php expression="preg_match('/Stubbles/', file_get_contents('phpcs.txt'));" returnProperty="cs.installed"/> 
     370    <delete file="phpcs.txt"/> 
     371    <if> 
     372      <istrue value="${cs.installed}"/> 
     373      <then> 
     374        <if> 
     375          <not> 
     376            <isset property="check-style.path"/> 
     377          </not> 
     378          <then> 
     379            <input propertyname="check-style.path" defaultValue="main" validArgs="main,test" promptChar=":">which check path should be used</input> 
     380          </then> 
     381        </if> 
     382        <if> 
     383          <not> 
     384            <isset property="check-style.namespace"/> 
     385          </not> 
     386          <then> 
     387            <input propertyname="check-style.namespace" defaultValue="" promptChar=":">which stubbles namespace should be checked</input> 
     388          </then> 
     389        </if> 
     390        <echo message="'check-style.path' is set to '${check-style.path}'"/> 
     391        <echo message="'check-style.namespace' is set to '${check-style.namespace}' ('' = all)"/> 
     392        <exec command="phpcs --standard=Stubbles ${stubbles.base.dir}/src/${check-style.path}/php/net/stubbles/${check-style.namespace}" passthru="true"/> 
     393      </then> 
     394      <else> 
     395        <echo message="Ensure that the Stubbles Coding Standard is installed via PEAR, see http://stubbles.net/wiki/Dev/CodingGuidelines/Tools"/> 
     396      </else> 
     397    </if> 
    380398  </target> 
    381399