forked from pyrocms/pyrocms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
105 lines (92 loc) · 4.08 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="UTF-8"?>
<project name="PyroCMS" default="dist" basedir="." description="Create download ZIP and TAR from PyroCMS source code">
<property name="sourcedir" value="./build/source" override="true" />
<property name="cachedir" value="./build/cache" override="true" />
<!-- Fileset for all files -->
<fileset dir="." id="allfiles">
<include name="addons/**" />
<include name="assets/**" />
<include name="installer/**" />
<include name="system/**" />
<include name="uploads/**" />
<include name=".htaccess" />
<include name="index.php" />
<include name="LICENSE" />
<include name="*.md" />
<exclude name=".DS_Store" />
<exclude name="system/cms/config/config.php" />
<exclude name="system/cms/config/database.php" />
</fileset>
<!-- Fileset for php files -->
<fileset dir="." id="phpfiles">
<include name="**/*.php" />
<include name="index.php" />
<exclude name="system/vendor/**" />
</fileset>
<!-- ============================================ -->
<!-- Target: integration-test -->
<!-- ============================================ -->
<target name="integration-test">
<echo msg="Testing source code can install and run." />
<delete file="system/cms/config/config.php" quiet="true" />
<delete file="system/cms/config/database.php" quiet="true" />
<!-- <phpunit configuration="tests/integration/phpunit.xml" bootstrap="Bootstrap.php" /> -->
<exec executable="system/vendor/bin/phpunit" passthru="true" checkreturn="true">
<arg value="-c" />
<arg value="tests/integration" />
</exec>
</target>
<!-- ============================================ -->
<!-- Target: link -->
<!-- ============================================ -->
<target name="lint" description="Perform syntax check of .php files">
<mkdir dir="${cachedir}" />
<phplint cachefile="${cachedir}/phplint">
<fileset refid="phpfiles" />
</phplint>
</target>
<!-- ============================================ -->
<!-- Target: full-test -->
<!-- ============================================ -->
<target name="full-test">
<echo msg="Testing everything!" />
<phingcall target="lint" />
<phingcall target="integration-test" />
</target>
<!-- ============================================ -->
<!-- Target: build -->
<!-- ============================================ -->
<target name="build" depends="full-test">
<echo msg="Making directory ./build" />
<mkdir dir="./build" />
<mkdir dir="${sourcedir}" />
<copy todir="${sourcedir}">
<fileset refid="allfiles" />
</copy>
</target>
<!-- ============================================ -->
<!-- Target: Rebuild -->
<!-- ============================================ -->
<target name="rebuild" description="Rebuilds this package">
<delete dir="${sourcedir}" />
<phingcall target="build" />
</target>
<!-- ============================================ -->
<!-- (DEFAULT) Target: dist -->
<!-- ============================================ -->
<target name="dist" depends="build">
<echo msg="Creating .tar.gz archive..." />
<tar destfile="./build/release.tar.gz" basedir="." compression="gzip" includeemptydirs="true">
<fileset dir="${sourcedir}">
<include name="**/**" />
</fileset>
</tar>
<echo msg="Creating .zip archive..." />
<zip destfile="./build/release.zip" basedir="." includeemptydirs="true">
<fileset dir="${sourcedir}">
<include name="**/**" />
</fileset>
</zip>
<echo msg="Files copied and compressed in build directory OK!" />
</target>
</project>