Advertisement
Guest User

Untitled

a guest
Oct 10th, 2010
4,809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 10.34 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="Application" default="build" basedir="../">
  3.  
  4.     <target name="build" depends="prepare,phpunit,phpmd,phpcpd,phpdoc,phpcb,phpdcd,phploc,phpcs"/>
  5.  
  6.     <property name="applicationDir" value="${basedir}/source" />
  7.     <property name="buildDir" value="${basedir}/build" />
  8.    
  9.     <target name="prepare">
  10.         <mkdir dir="${buildDir}/logs" />
  11.         <mkdir dir="${buildDir}/html/phpdoc" />
  12.         <mkdir dir="${buildDir}/html/phpcb" />
  13.         <mkdir dir="${buildDir}/html/phpcov" />
  14.         <mkdir dir="${buildDir}/html/phpunit" />
  15.     </target>
  16.  
  17.     <target name="phpunit" description="PHPUnit">
  18.         <property name="phpunitLogs" value="${applicationDir}/tests/logs" />
  19.         <property name="junit" value="${phpunitLogs}/phpunit.xml" />
  20.         <exec dir="${basedir}" executable="phpunit" failonerror="false" osfamily="unix" output="${buildDir}/logs/phpunit.txt">
  21.             <arg line="--configuration ${applicationDir}/tests/phpunit.xml"/>
  22.         </exec>    
  23.         <exec dir="${applicationDir}\tests" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phpunit.txt">
  24.             <arg line="/c phpunit.bat" />
  25.             <arg line="--configuration ${applicationDir}\tests\phpunit.xml" />
  26.         </exec>
  27.         <echo message="##teamcity[importData type='junit' path='${junit}']" />
  28.         <zip destfile="${phpunitLogs}/coverage.zip" basedir="${phpunitLogs}/coverage"/>
  29.         <delete dir="${phpunitLogs}/coverage"/>
  30.         <echo message="##teamcity[publishArtifacts '${phpunitLogs}']" />
  31.     </target>
  32.    
  33.     <target name="phpmd" description="PHP Mess Detector">
  34.         <property name="pmd" value="${buildDir}/logs/phpmd.xml" />
  35.         <exec dir="${applicationDir}" executable="phpmd" failonerror="false" osfamily="unix">
  36.             <arg line="${applicationDir}" />
  37.             <arg line="xml" />
  38.             <arg line="naming,unusedcode,codesize" />
  39.             <arg line="--reportfile ${pmd}" />
  40.         </exec>
  41.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows">
  42.             <arg line="/c phpmd.bat" />
  43.             <arg line="${applicationDir}" />
  44.             <arg line="xml" />
  45.             <arg line="naming,unusedcode,codesize" />
  46.             <arg line="--reportfile ${pmd}" />
  47.         </exec>
  48.         <echo message="##teamcity[importData type='pmd' path='${pmd}']"/>
  49.     </target>
  50.    
  51.     <target name="phpcpd" description="Copy/Paste Detector">
  52.         <property name="phpcpd" value="${buildDir}/logs/phpcpd.xml" />
  53.         <exec dir="${applicationDir}" executable="phpcpd" failonerror="false" osfamily="unix" output="${buildDir}/logs/phpcpd.txt">
  54.             <arg line="--log-pmd ${phpcpd}" />
  55.             <arg line="${applicationDir}" />
  56.         </exec>
  57.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phpcpd.txt">
  58.             <arg line="/c phpcpd.bat" />
  59.             <arg line="--log-pmd ${phpcpd}" />
  60.             <arg line="${applicationDir}" />
  61.         </exec>
  62.         <echo message="##teamcity[importData type='pmd' path='${phpcpd}']"/>
  63.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpcpd.txt']" />
  64.         <echo message="##teamcity[publishArtifacts '${phpcpd}']" />
  65.     </target>
  66.    
  67.     <target name="phpdoc" description="PhpDocumentor">
  68.         <!--
  69.         @todo Use useconfig argument.
  70.         -->
  71.         <exec dir="${applicationDir}" executable="phpdoc" failonerror="false" osfamily="unix">
  72.             <arg line="--directory ${applicationDir}" />
  73.             <arg line="--target ${buildDir}/html/phpdoc" />
  74.             <arg line="--quiet off" />
  75.             <arg line="--undocumentedelements on" />
  76.             <arg line="--title Application" />
  77.             <arg line="--parseprivate on" />
  78.             <arg line="--output HTML:Smarty:PHP" />
  79.             <arg line="--sourcecode on" />
  80.         </exec>
  81.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows">
  82.             <arg line="/c phpdoc.bat" />
  83.             <arg line="--directory ${applicationDir}" />
  84.             <arg line="--target ${buildDir}\html\phpdoc" />
  85.             <arg line="--quiet off" />
  86.             <arg line="--undocumentedelements on" />
  87.             <arg line="--title Application" />
  88.             <arg line="--parseprivate on" />
  89.             <arg line="--output HTML:Smarty:PHP" />
  90.             <arg line="--sourcecode on" />
  91.         </exec>
  92.         <zip destfile="${buildDir}/phpdoc.zip" basedir="${buildDir}/html/phpdoc" />
  93.         <echo message="##teamcity[publishArtifacts '${buildDir}/phpdoc.zip']" />
  94.         <delete dir="${buildDir}/html/phpdoc"/>
  95.     </target>
  96.        
  97.     <target name="pdepend" description="PHP_Depend">
  98.         <!--
  99.         @todo Use configuration=<file> argument.
  100.         -->
  101.         <exec dir="${applicationDir}" executable="pdepend" failonerror="false" osfamily="unix">
  102.             <arg line="--jdepend-chart=${buildDir}/logs/pdepend.jdepend.chart.png" />
  103.             <arg line="--jdepend-xml=${buildDir}/logs/pdepend.jdepend.xml"></arg>
  104.             <arg line="--overview-pyramid=${buildDir}/logs/pdepend.overview.pyramid.png"></arg>
  105.             <arg line="--phpunit-xml=${buildDir}/logs/pdepend.phpunit.xml"></arg>
  106.             <arg line="--summary-xml=${buildDir}/logs/pdepend.summary.xml"></arg>
  107.             <arg line="--coverage-report=${buildDir}/logs/phpunit.clover.xml"></arg>
  108.             <arg line="--coderank-mode=inheritance,property,method"></arg>
  109.             <arg line="${applicationDir}"></arg>
  110.         </exec>
  111.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows">
  112.             <arg line="/c pdepend.bat" />
  113.             <arg line="--jdepend-chart=${buildDir}\logs\pdepend.jdepend.chart.png"></arg>
  114.             <arg line="--jdepend-xml=${buildDir}\logs\pdepend.jdepend.xml"></arg>
  115.             <arg line="--overview-pyramid=${buildDir}\logs\pdepend.overview.pyramid.png"></arg>
  116.             <arg line="--phpunit-xml=${buildDir}\logs\pdepend.phpunit.xml"></arg>
  117.             <arg line="--summary-xml=${buildDir}\logs\pdepend.summary.xml"></arg>
  118.             <arg line="--coverage-report=${buildDir}\logs\phpunit.clover.xml"></arg>
  119.             <arg line="--coderank-mode=inheritance,property,method"></arg>
  120.             <arg line="${applicationDir}"></arg>
  121.         </exec>
  122.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/pdepend.jdepend.chart.png']" />
  123.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/pdepend.jdepend.xml']" />
  124.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/pdepend.overview.pyramid.png']" />
  125.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/pdepend.phpunit.xml']" />
  126.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/pdepend.summary.xml']" />
  127.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpunit.clover.xml']" />
  128.     </target>
  129.    
  130.     <target name="phpcs" description="PHP_CodeSniffer">
  131.         <exec dir="${applicationDir}" executable="phpcs" failonerror="false" osfamily="unix" output="${buildDir}/logs/phpcs.txt">
  132.             <arg line="--tab-width=4" />
  133.             <arg line="--report=full" />
  134.             <arg line="--standard=PEAR" />
  135.             <arg line="--report-file=${buildDir}/logs/phpcs.xml" />
  136.             <arg line="${applicationDir}" />
  137.         </exec>
  138.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phpcs.txt">
  139.             <arg line="/c phpcs.bat" />
  140.             <arg line="--tab-width=4" />
  141.             <arg line="--report=full" />
  142.             <arg line="--standard=PEAR" />
  143.             <arg line="--report-file=${buildDir}\logs\phpcs.xml" />
  144.             <arg line="${applicationDir}" />
  145.         </exec>
  146.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpcs.xml']" />
  147.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpcs.txt']" />
  148.     </target>
  149.    
  150.     <target name="phpcb" description="PHP_CodeBrowser">
  151.         <exec dir="${applicationDir}" executable="phpcb" failonerror="false" osfamily="unix">
  152.             <arg line="--log ${buildDir}/logs" />
  153.             <arg line="--source ${applicationDir}" />
  154.             <arg line="--output ${buildDir}/html/phpcb" />
  155.         </exec>
  156.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows">
  157.             <arg line="/c phpcb.bat" />
  158.             <arg line="--log ${buildDir}\logs" />
  159.             <arg line="--source ${applicationDir}" />
  160.             <arg line="--output ${buildDir}\html\phpcb" />
  161.         </exec>
  162.         <zip destfile="${buildDir}/html/phpcb.zip" basedir="${buildDir}/html/phpcb" />
  163.         <echo message="##teamcity[publishArtifacts '${buildDir}/html/phpcb.zip']" />
  164.         <delete dir="${buildDir}/html/phpcb"/>
  165.     </target>
  166.    
  167.     <target name="phploc" description="Tool for quickly measuring the size of a PHP project">
  168.         <exec dir="${applicationDir}" executable="phploc" failonerror="false" osfamily="unix" output="${buildDir}/logs/phploc.txt">
  169.             <arg line="--count-tests" />
  170.             <arg line="--log-xml ${buildDir}/logs/phploc.xml" />
  171.             <arg line="${applicationDir}" />
  172.         </exec>
  173.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phploc.txt">
  174.             <arg line="/c phploc.bat" />
  175.             <arg line="--count-tests" />
  176.             <arg line="--log-xml ${buildDir}\logs\phploc.xml" />
  177.             <arg line="${applicationDir}" />
  178.         </exec>
  179.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phploc.xml']" />
  180.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phploc.txt']" />
  181.     </target>
  182.  
  183.     <target name="phpdcd" description="PHP Dead Code Detector">
  184.         <exec dir="${applicationDir}" executable="phpdcd" failonerror="false" osfamily="unix" output="${buildDir}/logs/phpdcd.txt">
  185.             <arg line="--recursive" />
  186.             <arg line="${applicationDir}" />
  187.         </exec>
  188.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phpdcd.txt">
  189.             <arg line="/c phpdcd.bat" />
  190.             <arg line="--recursive" />
  191.             <arg line="${applicationDir}" />
  192.         </exec>
  193.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpdcd.txt']" />
  194.     </target>
  195.  
  196.     <target name="phpcov" description="PHP Code Coverage">
  197.         <exec dir="${applicationDir}" executable="phpcov" failonerror="false" osfamily="unix" output="${buildDir}/logs/phpdcd.txt">
  198.             <arg line="--clover ${buildDir}/logs/phpcov.clover.xml" />
  199.             <arg line="--html ${buildDir}/html/phpcov" />
  200.             <arg line="${applicationDir}" />
  201.         </exec>
  202.         <exec dir="${applicationDir}" executable="cmd" failonerror="false" osfamily="windows" output="${buildDir}\logs\phpdcd.txt">
  203.             <arg line="/c phpcov.bat" />
  204.             <arg line="--clover ${buildDir}\logs\phpcov.clover.xml" />
  205.             <arg line="--html ${buildDir}\html\phpcov" />
  206.             <arg line="${applicationDir}" />
  207.         </exec>
  208.         <echo message="##teamcity[publishArtifacts '${buildDir}/logs/phpcov.clover.xml']" />
  209.         <zip destfile="${buildDir}/phpcov.zip" basedir="${buildDir}/html/phpcov"/>
  210.         <delete dir="${buildDir}/html/phpcov"/>
  211.         <echo message="##teamcity[publishArtifacts '${buildDir}/phpcov.zip']" />
  212.     </target>
  213.  
  214.     <target name="padawan" description="PHP AST-based Detection of Antipatterns, Workarounds And general Nuisances">
  215.     </target>
  216. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement