Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

219 lines (179 sloc) 13.99 kb
<?xml version="1.0" encoding="UTF-8"?>
<project name="zikula" default="clean">
<!-- invokation
phing -f $WORKSPACE/source/build.xml clean prepare phpcs phpcb phpcpd phpunit pdepend phpmd docblox jsdoc build build_delete -Dworkspace=$WORKSPACE -Djob_name=$JOB_NAME -Dbuild_number=$BUILD_NUMBER -Dbuild_tag=$BUILD_TAG -Dbuild_id=$BUILD_ID -Dsvn_revision=$SVN_REVISION
# note phpcb must follow phpcs
-->
<!--
BUILD_NUMBER - The current build number, such as "153"
BUILD_ID - The current build id, (YYYY-MM-DD_hh-mm-ss)
JOB_NAME - Name of the project of this build, such as "foo"
BUILD_TAG - String of "jenkins-${JOBNAME}-${BUILD_NUMBER}".
WORKSPACE - The absolute path of the workspace.
SVN_REVISION - The revision this build is based on.
-->
<property name="builddir" value="${workspace}/build" />
<property name="sourcedir" value="${workspace}/source" />
<property name="package" value="${job_name}.build${build_number}" />
<property name="exportdir" value="${builddir}/export" />
<property name="archivedir" value="${builddir}/archive" />
<property name="packagepath" value="${exportdir}/${job_name}" />
<property name="checksumpath" value="${archivedir}/${package}-checksums" />
<property name="patchdir" value="${builddir}/patch" />
<property name="tmpdir" value="${builddir}/tmp" />
<property name="ignorepaths" value="vendor/*,lib/vendor/*,javascript/*,system/*,themes/*,install/*,lib/legacy,plugins/*" />
<property name="ownjslist" value="javascript/helpers/Zikula.js,javascript/helpers/Zikula.ImageViewer.js,javascript/helpers/Zikula.Tree.js,javascript/helpers/Zikula.itemlist.js,javascript/helpers/Zikula.UI.js,system/Admin/Resources/javascript/ajax.js,system/Admin/Resources/javascript/modifyconfig.js,system/Blocks/Resources/javascript/blocks.js,system/Blocks/Resources/javascript/contextmenu.js,system/Blocks/Resources/javascript/functions.js,system/Blocks/Resources/javascript/Zikula.Menutree.Tree.js,system/Categories/Resources/javascript/categories_admin_edit.js,system/Categories/Resources/javascript/categories_admin_view.js,system/Extensions/Resources/javascript/hookui.js,system/Groups/Resources/javascript/groups.js,system/Mailer/Resources/javascript/mailer_admin_modifyconfig.js,system/Mailer/Resources/javascript/mailer_admin_testconfig.js,system/PageLock/Resources/javascript/pagelock.js,system/Permissions/Resources/javascript/permissions.js,system/Search/Resources/javascript/search_user_form.js,system/SecurityCenter/Resources/javascript/securitycenter_admin_allowedhtm.js,system/SecurityCenter/Resources/javascript/securitycenter_admin_modifyconfig.js,system/SecurityCenter/Resources/javascript/securitycenter_admin_purifierconfig.js,system/Settings/Resources/javascript/settings_admin_modifyconfig.js,system/Settings/Resources/javascript/settings_admin_multilingual.js,system/Theme/Resources/javascript/form/form.js,system/Theme/Resources/javascript/form/form_tabbedpanelset.js,system/Theme/Resources/javascript/themeswitcher.js,system/Theme/Resources/javascript/theme_admin_modifyconfig.js,system/Users/Resources/javascript/users.js,system/Users/Resources/javascript/users_admin_modifyregistration.js,system/Users/Resources/javascript/Zikula.Users.NewUser.js,system/Users/Resources/javascript/Zikula.Users.LoginBlock.js,system/Users/Resources/javascript/Zikula.Users.PassMeter.js" />
<!-- need a second property since phpdoc doesn't respect wildcard patterns -->
<property name="docbloxignorepaths" value="vendor/,lib/vendor/,javascript/,system/" />
<property name="ignorefiletypes" value="*.css,*.js" />
<target name="clean">
<echo msg="Clean..." />
<delete dir="${builddir}" includeemptydirs="true" />
</target>
<target name="prepare">
<echo msg="Prepare..." />
<mkdir dir="${builddir}" />
<mkdir dir="${builddir}/logs" />
<mkdir dir="${builddir}/coverage" />
<mkdir dir="${builddir}/docs" />
<mkdir dir="${builddir}/phpcb" />
<mkdir dir="${builddir}/archive" />
<mkdir dir="${builddir}/export" />
<mkdir dir="${builddir}/patch" />
<mkdir dir="${builddir}/tmp" />
<mkdir dir="${builddir}/jsdoc" />
<echo msg="Downloading vendors..." />
<exec command="curl -s http://getcomposer.org/composer.phar > ${workspace}/source/composer.phar| php;chmod 755 ${workspace}/source/composer.phar;${workspace}/source/composer.phar --dev install" />
</target>
<!-- Build archives -->
<target name="build" depends="prepare">
<echo msg="Exporting for build..." />
<!-- ATTN export urls require manual edit -->
<exec command="cp -a ${workspace}/source/src ${packagepath}" />
<!--<delete dir="${packagepath}/themes/Admin" includeemptydirs="true" />-->
<!--<exec command="svn export https://github.com/zikula-modules/Legal.git/branches/release-2.0 ${builddir}/tmp/Legal" />-->
<!--<exec command="mv ${builddir}/tmp/Legal/src/modules/Legal ${packagepath}/modules" />-->
<!--<exec command="svn export https://github.com/zikula-modules/Profile.git/branches/release-1.6 ${builddir}/tmp/Profile" />-->
<!--<exec command="mv ${builddir}/tmp/Profile/src/modules/Profile ${packagepath}/modules" />-->
<!-- compress JS -->
<!--<foreach list="${ownjslist}" param="filename" target="compressownjs" />-->
<echo msg="Prepare permissions..." />
<!--<chmod file="${packagepath}/config/config.php" mode="0666" />-->
<!--<chmod file="${packagepath}/userdata" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/error_logs" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/view_cache" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/view_compiled" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/Theme_cache" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/Theme_compiled" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/Theme_Config" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/idsTmp" mode="0777" />-->
<!--<chmod file="${packagepath}/ztemp/purifierCache" mode="0777" />-->
<echo msg="Creating archive..." />
<!-- zip's don't play nicely in Phing - using direct command -->
<!-- exec escape="false" command="cd ${exportdir}; zip -D -r ${archivedir}/${package}.zip ." / -->
<zip destfile="${archivedir}/${package}.zip">
<fileset dir="${exportdir}/${job_name}">
<include name="**/**" />
</fileset>
</zip>
<!-- Use tar at commandline because phing tarballs don't support file chmod -->
<exec escape="false" command="cd ${exportdir}; tar cp ${job_name} > ${archivedir}/${package}.tar; gzip ${archivedir}/${package}.tar" />
<!-- tar destfile="${archivedir}/${package}.tar.gz" compression="gzip">
<fileset dir="${exportdir}/${job_name}">
<include name="**/**" />
</fileset>
</tar -->
<echo msg="Files copied and compressed in build directory OK!" />
<!-- ATTN phingcall target="build_patch" / -->
<phingcall target="build_checksums" />
</target>
<target name="build_delete">
<!-- clean up export dir, this is not needed (unless we are debugging) -->
<!-- delete dir="${packagepath}" includeemptydirs="true" -->
</target>
<target name="build_checksums">
<echo msg="Creating MD5 and SHA1 checksums..." />
<exec escape="false" command="echo -----------------md5sums----------------- > ${checksumpath}.tmp" />
<exec escape="false" command="md5sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
<exec escape="false" command="echo -----------------sha1sums----------------- >> ${checksumpath}.tmp" />
<exec escape="false" command="sha1sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
<exec escape="false" command="cat ${checksumpath}.tmp | sed 's!${archivedir}/!!g' > ${checksumpath}.txt" />
<delete file="${checksumpath}.tmp" />
</target>
<target name="build_patch">
<echo msg="Making patches...." />
<!-- get diffs for releases and save in ${tmpdir}/CHANGES file -->
<!-- ATTN urls require manual edit -->
<exec escape="false" command="svn diff https://code.zikula.org/svn/core/tags/Zikula-1.3.0 https://code.zikula.org/svn/core/branches/zikula-1.3/src@${svn_revision} --summarize | sort|uniq > ${tmpdir}/CHANGES" />
<!-- Remove lines that start with space (which means only a property change), or contain paths to deleted files -->
<exec escape="false" command="cat ${tmpdir}/CHANGES | sed -e '/^[ D]/d' >${tmpdir}/AM" />
<!-- List deleted files -->
<exec escape="false" command="cat ${tmpdir}/CHANGES | grep -e '^D' >${tmpdir}/DELETED.tmp" />
<!-- this needs to be the regex escaped of the OLD branch -->
<!-- ATTN url requires manual edit -->
<property name="patchregex" value="https://code.zikula.org/svn/core/tags/Zikula-1.3.0/" />
<!-- A or M, ignoring svn-property changes (2nd char), strip the svn-path from the remaining lines, store in ${tmpdir}/FILES -->
<exec escape="false" command="cat ${tmpdir}/AM | sed -e 's!^[AM]. *${patchregex}!!g' > ${tmpdir}/FILES" />
<exec escape="false" command="cat ${tmpdir}/DELETED.tmp | sed -e 's!${patchregex}!!g' > ${tmpdir}/DELETED" />
<!-- assemble patch -->
<exec escape="false" command="cd ${packagepath};for FILE in `cat ${tmpdir}/FILES`;do cp --parents $FILE ${patchdir};done" />
<!-- install folder is always required -->
<exec escape="false" command="svn export --force https://code.zikula.org/svn/core/branches/zikula-1.3/src/install@${svn_revision} ${patchdir}/install" />
<!-- zip's don't play nicely in Phing - using direct command -->
<exec escape="false" command="cd ${patchdir}; zip -D -r ${archivedir}/${package}.patch.zip ." />
</target>
<!-- Docblox documentor -->
<target name="docblox">
<echo msg="DocBlox..." />
<exec command="docblox project:run --directory ${sourcedir}/src/lib/dbobject,${sourcedir}/src/lib/i18n,${sourcedir}/src/lib/viewplugins,${sourcedir}/src/lib/StreamReader,${sourcedir}/src/lib/util,${sourcedir}/src/lib/Zikula --target ${builddir}/docs" escape="false" />
</target>
<!-- PHPDocumentor -->
<target name="phpdoc">
<echo msg="PHPDocumentor..." />
<exec command="phpdoc --directory ${sourcedir}/src/lib/dbobject,${sourcedir}/src/lib/i18n,${sourcedir}/src/lib/viewplugins,${sourcedir}/src/lib/StreamReader,${sourcedir}/src/lib/util,${sourcedir}/src/lib/Zikula --target ${builddir}/docs" escape="false" />
</target>
<!-- PHP copy/paste analysis -->
<target name="phpcpd">
<echo msg="PHP Copy/Paste..." />
<exec command="phpcpd --log-pmd ${builddir}/logs/phpcpd.xml --suffixes php --exclude ${ignorepaths} ${sourcedir}/src" escape="false" />
</target>
<!-- PHP MD analysis -->
<target name="phpmd">
<echo msg="PHP_MD..." />
<exec command="phpmd ${sourcedir}/src xml codesize --reportfile ${builddir}/logs/pmd.xml --ignore ${ignorepaths}" escape="false" />
</target>
<!-- PHP dependency checker -->
<target name="pdepend">
<!-- PHP dependency checker -->
<echo msg="PHP_Depend..." />
<exec command="pdepend --jdepend-xml=${builddir}/logs/jdepend.xml --jdepend-chart=${builddir}/logs/jdepend.png --phpunit-xml=${builddir}/logs/pdepend_phpunit.xml --overview-pyramid=${builddir}/logs/pdepend_pyramid.png --summary-xml=${builddir}/logs/pdepend_summary.xml --ignore=${ignorepaths} --optimization=best --suffix=php ${sourcedir}/src" escape="false" />
</target>
<!-- PHP CodeSniffer -->
<target name="phpcs">
<echo msg="PHP_CodeSniffer..." />
<exec command="phpcs --extensions=php --report=checkstyle --standard=Zikula --ignore=${ignorepaths} ${sourcedir}/src > ${builddir}/logs/phpcs.xml" escape="false" />
</target>
<!-- Unit Tests & coverage analysis -->
<target name="phpunit">
<echo msg="PHPUnit..." />
<exec command="phpunit -c ${sourcedir}/phpunit.dist.xml --log-junit ${builddir}/logs/phpunit.xml --coverage-clover ${builddir}/coverage/clover.xml --coverage-html ${builddir}/coverage/"/>
</target>
<!-- JSDoc -->
<target name="jsdoc">
<echo msg="JSDoc..." />
<exec command="cd /opt/jsdoc-toolkit; /opt/jsdoc-toolkit/jsrun.sh -t=/opt/jsdoc-toolkit/templates/jsdoc --directory=${builddir}/jsdoc ${sourcedir}/src/javascript/helpers"/>
<!-- exec command="cd ${builddir}/jsdoc;/opt/jsdoc-toolkit ${sourcedir}/src/javascript/helpers"/ -->
</target>
<!-- Code Browser -->
<target name="phpcb">
<echo msg="PHP_CodeBrowser on XML for voilations..." />
<exec command="phpcb --log ${builddir}/logs --output ${builddir}/phpcb" />
</target>
<!-- Compress own JS -->
<target name="compressownjs">
<echo msg="YUI_Compressor for JS files..." />
<!-- <exec command="BAREFILENAME=`echo ${filename}|sed 's/.js//g'`; /usr/bin/java -jar /var/lib/jenkins/yuicompressor-2.4.2.jar -o ${packagepath}/$BAREFILENAME-min.js ${packagepath}/${filename}" /> -->
<exec command="/usr/bin/java -jar /var/lib/jenkins/yuicompressor-2.4.2.jar -o ${packagepath}/${filename}.tmp ${packagepath}/${filename};echo '// Copyright Zikula Foundation 2010 - license GNU/LGPLv3 (or at your option, any later version).' > ${packagepath}/${filename};cat ${packagepath}/${filename}.tmp >> ${packagepath}/${filename};rm -f ${packagepath}/${filename}.tmp" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.