Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit f7bba59959addfbdf4865a3f2f7c614394753c8d 1 parent 6040b19
Drak authored
Showing with 234 additions and 0 deletions.
  1. +3 −0  .gitignore
  2. 0  README
  3. +231 −0 build.xml
View
3  .gitignore
@@ -0,0 +1,3 @@
+/nbproject/
+/nbproject/private/
+
View
0  README
No changes.
View
231 build.xml
@@ -0,0 +1,231 @@
+<?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="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/javascript/admin_admin_ajax.js,system/Admin/javascript/admin_admin_modifyconfig.js,system/Blocks/javascript/blocks.js,system/Blocks/javascript/contextmenu.js,system/Blocks/javascript/functions.js,system/Blocks/javascript/Zikula.Menutree.Tree.js,system/Categories/javascript/categories_admin_edit.js,system/Categories/javascript/categories_admin_view.js,system/Extensions/javascript/extendedhooks.js,system/Extensions/javascript/hooks.js,system/Extensions/javascript/hookui.js,system/Groups/javascript/groups.js,system/Mailer/javascript/mailer_admin_modifyconfig.js,system/Mailer/javascript/mailer_admin_testconfig.js,system/PageLock/javascript/pagelock.js,system/Permissions/javascript/permissions.js,system/Search/javascript/search_user_form.js,system/SecurityCenter/javascript/securitycenter_admin_allowedhtm.js,system/SecurityCenter/javascript/securitycenter_admin_modifyconfig.js,system/SecurityCenter/javascript/securitycenter_admin_purifierconfig.js,system/Settings/javascript/settings_admin_modifyconfig.js,system/Settings/javascript/settings_admin_multilingual.js,system/Theme/javascript/form/form.js,system/Theme/javascript/form/form_tabbedpanelset.js,system/Theme/javascript/themeswitcher.js,system/Theme/javascript/theme_admin_modifyconfig.js,system/Users/javascript/users.js,system/Users/javascript/users_admin_modifyregistration.js,system/Users/javascript/users_admin_newuser.js,system/Users/javascript/Zikula.Users.NewUser.js,system/Users/javascript/Zikula.Users.LoginBlock.js,system/Users/javascript/Zikula.Users.PassMeter.js" />
+
+
+ <!-- need a second property since phpdoc doesn't respect wildcard patterns -->
+ <property name="docbloxignorepaths" value="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" />
+ </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="git clone git://github.com/zikula/core.git ${builddir}/tmp/core" />
+ <exec command="git fetch release-1.3" />
+ <exec command="git checkout release-1.3" />
+ <exec command="mv ${builddir}/tmp/core/src/* ${packagepath}" />
+
+ <exec command="git clone git://github.com/zikula-modules/Legal.git ${builddir}/tmp/Legal" />
+ <exec command="mv ${builddir}/tmp/Legal/src/modules/Legal ${packagepath}/modules" />
+
+ <exec command="git clone git://github.com/zikula-modules/Profile.git ${builddir}/tmp/Profile" />
+ <exec command="mv ${builddir}/tmp/Profile/src/modules/Profile ${packagepath}/modules" />
+
+ <exec command="git clone git://github.com/zikula-modules/Clip.git ${builddir}/tmp/Clip" />
+ <exec command="git checkout 0.4.16" />
+ <exec command="mv ${builddir}/tmp/Clip/src/modules/Clip ${packagepath}/modules" />
+
+ <exec command="git clone git://github.com/zikula-modules/Scribite ${builddir}/tmp/Scribite" />
+ <exec command="mv ${builddir}/tmp/Scribite/src/modules/Scribite ${packagepath}/modules" />
+
+ <exec command="git clone git://github.com/zikula-modules/Socialise ${builddir}/tmp/Socialise" />
+ <exec command="mv ${builddir}/tmp/Socialise/src/modules/Socialise ${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 --log-junit ${builddir}/logs/phpunit.xml --coverage-clover ${builddir}/coverage/clover.xml --coverage-html ${builddir}/coverage/ ${sourcedir}/tests"/>
+ </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>
Please sign in to comment.
Something went wrong with that request. Please try again.