Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 208 lines (169 sloc) 12.969 kb
d32a2ca Drak import
drak authored
1 <?xml version="1.0" encoding="UTF-8"?>
7a988db Drak Some updates to phing build. Finally got zip task working in native phi...
drak authored
2 <project name="zikula" default="clean">
506088d Drak Test refs #2449
drak authored
3
d32a2ca Drak import
drak authored
4 <!-- invokation
c4b6b3c Drak Update phing command
drak authored
5 phing -f $WORKSPACE/source/build.xml clean prepare phpcs phpcb phpcpd phpunit pdepend phpmd phpdoc 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
bb91026 Drak Test commit refs #2449
drak authored
6 # note phpcb must follow phpcs
d32a2ca Drak import
drak authored
7 -->
a89416b Drak Test commit.
drak authored
8
d32a2ca Drak import
drak authored
9 <!--
10 BUILD_NUMBER - The current build number, such as "153"
11 BUILD_ID - The current build id, (YYYY-MM-DD_hh-mm-ss)
12 JOB_NAME - Name of the project of this build, such as "foo"
416210a Drak Altered build.xml - path's have changed, Hudson is now Jenkins :-)
drak authored
13 BUILD_TAG - String of "jenkins-${JOBNAME}-${BUILD_NUMBER}".
d32a2ca Drak import
drak authored
14 WORKSPACE - The absolute path of the workspace.
15 SVN_REVISION - The revision this build is based on.
16 -->
a89416b Drak Test commit.
drak authored
17
d32a2ca Drak import
drak authored
18 <property name="builddir" value="${workspace}/build" />
19 <property name="sourcedir" value="${workspace}/source" />
20 <property name="package" value="${job_name}.build${build_number}" />
21 <property name="exportdir" value="${builddir}/export" />
22 <property name="archivedir" value="${builddir}/archive" />
23 <property name="packagepath" value="${exportdir}/${job_name}" />
24 <property name="checksumpath" value="${archivedir}/${package}-checksums" />
25 <property name="patchdir" value="${builddir}/patch" />
26 <property name="tmpdir" value="${builddir}/tmp" />
046e471 Drak Update build.xml
drak authored
27 <property name="ignorepaths" value="lib/vendor/*,javascript/*,system/*,themes/*,install/*,lib/legacy" />
2f7bacd Drak Go for broke, compress all own js files.
drak authored
28
9962bea Drak Typo
drak authored
29 <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,javascript/helpers/Zikula.zdebug.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_modifyconfig.js,system/Users/javascript/users_admin_modifyregistration.js,system/Users/javascript/users_admin_newuser.js,system/Users/javascript/users_newuser.js,system/Users/javascript/Zikula.Users.LoginBlock.js,system/Users/javascript/Zikula.Users.PassMeter.js" />
7bc473c Drak Update build with all js to be compressed.
drak authored
30
2f7bacd Drak Go for broke, compress all own js files.
drak authored
31
d1f1139 Drak Merge build script from 1.7
drak authored
32 <!-- need a second property since phpdoc doesn't respect wildcard patterns -->
6e332f3 Drak Update build.xml for codesniffing.
drak authored
33 <property name="phpdocignorepaths" value="lib/vendor/,javascript/,system/" />
d1f1139 Drak Merge build script from 1.7
drak authored
34 <property name="ignorefiletypes" value="*.css,*.js" />
7bc473c Drak Update build with all js to be compressed.
drak authored
35
d32a2ca Drak import
drak authored
36 <target name="clean">
37 <echo msg="Clean..." />
38 <delete dir="${builddir}" includeemptydirs="true" />
39 </target>
40
41 <target name="prepare">
42 <echo msg="Prepare..." />
43 <mkdir dir="${builddir}" />
44 <mkdir dir="${builddir}/logs" />
a1adc75 Drak Fix code coverage report.
drak authored
45 <mkdir dir="${builddir}/coverage" />
d32a2ca Drak import
drak authored
46 <mkdir dir="${builddir}/docs" />
47 <mkdir dir="${builddir}/phpcb" />
48 <mkdir dir="${builddir}/archive" />
49 <mkdir dir="${builddir}/export" />
a1adc75 Drak Fix code coverage report.
drak authored
50 <mkdir dir="${builddir}/patch" />
51 <mkdir dir="${builddir}/tmp" />
5a89d19 Drak Update JSDocs
drak authored
52 <mkdir dir="${builddir}/jsdoc" />
d32a2ca Drak import
drak authored
53 </target>
54
55 <!-- Build archives -->
56 <target name="build" depends="prepare">
57 <echo msg="Exporting for build..." />
58 <!-- ATTN export urls require manual edit -->
e22ba2d Drak Build experiments with GIT.
drak authored
59 <exec command="cp -a ${workspace}/source/src ${packagepath}" />
410a650 Drak Remove Admin Theme from build temporarily.
drak authored
60 <delete dir="${packagepath}/themes/Admin" includeemptydirs="true" />
283ae8a Drak Build experiments with GIT.
drak authored
61
f3f831a Drak Build experiments with GIT closes #2449
drak authored
62 <exec command="svn export --force http://svn.github.com/zikula-modules/Legal.git ${builddir}/tmp/Legal" />
a623496 Drak Typo.
drak authored
63 <exec command="mv ${builddir}/tmp/Legal/src/modules/Legal ${packagepath}/modules" />
f3f831a Drak Build experiments with GIT closes #2449
drak authored
64
65 <exec command="svn export --force http://svn.github.com/zikula-modules/Profile.git ${builddir}/tmp/Profile" />
66 <exec command="mv ${builddir}/tmp/Profile/src/modules/Profile ${packagepath}/modules" />
a89416b Drak Test commit.
drak authored
67
dd0186b Drak Experimental compression of JS during build.
drak authored
68 <!-- compress JS -->
2f7bacd Drak Go for broke, compress all own js files.
drak authored
69 <foreach list="${ownjslist}" param="filename" target="compressownjs" />
dd0186b Drak Experimental compression of JS during build.
drak authored
70
d32a2ca Drak import
drak authored
71 <echo msg="Prepare permissions..." />
72 <chmod file="${packagepath}/config/config.php" mode="0666" />
9f5692c Drak Introduce a central place for non-temporary module data.
drak authored
73 <chmod file="${packagepath}/data" mode="0777" />
d32a2ca Drak import
drak authored
74 <chmod file="${packagepath}/ztemp/error_logs" mode="0777" />
865d7d6 Drak update CI build
drak authored
75 <chmod file="${packagepath}/ztemp/view_cache" mode="0777" />
76 <chmod file="${packagepath}/ztemp/view_compiled" mode="0777" />
d32a2ca Drak import
drak authored
77 <chmod file="${packagepath}/ztemp/Theme_cache" mode="0777" />
78 <chmod file="${packagepath}/ztemp/Theme_compiled" mode="0777" />
79 <chmod file="${packagepath}/ztemp/Theme_Config" mode="0777" />
80
81 <echo msg="Creating archive..." />
82 <!-- zip's don't play nicely in Phing - using direct command -->
7a988db Drak Some updates to phing build. Finally got zip task working in native phi...
drak authored
83 <!-- exec escape="false" command="cd ${exportdir}; zip -D -r ${archivedir}/${package}.zip ." / -->
84 <zip destfile="${archivedir}/${package}.zip">
85 <fileset dir="${exportdir}/${job_name}">
86 <include name="**/**" />
87 </fileset>
88 </zip>
d32a2ca Drak import
drak authored
89
b0686f9 Drak Revert to command line tarballs because phing doesnt preserve the chmod ...
drak authored
90 <!-- Use tar at commandline because phing tarballs don't support file chmod -->
91 <exec escape="false" command="cd ${exportdir}; tar cp ${job_name} > ${archivedir}/${package}.tar; gzip ${archivedir}/${package}.tar" />
92 <!-- tar destfile="${archivedir}/${package}.tar.gz" compression="gzip">
7a988db Drak Some updates to phing build. Finally got zip task working in native phi...
drak authored
93 <fileset dir="${exportdir}/${job_name}">
94 <include name="**/**" />
95 </fileset>
b0686f9 Drak Revert to command line tarballs because phing doesnt preserve the chmod ...
drak authored
96 </tar -->
06f297d Drak Attempt to fix tar artifact refs #2940
drak authored
97
d32a2ca Drak import
drak authored
98 <echo msg="Files copied and compressed in build directory OK!" />
7bc473c Drak Update build with all js to be compressed.
drak authored
99
d32a2ca Drak import
drak authored
100 <!-- ATTN phingcall target="build_patch" / -->
101 <phingcall target="build_checksums" />
52f564d Drak Add build cleanup.
drak authored
102 </target>
7bc473c Drak Update build with all js to be compressed.
drak authored
103
7f82a6d Drak Remove depends.
drak authored
104 <target name="build_delete">
52f564d Drak Add build cleanup.
drak authored
105 <!-- clean up export dir, this is not needed (unless we are debugging) -->
11b35c5 Drak Build experiments with GIT.
drak authored
106 <!-- delete dir="${packagepath}" includeemptydirs="true" -->
d32a2ca Drak import
drak authored
107 </target>
7bc473c Drak Update build with all js to be compressed.
drak authored
108
d32a2ca Drak import
drak authored
109 <target name="build_checksums">
110 <echo msg="Creating MD5 and SHA1 checksums..." />
111 <exec escape="false" command="echo -----------------md5sums----------------- > ${checksumpath}.tmp" />
112 <exec escape="false" command="md5sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
7bc473c Drak Update build with all js to be compressed.
drak authored
113
d32a2ca Drak import
drak authored
114 <exec escape="false" command="echo -----------------sha1sums----------------- >> ${checksumpath}.tmp" />
115 <exec escape="false" command="sha1sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
7bc473c Drak Update build with all js to be compressed.
drak authored
116
d32a2ca Drak import
drak authored
117 <exec escape="false" command="cat ${checksumpath}.tmp | sed 's!${archivedir}/!!g' > ${checksumpath}.txt" />
118 <delete file="${checksumpath}.tmp" />
119 </target>
7bc473c Drak Update build with all js to be compressed.
drak authored
120
d32a2ca Drak import
drak authored
121 <target name="build_patch">
122 <echo msg="Making patches...." />
123 <!-- get diffs for releases and save in ${tmpdir}/CHANGES file -->
124 <!-- ATTN urls require manual edit -->
125 <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" />
7bc473c Drak Update build with all js to be compressed.
drak authored
126
d32a2ca Drak import
drak authored
127 <!-- Remove lines that start with space (which means only a property change), or contain paths to deleted files -->
128 <exec escape="false" command="cat ${tmpdir}/CHANGES | sed -e '/^[ D]/d' >${tmpdir}/AM" />
7bc473c Drak Update build with all js to be compressed.
drak authored
129
d32a2ca Drak import
drak authored
130 <!-- List deleted files -->
131 <exec escape="false" command="cat ${tmpdir}/CHANGES | grep -e '^D' >${tmpdir}/DELETED.tmp" />
7bc473c Drak Update build with all js to be compressed.
drak authored
132
d32a2ca Drak import
drak authored
133 <!-- this needs to be the regex escaped of the OLD branch -->
134 <!-- ATTN url requires manual edit -->
d0d725b Drak add missing Tour module to build
drak authored
135 <property name="patchregex" value="https://code.zikula.org/svn/core/tags/Zikula-1.3.0/" />
7bc473c Drak Update build with all js to be compressed.
drak authored
136
d32a2ca Drak import
drak authored
137 <!-- A or M, ignoring svn-property changes (2nd char), strip the svn-path from the remaining lines, store in ${tmpdir}/FILES -->
138 <exec escape="false" command="cat ${tmpdir}/AM | sed -e 's!^[AM]. *${patchregex}!!g' > ${tmpdir}/FILES" />
139 <exec escape="false" command="cat ${tmpdir}/DELETED.tmp | sed -e 's!${patchregex}!!g' > ${tmpdir}/DELETED" />
7bc473c Drak Update build with all js to be compressed.
drak authored
140
d32a2ca Drak import
drak authored
141 <!-- assemble patch -->
142 <exec escape="false" command="cd ${packagepath};for FILE in `cat ${tmpdir}/FILES`;do cp --parents $FILE ${patchdir};done" />
0719f34 Drak Sync patch build process with 1.2
drak authored
143
144 <!-- install folder is always required -->
145 <exec escape="false" command="svn export --force https://code.zikula.org/svn/core/branches/zikula-1.3/src/install@${svn_revision} ${patchdir}/install" />
7bc473c Drak Update build with all js to be compressed.
drak authored
146
d32a2ca Drak import
drak authored
147 <!-- zip's don't play nicely in Phing - using direct command -->
148 <exec escape="false" command="cd ${patchdir}; zip -D -r ${archivedir}/${package}.patch.zip ." />
149 </target>
150
d1f1139 Drak Merge build script from 1.7
drak authored
151 <!-- PHPDocumentor -->
d32a2ca Drak import
drak authored
152 <target name="phpdoc">
d1f1139 Drak Merge build script from 1.7
drak authored
153 <echo msg="PHPDocumentor..." />
7347198 Drak Update build.xml
drak authored
154 <exec command="phpdoc --directory ${sourcedir}/src/lib/dbobject,${sourcedir}/src/lib/FileSystem,${sourcedir}/src/lib/Form,${sourcedir}/src/lib/i18n,${sourcedir}/src/lib/view,${sourcedir}/src/lib/StreamReader,${sourcedir}/src/lib/util,${sourcedir}/src/lib/Zikula --target ${builddir}/docs" escape="false" />
d32a2ca Drak import
drak authored
155 </target>
156
157 <!-- PHP copy/paste analysis -->
158 <target name="phpcpd">
159 <echo msg="PHP Copy/Paste..." />
d1f1139 Drak Merge build script from 1.7
drak authored
160 <exec command="phpcpd --log-pmd ${builddir}/logs/phpcpd.xml --suffixes php --exclude ${ignorepaths} ${sourcedir}/src" escape="false" />
161 </target>
7bc473c Drak Update build with all js to be compressed.
drak authored
162
d1f1139 Drak Merge build script from 1.7
drak authored
163 <!-- PHP MD analysis -->
164 <target name="phpmd">
165 <echo msg="PHP_MD..." />
97930f8 Drak phpmd params dont take = sign
drak authored
166 <exec command="phpmd ${sourcedir}/src xml codesize --reportfile ${builddir}/logs/pmd.xml --ignore ${ignorepaths}" escape="false" />
d32a2ca Drak import
drak authored
167 </target>
168
169 <!-- PHP dependency checker -->
170 <target name="pdepend">
d1f1139 Drak Merge build script from 1.7
drak authored
171 <!-- PHP dependency checker -->
172 <echo msg="PHP_Depend..." />
173 <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" />
d32a2ca Drak import
drak authored
174 </target>
175
176 <!-- PHP CodeSniffer -->
177 <target name="phpcs">
d1f1139 Drak Merge build script from 1.7
drak authored
178 <echo msg="PHP_CodeSniffer..." />
179 <exec command="phpcs --extensions=php --report=checkstyle --standard=Zikula --ignore=${ignorepaths} ${sourcedir}/src > ${builddir}/logs/phpcs.xml" escape="false" />
d32a2ca Drak import
drak authored
180 </target>
181
182 <!-- Unit Tests & coverage analysis -->
183 <target name="phpunit">
d1f1139 Drak Merge build script from 1.7
drak authored
184 <echo msg="PHPUnit..." />
05eff4a Drak I'll get this right one day...
drak authored
185 <exec command="phpunit --log-junit ${builddir}/logs/phpunit.xml --coverage-clover ${builddir}/coverage/clover.xml --coverage-html ${builddir}/coverage/ ${sourcedir}/tests"/>
d32a2ca Drak import
drak authored
186 </target>
187
5a89d19 Drak Update JSDocs
drak authored
188 <!-- JSDoc -->
189 <target name="jsdoc">
190 <echo msg="JSDoc..." />
d2b8f5a Drak Experiment with jsdoc_toolkit instead.
drak authored
191 <exec command="cd /opt/jsdoc-toolkit; /opt/jsdoc-toolkit/jsrun.sh -t=/opt/jsdoc-toolkit/templates/jsdoc --directory=${builddir}/jsdoc ${sourcedir}/src/javascript/helpers"/>
6cfa18d Drak Experiment with jsdoc_toolkit instead.
drak authored
192 <!-- exec command="cd ${builddir}/jsdoc;/opt/jsdoc-toolkit ${sourcedir}/src/javascript/helpers"/ -->
5a89d19 Drak Update JSDocs
drak authored
193 </target>
194
d32a2ca Drak import
drak authored
195 <!-- Code Browser -->
196 <target name="phpcb">
a958587 Drak Only generate browser based on xml
drak authored
197 <echo msg="PHP_CodeBrowser on XML for voilations..." />
59f2cca Drak Only generate browser based on xml
drak authored
198 <exec command="phpcb --log ${builddir}/logs --output ${builddir}/phpcb" />
d32a2ca Drak import
drak authored
199 </target>
dd0186b Drak Experimental compression of JS during build.
drak authored
200
201 <!-- Compress own JS -->
202 <target name="compressownjs">
203 <echo msg="YUI_Compressor for JS files..." />
416210a Drak Altered build.xml - path's have changed, Hudson is now Jenkins :-)
drak authored
204 <!-- <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}" /> -->
205 <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" />
dd0186b Drak Experimental compression of JS during build.
drak authored
206 </target>
d32a2ca Drak import
drak authored
207 </project>
Something went wrong with that request. Please try again.