Skip to content

Instantly share code, notes, and snippets.

@derhansen derhansen/build.xml
Last active Aug 29, 2015

Embed
What would you like to do?
Example ANT file for a TYPO3 6.2 ExtBase extension to use with Jenkins CI
<project name="TYPO3-62-Extbase-Extension" default="build" basedir=".">
<property environment="env"/>
<target name="build" depends="init, tests, phpcs, phpmd, phpcpd, cleanup">
</target>
<target name="init">
<mkdir dir="${env.WORKSPACE}/build"/>
<mkdir dir="${env.WORKSPACE}/build/phpcs"/>
<mkdir dir="${env.WORKSPACE}/build/phpunit"/>
<mkdir dir="${env.WORKSPACE}/typo3_core"/>
</target>
<target name="tests">
<exec executable="git" failonerror="true">
<arg line="clone --single-branch --branch master --depth 1 https://github.com/TYPO3/TYPO3.CMS.git ${env.WORKSPACE}/typo3_core" />
</exec>
<exec executable="composer">
<arg line="install --working-dir ${env.WORKSPACE}/typo3_core" />
</exec>
<mkdir dir="${env.WORKSPACE}/typo3_core/uploads"/>
<mkdir dir="${env.WORKSPACE}/typo3_core/typo3temp"/>
<mkdir dir="${env.WORKSPACE}/typo3_core/typo3conf/ext"/>
<symlink link="${env.WORKSPACE}/typo3_core/typo3conf/ext/${env.JOB_NAME}" resource="${env.WORKSPACE}/${env.JOB_NAME}"/>
<exec executable="phpunit" dir="${env.WORKSPACE}/typo3_core">
<arg line="--log-junit ${env.WORKSPACE}/build/phpunit/unittests.xml --bootstrap typo3/sysext/core/Build/UnitTestsBootstrap.php typo3conf/ext/${env.JOB_NAME}/Tests/Unit" />
</exec>
<exec executable="${env.WORKSPACE}/typo3_core/bin/phpunit" dir="${env.WORKSPACE}/typo3_core">
<env key="TYPO3_PATH_WEB" value="${env.WORKSPACE}/typo3_core"/>
<env key="typo3DatabaseName" value="typo3"/>
<env key="typo3DatabaseHost" value="localhost"/>
<env key="typo3DatabaseUsername" value="root"/>
<env key="typo3DatabasePassword" value=""/>
<arg line="--log-junit ${env.WORKSPACE}/build/phpunit/functionaltests.xml --process-isolation --bootstrap typo3/sysext/core/Build/FunctionalTestsBootstrap.php typo3conf/ext/${env.JOB_NAME}/Tests/Functional" />
</exec>
</target>
<target name="phpcs">
<exec executable="phpcs">
<arg line="--report=checkstyle
--report-file=${env.WORKSPACE}/build/phpcs/checkstyle.xml
--standard=TYPO3CMS
--extensions=php,inc
${env.WORKSPACE}/${env.JOB_NAME}" />
</exec>
</target>
<target name="phpmd">
<exec executable="phpmd">
<arg line=" ${env.WORKSPACE}/${env.JOB_NAME} xml codesize,unusedcode,naming,design --reportfile ${env.WORKSPACE}/build/messdetector.xml --exclude Tests/" />
</exec>
</target>
<target name="phpcpd">
<exec executable="phpcpd">
<arg line=" --log-pmd ${env.WORKSPACE}/build/phpcpd.xml ${env.WORKSPACE}/${env.JOB_NAME}" />
</exec>
</target>
<target name="cleanup">
<symlink action="delete" link="${env.WORKSPACE}/typo3_core/typo3conf/ext/${env.JOB_NAME}" />
<delete dir="${env.WORKSPACE}/typo3_core"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.