-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
74 lines (55 loc) · 2.92 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<project name="Piwik" default="build">
<property environment="env" />
<property name="builddir" value="${env.WORKSPACE}/build" />
<property name="package" value="${env.JOB_NAME}.build${env.BUILD_NUMBER}" />
<property name="archivedir" value="${builddir}/archive" />
<property name="logsdir" value="${builddir}/logs" />
<property name="packagepath" value="${exportdir}/${env.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/*,lib/legacy" />
<property name="ownjslist" value="javascript/dashboard.js" />
<!-- Compress own JS -->
<target name="compressownjs">
<echo message="YUI_Compressor for JS files..." />
<echo message="/usr/bin/java -jar /usr/share/yui-compressor/yui-compressor.jar -o ${packagepath}/${filename}.tmp ${packagepath}/${filename};" />
<!-- exec command="/usr/bin/java -jar /usr/share/yui-compressor/yui-compressor.jar -o ${packagepath}/${filename}.tmp ${packagepath}/${filename};" / -->
</target>
<target name="build">
<echo message="Clean..." />
<delete dir="${builddir}" includeemptydirs="true" />
<echo message="Prepare..." />
<mkdir dir="${builddir}" />
<mkdir dir="${logsdir}" />
<mkdir dir="${archivedir}" />
<echo message="PHP_CodeSniffer..." />
<exec executable="phpcs">
<arg line="--extensions=php --report=checkstyle --standard=Zikula --report-file=${logsdir}/phpcs.xml src" />
</exec>
<echo message="JSLint..." />
<fileset dir="javascript" id="jsfiles.raw">
<include name="**/*.js" />
<exclude name="**/*.min.js" />
</fileset>
<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />
<exec executable="jslint4java" output="build/logs/jslint.xml">
<arg line="--report xml ${jsfiles.clean}" />
</exec>
<!-- PHP MD analysis -->
<echo message="PHP MD..." />
<exec executable="phpmd" dir="${env.WORKSPACE}" failonerror="off">
<arg line="src xml codesize,unusedcode --reportfile '${logsdir}/pmd.xml'" />
</exec>
<echo message="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="${env.WORKSPACE}/src/modules">
<include name="**/**" />
</fileset>
</zip>
<!-- foreach list="${ownjslist}" param="filename" target="compressownjs" / -->
</target>
</project>