Skip to content
Permalink
Browse files

cleanup build.xml: remove unused, add lint target

  • Loading branch information
theseer committed Nov 14, 2019
1 parent 6e2f2ac commit 3b10f2e92d670924e7fdf9a7e9a7929d32d2cfd7
Showing with 13 additions and 78 deletions.
  1. +1 −0 .gitignore
  2. +12 −78 build.xml
@@ -8,3 +8,4 @@ phpunit.xml
vendor
composer
/tools
cache.properties
@@ -2,10 +2,8 @@

<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<delete dir="${basedir}/build/phar/_tmp" />

<delete>
@@ -15,56 +13,23 @@
</delete>

<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>

<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="phpunit">
<exec executable="${basedir}/tools/phpunit" failonerror="true"/>
</target>

<!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
<target name="parallelTasks">
<parallel>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
</parallel>
</target>

<!-- Generate jdepend.xml and software metrics charts -->
<target name="pdepend">
<exec executable="pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
--jdepend-chart=${basedir}/build/pdepend/dependencies.svg
--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
src"/>
</exec>
</target>
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />

<!-- Generate pmd.xml -->
<target name="phpmd">
<exec executable="phpmd">
<arg line="src xml codesize,design,naming,unusedcode --reportfile ${basedir}/build/logs/pmd.xml"/>
</exec>
</target>
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>

<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml src"/>
</exec>
</apply>
</target>

<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs" output="/dev/null">
<arg line="--report=checkstyle
--report-file=${basedir}/build/logs/checkstyle.xml
--standard=${basedir}/phpcs.xml
src"/>
</exec>
<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="phpunit">
<exec executable="${basedir}/tools/phpunit" failonerror="true"/>
</target>

<target name="phpab" description="Generate autoloader scripts">
@@ -77,37 +42,6 @@
</exec>
</target>

<target name="pear" depends="phar" description="Create a PEAR archive">
<delete dir="${basedir}/build/pear/_tmp"/>
<mkdir dir="${basedir}/build/pear/_tmp"/>

<exec executable="bash" outputproperty="version">
<arg value="-c" />
<arg value="git describe --tags --dirty" />
</exec>

<move file="${basedir}/build/phar/phpab-${version}.phar" tofile="${basedir}/build/pear/_tmp/phpab.phar" />

<copy todir="${basedir}/build/pear/_tmp">
<fileset dir="${basedir}">
<include name="phpab.bat"/>
<include name="package.xml" />
</fileset>
</copy>

<replace file="${basedir}/build/pear/_tmp/package.xml" token="%release%" value="${version}" />

<exec executable="bash" dir="${basedir}/build/pear/_tmp">
<arg value="-c" />
<arg value="pear package" />
</exec>

<move file="${basedir}/build/pear/_tmp/Autoload-${version}.tgz" todir="${basedir}/build/pear" />

<delete dir="${basedir}/build/pear/_tmp"/>

</target>

<target name="phar" description="Create PHAR archive of Autoload Builder and its dependencies">

<delete dir="${basedir}/build/phar/_tmp"/>
@@ -189,5 +123,5 @@

</target>

<target name="build" depends="clean,parallelTasks,phpunit"/>
<target name="build" depends="clean,lint,phpunit"/>
</project>

0 comments on commit 3b10f2e

Please sign in to comment.
You can’t perform that action at this time.