Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 220 lines (180 sloc) 13.87 kB
d32a2ca import
Drak authored
1 <?xml version="1.0" encoding="UTF-8"?>
7a988db Some updates to phing build. Finally got zip task working in native …
Drak authored
2 <project name="zikula" default="clean">
506088d Test refs #2449
Drak authored
3
d32a2ca import
Drak authored
4 <!-- invokation
b977a41 Switch documentation generator to DocBlox (http://www.docblox-project…
Drak authored
5 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
bb91026 Test commit refs #2449
Drak authored
6 # note phpcb must follow phpcs
d32a2ca import
Drak authored
7 -->
a89416b Test commit.
Drak authored
8
d32a2ca 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 Altered build.xml - path's have changed, Hudson is now Jenkins :-)
Drak authored
13 BUILD_TAG - String of "jenkins-${JOBNAME}-${BUILD_NUMBER}".
d32a2ca import
Drak authored
14 WORKSPACE - The absolute path of the workspace.
15 SVN_REVISION - The revision this build is based on.
16 -->
a89416b Test commit.
Drak authored
17
d32a2ca 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" />
f3f7c6a Update build.xml
Drak authored
27 <property name="ignorepaths" value="vendor/*,lib/vendor/*,javascript/*,system/*,themes/*,install/*,lib/legacy,plugins/*" />
2f7bacd Go for broke, compress all own js files.
Drak authored
28
2311f80 Update paths for build.
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,system/Admin/Resources/javascript/admin_admin_ajax.js,system/Admin/Resources/javascript/admin_admin_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" />
7bc473c Update build with all js to be compressed.
Drak authored
30
2f7bacd Go for broke, compress all own js files.
Drak authored
31
d1f1139 Merge build script from 1.7
Drak authored
32 <!-- need a second property since phpdoc doesn't respect wildcard patterns -->
f3f7c6a Update build.xml
Drak authored
33 <property name="docbloxignorepaths" value="vendor/,lib/vendor/,javascript/,system/" />
d1f1139 Merge build script from 1.7
Drak authored
34 <property name="ignorefiletypes" value="*.css,*.js" />
7bc473c Update build with all js to be compressed.
Drak authored
35
d32a2ca 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 Fix code coverage report.
Drak authored
45 <mkdir dir="${builddir}/coverage" />
d32a2ca import
Drak authored
46 <mkdir dir="${builddir}/docs" />
47 <mkdir dir="${builddir}/phpcb" />
48 <mkdir dir="${builddir}/archive" />
49 <mkdir dir="${builddir}/export" />
a1adc75 Fix code coverage report.
Drak authored
50 <mkdir dir="${builddir}/patch" />
51 <mkdir dir="${builddir}/tmp" />
5a89d19 Update JSDocs
Drak authored
52 <mkdir dir="${builddir}/jsdoc" />
c7aab0a Update build.xml
Drak authored
53 <echo msg="Downloading vendors..." />
e338354 Update CI build xml (to be replaced with a PHP script soon to remove …
Drak authored
54 <exec command="chmod 755 ${workspace}/source/composer.phar;${workspace}/source/composer.phar install" />
fdd68fa Remove .git dirs from build.
Drak authored
55 <exec command="find -type d -iname .git | xargs rm -rf" />
d32a2ca import
Drak authored
56 </target>
57
58 <!-- Build archives -->
59 <target name="build" depends="prepare">
60 <echo msg="Exporting for build..." />
61 <!-- ATTN export urls require manual edit -->
e22ba2d Build experiments with GIT.
Drak authored
62 <exec command="cp -a ${workspace}/source/src ${packagepath}" />
410a650 Remove Admin Theme from build temporarily.
Drak authored
63 <delete dir="${packagepath}/themes/Admin" includeemptydirs="true" />
283ae8a Build experiments with GIT.
Drak authored
64
b523bde Removed erroneous blank line.
Drak authored
65 <exec command="svn export https://github.com/zikula-modules/Legal.git/branches/release-2.0 ${builddir}/tmp/Legal" />
a623496 Typo.
Drak authored
66 <exec command="mv ${builddir}/tmp/Legal/src/modules/Legal ${packagepath}/modules" />
f3f831a Build experiments with GIT closes #2449
Drak authored
67
b523bde Removed erroneous blank line.
Drak authored
68 <exec command="svn export https://github.com/zikula-modules/Profile.git/branches/release-1.6 ${builddir}/tmp/Profile" />
f3f831a Build experiments with GIT closes #2449
Drak authored
69 <exec command="mv ${builddir}/tmp/Profile/src/modules/Profile ${packagepath}/modules" />
a89416b Test commit.
Drak authored
70
dd0186b Experimental compression of JS during build.
Drak authored
71 <!-- compress JS -->
2f7bacd Go for broke, compress all own js files.
Drak authored
72 <foreach list="${ownjslist}" param="filename" target="compressownjs" />
dd0186b Experimental compression of JS during build.
Drak authored
73
d32a2ca import
Drak authored
74 <echo msg="Prepare permissions..." />
75 <chmod file="${packagepath}/config/config.php" mode="0666" />
63333d4 Build update.
Drak authored
76 <chmod file="${packagepath}/userdata" mode="0777" />
dbee465 Fix permission of packaging refs #3119
Drak authored
77 <chmod file="${packagepath}/ztemp" mode="0777" />
d32a2ca import
Drak authored
78 <chmod file="${packagepath}/ztemp/error_logs" mode="0777" />
865d7d6 update CI build
Drak authored
79 <chmod file="${packagepath}/ztemp/view_cache" mode="0777" />
80 <chmod file="${packagepath}/ztemp/view_compiled" mode="0777" />
d32a2ca import
Drak authored
81 <chmod file="${packagepath}/ztemp/Theme_cache" mode="0777" />
82 <chmod file="${packagepath}/ztemp/Theme_compiled" mode="0777" />
83 <chmod file="${packagepath}/ztemp/Theme_Config" mode="0777" />
ddc94ca Fix typo refs #3119
Drak authored
84 <chmod file="${packagepath}/ztemp/idsTmp" mode="0777" />
e38cb37 Update build process to set some missing permissions in temporary dir…
Drak authored
85 <chmod file="${packagepath}/ztemp/purifierCache" mode="0777" />
d32a2ca import
Drak authored
86
87 <echo msg="Creating archive..." />
88 <!-- zip's don't play nicely in Phing - using direct command -->
7a988db Some updates to phing build. Finally got zip task working in native …
Drak authored
89 <!-- exec escape="false" command="cd ${exportdir}; zip -D -r ${archivedir}/${package}.zip ." / -->
90 <zip destfile="${archivedir}/${package}.zip">
91 <fileset dir="${exportdir}/${job_name}">
92 <include name="**/**" />
93 </fileset>
94 </zip>
d32a2ca import
Drak authored
95
b0686f9 Revert to command line tarballs because phing doesnt preserve the chm…
Drak authored
96 <!-- Use tar at commandline because phing tarballs don't support file chmod -->
97 <exec escape="false" command="cd ${exportdir}; tar cp ${job_name} > ${archivedir}/${package}.tar; gzip ${archivedir}/${package}.tar" />
98 <!-- tar destfile="${archivedir}/${package}.tar.gz" compression="gzip">
7a988db Some updates to phing build. Finally got zip task working in native …
Drak authored
99 <fileset dir="${exportdir}/${job_name}">
100 <include name="**/**" />
101 </fileset>
b0686f9 Revert to command line tarballs because phing doesnt preserve the chm…
Drak authored
102 </tar -->
06f297d Attempt to fix tar artifact refs #2940
Drak authored
103
d32a2ca import
Drak authored
104 <echo msg="Files copied and compressed in build directory OK!" />
7bc473c Update build with all js to be compressed.
Drak authored
105
d32a2ca import
Drak authored
106 <!-- ATTN phingcall target="build_patch" / -->
107 <phingcall target="build_checksums" />
52f564d Add build cleanup.
Drak authored
108 </target>
7bc473c Update build with all js to be compressed.
Drak authored
109
7f82a6d Remove depends.
Drak authored
110 <target name="build_delete">
52f564d Add build cleanup.
Drak authored
111 <!-- clean up export dir, this is not needed (unless we are debugging) -->
11b35c5 Build experiments with GIT.
Drak authored
112 <!-- delete dir="${packagepath}" includeemptydirs="true" -->
d32a2ca import
Drak authored
113 </target>
7bc473c Update build with all js to be compressed.
Drak authored
114
d32a2ca import
Drak authored
115 <target name="build_checksums">
116 <echo msg="Creating MD5 and SHA1 checksums..." />
117 <exec escape="false" command="echo -----------------md5sums----------------- > ${checksumpath}.tmp" />
118 <exec escape="false" command="md5sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
7bc473c Update build with all js to be compressed.
Drak authored
119
d32a2ca import
Drak authored
120 <exec escape="false" command="echo -----------------sha1sums----------------- >> ${checksumpath}.tmp" />
121 <exec escape="false" command="sha1sum ${archivedir}/*.tar.gz ${archivedir}/*.zip >> ${checksumpath}.tmp" />
7bc473c Update build with all js to be compressed.
Drak authored
122
d32a2ca import
Drak authored
123 <exec escape="false" command="cat ${checksumpath}.tmp | sed 's!${archivedir}/!!g' > ${checksumpath}.txt" />
124 <delete file="${checksumpath}.tmp" />
125 </target>
7bc473c Update build with all js to be compressed.
Drak authored
126
d32a2ca import
Drak authored
127 <target name="build_patch">
128 <echo msg="Making patches...." />
129 <!-- get diffs for releases and save in ${tmpdir}/CHANGES file -->
130 <!-- ATTN urls require manual edit -->
131 <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 Update build with all js to be compressed.
Drak authored
132
d32a2ca import
Drak authored
133 <!-- Remove lines that start with space (which means only a property change), or contain paths to deleted files -->
134 <exec escape="false" command="cat ${tmpdir}/CHANGES | sed -e '/^[ D]/d' >${tmpdir}/AM" />
7bc473c Update build with all js to be compressed.
Drak authored
135
d32a2ca import
Drak authored
136 <!-- List deleted files -->
137 <exec escape="false" command="cat ${tmpdir}/CHANGES | grep -e '^D' >${tmpdir}/DELETED.tmp" />
7bc473c Update build with all js to be compressed.
Drak authored
138
d32a2ca import
Drak authored
139 <!-- this needs to be the regex escaped of the OLD branch -->
140 <!-- ATTN url requires manual edit -->
d0d725b add missing Tour module to build
Drak authored
141 <property name="patchregex" value="https://code.zikula.org/svn/core/tags/Zikula-1.3.0/" />
7bc473c Update build with all js to be compressed.
Drak authored
142
d32a2ca import
Drak authored
143 <!-- A or M, ignoring svn-property changes (2nd char), strip the svn-path from the remaining lines, store in ${tmpdir}/FILES -->
144 <exec escape="false" command="cat ${tmpdir}/AM | sed -e 's!^[AM]. *${patchregex}!!g' > ${tmpdir}/FILES" />
145 <exec escape="false" command="cat ${tmpdir}/DELETED.tmp | sed -e 's!${patchregex}!!g' > ${tmpdir}/DELETED" />
7bc473c Update build with all js to be compressed.
Drak authored
146
d32a2ca import
Drak authored
147 <!-- assemble patch -->
148 <exec escape="false" command="cd ${packagepath};for FILE in `cat ${tmpdir}/FILES`;do cp --parents $FILE ${patchdir};done" />
0719f34 Sync patch build process with 1.2
Drak authored
149
150 <!-- install folder is always required -->
151 <exec escape="false" command="svn export --force https://code.zikula.org/svn/core/branches/zikula-1.3/src/install@${svn_revision} ${patchdir}/install" />
7bc473c Update build with all js to be compressed.
Drak authored
152
d32a2ca import
Drak authored
153 <!-- zip's don't play nicely in Phing - using direct command -->
154 <exec escape="false" command="cd ${patchdir}; zip -D -r ${archivedir}/${package}.patch.zip ." />
155 </target>
156
39c6d44 Keep PHPDocumentor as a template.
Drak authored
157 <!-- Docblox documentor -->
b977a41 Switch documentation generator to DocBlox (http://www.docblox-project…
Drak authored
158 <target name="docblox">
bab37a5 Removed more obsolete file references.
Drak authored
159 <echo msg="DocBlox..." />
563148c Correct syntax for docblox command.
Drak authored
160 <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" />
39c6d44 Keep PHPDocumentor as a template.
Drak authored
161 </target>
162
163 <!-- PHPDocumentor -->
164 <target name="phpdoc">
165 <echo msg="PHPDocumentor..." />
166 <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" />
d32a2ca import
Drak authored
167 </target>
168
169 <!-- PHP copy/paste analysis -->
170 <target name="phpcpd">
171 <echo msg="PHP Copy/Paste..." />
d1f1139 Merge build script from 1.7
Drak authored
172 <exec command="phpcpd --log-pmd ${builddir}/logs/phpcpd.xml --suffixes php --exclude ${ignorepaths} ${sourcedir}/src" escape="false" />
173 </target>
7bc473c Update build with all js to be compressed.
Drak authored
174
d1f1139 Merge build script from 1.7
Drak authored
175 <!-- PHP MD analysis -->
176 <target name="phpmd">
177 <echo msg="PHP_MD..." />
97930f8 phpmd params dont take = sign
Drak authored
178 <exec command="phpmd ${sourcedir}/src xml codesize --reportfile ${builddir}/logs/pmd.xml --ignore ${ignorepaths}" escape="false" />
d32a2ca import
Drak authored
179 </target>
180
181 <!-- PHP dependency checker -->
182 <target name="pdepend">
d1f1139 Merge build script from 1.7
Drak authored
183 <!-- PHP dependency checker -->
184 <echo msg="PHP_Depend..." />
185 <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 import
Drak authored
186 </target>
187
188 <!-- PHP CodeSniffer -->
189 <target name="phpcs">
d1f1139 Merge build script from 1.7
Drak authored
190 <echo msg="PHP_CodeSniffer..." />
191 <exec command="phpcs --extensions=php --report=checkstyle --standard=Zikula --ignore=${ignorepaths} ${sourcedir}/src > ${builddir}/logs/phpcs.xml" escape="false" />
d32a2ca import
Drak authored
192 </target>
193
194 <!-- Unit Tests & coverage analysis -->
195 <target name="phpunit">
d1f1139 Merge build script from 1.7
Drak authored
196 <echo msg="PHPUnit..." />
0e28797 Fix build.
Drak authored
197 <exec command="phpunit -c ${sourcedir}/phpunit.dist.xml --log-junit ${builddir}/logs/phpunit.xml --coverage-clover ${builddir}/coverage/clover.xml --coverage-html ${builddir}/coverage/"/>
d32a2ca import
Drak authored
198 </target>
199
5a89d19 Update JSDocs
Drak authored
200 <!-- JSDoc -->
201 <target name="jsdoc">
202 <echo msg="JSDoc..." />
d2b8f5a Experiment with jsdoc_toolkit instead.
Drak authored
203 <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 Experiment with jsdoc_toolkit instead.
Drak authored
204 <!-- exec command="cd ${builddir}/jsdoc;/opt/jsdoc-toolkit ${sourcedir}/src/javascript/helpers"/ -->
5a89d19 Update JSDocs
Drak authored
205 </target>
206
d32a2ca import
Drak authored
207 <!-- Code Browser -->
208 <target name="phpcb">
a958587 Only generate browser based on xml
Drak authored
209 <echo msg="PHP_CodeBrowser on XML for voilations..." />
59f2cca Only generate browser based on xml
Drak authored
210 <exec command="phpcb --log ${builddir}/logs --output ${builddir}/phpcb" />
d32a2ca import
Drak authored
211 </target>
dd0186b Experimental compression of JS during build.
Drak authored
212
213 <!-- Compress own JS -->
214 <target name="compressownjs">
215 <echo msg="YUI_Compressor for JS files..." />
416210a Altered build.xml - path's have changed, Hudson is now Jenkins :-)
Drak authored
216 <!-- <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}" /> -->
217 <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 Experimental compression of JS during build.
Drak authored
218 </target>
d32a2ca import
Drak authored
219 </project>
Something went wrong with that request. Please try again.