forked from FOSSBilling/FOSSBilling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
140 lines (118 loc) · 5.15 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0"?>
<project name="FOSSBilling" default="build" basedir=".">
<property environment="env" />
<property name="build.dir" value="${basedir}/build" />
<property name="dist.dir" value="${build.dir}/distribution" />
<property name="documentation" value="${build.dir}/documentation" />
<property name="source" value="${build.dir}/source" />
<fileset id="shared-artifacts" dir=".">
<include name="LICENSE"/>
<include name="README.md"/>
<include name="CHANGELOG.md"/>
</fileset>
<fileset id="api-sources" dir="src" followsymlinks="false">
<include name="bb-data/log"/>
<include name="bb-data/cache/index.html"/>
<include name="bb-data/uploads/index.html"/>
<include name="bb-data/index.html"/>
<include name="bb-data/.htaccess.txt"/>
<exclude name="bb-data/log/*"/>
<exclude name="bb-data/cache/*"/>
<exclude name="bb-data/uploads/*"/>
<include name="vendor/**"/>
<include name="bb-library/**"/>
<include name="bb-modules/**"/>
<include name="bb-locale/**"/>
<include name="bb-themes/**"/>
<include name="bb-uploads/**"/>
<include name="install/**"/>
<include name="bb-config-sample.php"/>
<include name="bb-cron.php"/>
<include name="bb-di.php"/>
<include name="bb-ipn.php"/>
<include name="bb-load.php"/>
<include name="bb-update.php"/>
<include name="rb.php"/>
<include name="index.php"/>
<include name="robots.txt"/>
<include name=".htaccess"/>
<exclude name="bb-library/Server/Manager/Directadmin.php"/>
<exclude name="bb-library/Server/Manager/Ispconfig3.php"/>
<exclude name="bb-library/Server/Manager/Plesk.php"/>
<exclude name="bb-library/Server/Manager/Virtualmin.php"/>
<exclude name="bb-library/Registrar/includes/**"/>
</fileset>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="src/bb-data/cache"/>
<mkdir dir="src/bb-data/cache"/>
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/code-browser"/>
<mkdir dir="${build.dir}/coverage"/>
<mkdir dir="${build.dir}/logs"/>
<mkdir dir="${build.dir}/pdepend"/>
<mkdir dir="${build.dir}/update"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${source}"/>
</target>
<target name="clean-vendors" description="Clean up vendors dir for dev dependencies">
<delete dir="src/vendor"/>
<mkdir dir="src/vendor"/>
</target>
<target name="composer" description="Update composer dependencies" depends="clean-vendors">
<exec executable="composer" failonerror="true">
<arg line="install --working-dir=src --no-dev --optimize-autoloader --prefer-dist" />
</exec>
</target>
<target name="composer-dev" description="Update composer dependencies">
<exec executable="composer" failonerror="true">
<arg line="install --working-dir=src --optimize-autoloader --prefer-dist" />
</exec>
</target>
<target name="config" description="Create config file">
<copy file="src/bb-config-sample.php" tofile="src/bb-config.php" overwrite="true"/>
</target>
<target name="test-unit">
<exec executable="src/bb-vendor/bin/phpunit" failonerror="true">
<arg line="tests/bb-library/" />
</exec>
<exec executable="src/bb-vendor/bin/phpunit" failonerror="true">
<arg line="tests/bb-modules/" />
</exec>
</target>
<target name="test-integration">
<exec executable="php" dir="bin" failonerror="true">
<arg line="prepare.php" />
</exec>
<exec executable="src/bb-vendor/bin/phpunit" failonerror="true">
<arg line="--group Core tests/integration/" />
</exec>
</target>
<target name="test-modules">
<exec executable="src/bb-vendor/bin/phpunit" failonerror="true">
<arg line="src/bb-modules/" />
</exec>
</target>
<target name="build-api" depends="clean">
<copy todir="${source}">
<fileset refid="shared-artifacts"/>
</copy>
<copy todir="${source}">
<fileset refid="api-sources"/>
</copy>
<property environment="env"/>
<echo message="Release TAG: ${env.TRAVIS_TAG}" />
<exec executable="sed" failonerror="true" output="${source}/bb-library/Box/Version2.php">
<arg line="s/0.0.1/${env.TRAVIS_TAG}/ ${source}/bb-library/Box/Version.php" />
</exec>
<exec executable="mv" failonerror="true">
<arg line="${source}/bb-library/Box/Version2.php ${source}/bb-library/Box/Version.php" />
</exec>
</target>
<target name="package">
<zip destfile="${dist.dir}/${ant.project.name}.zip" basedir="${source}" />
</target>
<target name="test" depends="clean, composer-dev, test-unit, test-integration, test-modules"/>
<target name="release" depends="clean, composer, build-api, package" />
<target name="build" depends="config, test"/>
</project>