Skip to content

Commit

Permalink
Upgraded to latest skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartherbert committed May 23, 2013
1 parent 8c71765 commit dd14aad
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -8,6 +8,6 @@ project.snapshot=false
checkstyle.standard=Zend

component.type=php-library
component.version=11
component.version=12

pear.local=/var/www/${project.channel}
124 changes: 103 additions & 21 deletions build.xml
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- build file for phing -->
<project default="help" basedir=".">
<!-- custom tasks -->
<taskdef name="now" classname="Phix_Project.ComponentManager.Phing.NowTask" />
<taskdef name="dedupe" classname="Phix_Project.ComponentManager.Phing.DedupeTask" />

<!-- Human-readable info about our component -->
<property file="build.properties" />
<taskdef name="now" classname="Phix_Project.ComponentManager.Phing.NowTask" />
<now name="date.now"/>
<if>
<and>
Expand Down Expand Up @@ -63,7 +66,7 @@
<property file="${project.distdir.lastBuilt}"/>
</then>
<else>
<property name="project.lastBuiltTarfile" value="false"/>
<property name="project.lastBuiltTarfile" value="false"/>
</else>
</if>

Expand All @@ -77,7 +80,7 @@
<exclude name="**/.empty"/>
<exclude name="**/.svn"/>
</fileset>
<fileset dir="${project.src.datadir}" id="datafiles">
<fileset dir="${project.src.datadir}" id="datafiles" defaultexcludes="false">
<include name="**/**"/>
<exclude name="**/.DS_Store"/>
<exclude name="**/.empty"/>
Expand Down Expand Up @@ -114,7 +117,7 @@

<taskdef name="phingcallifexists" classname="Phix_Project.ComponentManager.Phing.PhingCallIfExistsTask" />
<import file="build.local.xml"/>

<!-- Tell the user what this build file supports -->
<target name="help">
<echo message="${project.name} ${project.version}: build.xml targets:" />
Expand All @@ -139,6 +142,8 @@
<echo message=" Run code quality tests for PHP_CodeBrowser" />
<echo message=" phpcpd" />
<echo message=" Check for cut and paste problems" />
<echo message=" phploc" />
<echo message=" Calculate the size of your PHP project" />
<echo message=" phpdoc" />
<echo message=" Create the PHP docs from source code" />
<echo message="" />
Expand Down Expand Up @@ -217,7 +222,7 @@
</target>

<!-- Run the code review quality tests -->
<target name="code-review" depends="run-unittests, code-browser, phpcpd, pdepend">
<target name="code-review" depends="run-unittests, code-browser, phpcpd, pdepend, phploc">
<phingcallifexists target="local.code-review"/>
</target>

Expand Down Expand Up @@ -263,12 +268,37 @@
<exec command="phpcb --log ${project.review.logsdir} --source ${project.src.phpdir} --output ${project.review.codebrowserdir}" logoutput="true" />
</target>

<!-- Work out the size of the project -->
<target name="phploc">
<mkdir dir="${project.review.logsdir}" />
<exec command="phploc --log-xml ${project.review.logsdir}/phploc.xml --log-csv ${project.review.logsdir}/phploc.csv ${project.src.phpdir}" logoutput="true" />
</target>

<!-- Populate vendor with the dependencies for this component -->
<target name="build-vendor" depends="pear-package,setup-vendor">
<echo>Populating vendor/ with dependencies</echo>
<exec command="phix pear:register-channels" checkreturn="true" logoutput="true" />
<exec command="pear -c ${project.tmpdir}/pear-config install --alldeps ${project.tarfile}" logoutput="true" checkreturn="true"/>
<echo/>
<echo>Making sure vendor/ does not contain ${project.name}</echo>
<echo>Removing ${project.name}'s code from vendor/</echo>
<dedupe src="${project.srcdir}" from="${project.vendordir}"/>
<if>
<available file="${project.vendordir}/docs/${project.name}" type="dir"/>
<then>
<echo>Removing ${project.name}'s docs from vendor/</echo>
<delete dir="${project.vendordir}/docs/${project.name}"/>
</then>
</if>
<if>
<available file="${project.vendordir}/tests/${project.name}" type="dir"/>
<then>
<echo>Removing ${project.name}'s unit tests from vendor/</echo>
<dedupe src="${project.src.testunitdir}/php" from="${project.vendordir}/tests/${project.name}" />
<delete dir="${project.vendordir}/tests/${project.name}"/>
</then>
</if>
<echo/>
<echo>Your vendor/ folder has been built.</echo>
<echo>You only need to run 'phing build-vendor' again if you change the</echo>
<echo>dependencies listed in your package.xml file.</echo>
Expand Down Expand Up @@ -298,13 +328,55 @@
<echo>Building release directory</echo>
<delete dir="${project.builddir}" />
<mkdir dir="${project.pkgdir}" />
<if>
<available file="${project.src.bindir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="binfiles"/>
</copy>
</then>
</if>
<if>
<available file="${project.src.datadir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="datafiles"/>
</copy>
</then>
</if>
<if>
<available file="${project.src.docdir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="docfiles"/>
</copy>
</then>
</if>
<if>
<available file="${project.src.phpdir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="phpfiles"/>
</copy>
</then>
</if>
<if>
<available file="${project.src.testunitdir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="testfiles"/>
</copy>
</then>
</if>
<if>
<available file="${project.src.wwwdir}"/>
<then>
<copy todir="${project.pkgdir}">
<fileset refid="wwwfiles"/>
</copy>
</then>
</if>
<copy todir="${project.pkgdir}">
<fileset refid="binfiles"/>
<fileset refid="datafiles"/>
<fileset refid="phpfiles"/>
<fileset refid="testfiles"/>
<fileset refid="wwwfiles"/>
<fileset refid="docfiles"/>
<fileset refid="topleveldocfiles"/>
</copy>
<copy todir="${project.builddir}">
Expand All @@ -320,7 +392,7 @@
<mkdir dir="${project.distdir}" />
<delete file="${project.tarfile}" />
<tar destfile="${project.tarfile}" compression="gzip">
<fileset dir="${project.builddir}">
<fileset dir="${project.builddir}" defaultexcludes="false">
<include name="**/**" />
</fileset>
</tar>
Expand All @@ -341,18 +413,28 @@
<contains string="${project.lastBuiltTarfile}" substring="${project.name}"/>
</not>
<then>
<echo>Please run 'phing pear-package' first, then try again.</echo>
<fail message="Please run 'phing pear-package' first, then try again."/>
</then>
</if>

<if>
<not>
<available file="${project.vendordir"/>
</not>
<then>
<phingcall target="build-vendor" />
</then>
</if>
<if>
<available file="${project.lastBuiltTarfile}"/>
<then>
<exec command="pear -c ${project.tmpdir}/pear-config install --alldeps -f ${project.lastBuiltTarfile}" logoutput="true" checkreturn="true"/>
<phingcallifexists target="local.install-vendor"/>
</then>
<elseif>
<available file="${project.lastBuiltTarfile}"/>
<then>
<exec command="pear -c ${project.tmpdir}/pear-config install --alldeps -f ${project.lastBuiltTarfile}" logoutput="true" checkreturn="true"/>
<phingcallifexists target="local.install-vendor"/>
</then>
</elseif>
<else>
<echo>Cannot find PEAR package file ${project.lastBuiltTarfile}</echo>
<echo>Run 'phing pear-package' to create a new PEAR package, then try again</echo>
<fail message="Run 'phing pear-package' to create a new PEAR package, then try again."/>
</else>
</if>
</target>
Expand Down

0 comments on commit dd14aad

Please sign in to comment.