Changeset 1564

Show
Ignore:
Timestamp:
04/28/08 10:44:02 (3 weeks ago)
Author:
richi
Message:

check-style: added support for running check-style without user interaction (via -Dcheck-style.namespace= -Dcheck-style.path=main)

Files:

Legend:

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

    r1397 r1564  
    7676  </target> 
    7777 
    78   <target name="check-style" description="check coding standards"> 
     78  <target name="checkstyle-pathcheck" unless="check-style.path"> 
     79    <input propertyname="check-style.path" defaultValue="main" validArgs="main,test" promptChar=":">which check path should be used</input> 
     80  </target> 
     81   
     82  <target name="checkstyle-namespacecheck" unless="check-style.namespace"> 
     83    <input propertyname="check-style.namespace" defaultValue="" promptChar=":">which stubbles namespace should be checked</input> 
     84  </target> 
     85   
     86  <target name="check-style" description="check coding standards" depends="checkstyle-pathcheck,checkstyle-namespacecheck"> 
     87    <echo message="'check-style.path' is set to '${check-style.path}'"/> 
     88    <echo message="'check-style.namespace' is set to '${check-style.namespace}' ('' = all)"/> 
    7989    <phing phingfile="${build.base.dir}/stubbles/build.xml" target="check-style" /> 
    8090  </target> 
  • trunk/build/stubbles/build.xml

    r1550 r1564  
    399399  </target> 
    400400   
    401   <target name="check-style" description="check coding standards with PHP_CodeSniffer"
     401  <target name="check-style" description="check coding standards with PHP_CodeSniffer" if="check-style.path,check-style.namespace"
    402402    <echo>----------------------------------</echo> 
    403403    <echo>| Checking CS of source files    |</echo> 
    404404    <echo>----------------------------------</echo> 
    405     <property name="check.path" value="main"/> 
    406     <echo message="currently 'check.path' is set to '${check.path}'"/> 
    407     <input propertyname="namespace" promptChar=":">which stubbles namespace should be checked</input> 
    408405    <if> 
    409406      <or> 
     
    413410      <then> 
    414411        <!-- normal slashes --> 
    415         <exec command="phpcs --standard=${stubbles.base.dir}/src/main/php/org/stubbles/codeSniffer/Stubbles ${stubbles.base.dir}/src/${check.path}/php/net/stubbles/${namespace}" passthru="true"/> 
     412        <exec command="phpcs --standard=${stubbles.base.dir}/src/main/php/org/stubbles/codeSniffer/Stubbles ${stubbles.base.dir}/src/${check-style.path}/php/net/stubbles/${check-style.namespace}" passthru="true"/> 
    416413      </then> 
    417414      <elseif> 
     
    419416        <then> 
    420417          <!-- must be backslashes in first case or PHP_CodeSniffer doesn't find own sniffs --> 
    421           <exec command="phpcs --standard=${stubbles.base.dir}\src\main\php\org\stubbles\codeSniffer\Stubbles ${stubbles.base.dir}/src/${check.path}/php/net/stubbles/${namespace}" passthru="true"/> 
     418          <exec command="phpcs --standard=${stubbles.base.dir}\src\main\php\org\stubbles\codeSniffer\Stubbles ${stubbles.base.dir}/src/${check-style.path}/php/net/stubbles/${check-style.namespace}" passthru="true"/> 
    422419        </then> 
    423420      </elseif>