| 264 | | <!-- workaround for PHP_CodeSniffer bug #11886 --> |
|---|
| 265 | | <target name="copy-standards" description="copy stubbles standards into PHP_CodeSniffer 'Standards' dir"> |
|---|
| 266 | | <echo>----------------------------------</echo> |
|---|
| 267 | | <echo>| Copy Coding Standards |</echo> |
|---|
| 268 | | <echo>----------------------------------</echo> |
|---|
| 269 | | <php expression="exec('pear config-get php_dir');" returnProperty="pearDir"/> |
|---|
| 270 | | <property name="codeSniffer.standardsDir" value="${pearDir}/PHP/CodeSniffer/Standards/Stubbles"/> |
|---|
| 271 | | <delete dir="${codeSniffer.standardsDir}" failonerror="true" /> |
|---|
| 272 | | <copy toDir="${codeSniffer.standardsDir}" overwrite="true"> |
|---|
| 273 | | <fileset dir="${stubbles.base.dir}/src/main/php/org/stubbles/codeSniffer/stubbles"> |
|---|
| 274 | | <include name="**/*.php" /> |
|---|
| 275 | | </fileset> |
|---|
| 276 | | </copy> |
|---|
| 277 | | </target> |
|---|
| 278 | | |
|---|
| 279 | | <target name="check-standards" description="check coding standards"> |
|---|
| | 264 | <target name="check-style" description="check coding standards with PHP_CodeSniffer"> |
|---|
| 284 | | <exec command="phpcs --standard=stubbles ${stubbles.base.dir}/src/main/php/net/stubbles/${namespace}" passthru="true"/> |
|---|
| 285 | | </target> |
|---|
| 286 | | |
|---|
| 287 | | <!-- deprecated --> |
|---|
| 288 | | <target name="check-style" description="check coding standards"> |
|---|
| 289 | | <echo>----------------------------------</echo> |
|---|
| 290 | | <echo>| Checking CS of source files |</echo> |
|---|
| 291 | | <echo>----------------------------------</echo> |
|---|
| 292 | | <checkStyle failonerror="true"> |
|---|
| 293 | | <fileset dir="${stubbles.base.dir}/src/main/php"> |
|---|
| 294 | | <include name="**/*.php" /> |
|---|
| 295 | | <exclude name="**/org/simpletest/**" /> |
|---|
| 296 | | <exclude name="**/info/**" /> |
|---|
| 297 | | <exclude name="**/de/**" /> |
|---|
| 298 | | </fileset> |
|---|
| 299 | | </checkStyle> |
|---|
| 300 | | </target> |
|---|
| | 269 | <!-- must be backslashes in first case or PHP_CodeSniffer doesn't find own sniffs --> |
|---|
| | 270 | <exec command="phpcs --standard=${stubbles.base.dir}\src\main\php\org\stubbles\codeSniffer\stubbles ${stubbles.base.dir}/src/main/php/net/stubbles/${namespace}" passthru="true"/> |
|---|
| | 271 | </target> |
|---|
| | 272 | |
|---|