forked from klaussilveira/gitlist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
65 lines (56 loc) · 2.57 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="gitlist" default="build">
<property name="vendordir" value="${basedir}/vendor/bin" />
<target name="build" depends="prepare,lint,phpunit" />
<target name="build-package" depends="prepare-package,package" />
<target name="clean" description="Clean build artifacts">
<delete dir="${basedir}/build"/>
</target>
<target name="get-composer" description="Get Composer">
<exec executable="/bin/bash">
<arg value="-c" />
<arg value="curl -s https://getcomposer.org/installer | php" />
</exec>
</target>
<target name="prepare" depends="clean,get-composer" description="Prepare for build">
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
<copy file="config.ini-example" tofile="config.ini"/>
<exec executable="${basedir}/composer.phar" failonerror="true">
<arg value="install" />
</exec>
</target>
<target name="prepare-package" description="Prepare for build">
<delete dir="${basedir}/vendor"/>
<exec executable="${basedir}/composer.phar" failonerror="true">
<arg value="install" />
<arg value="--no-dev" />
<arg value="--optimize-autoloader" />
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/">
<include name="**/*.php" />
<exclude name="vendor/" />
<exclude name="cache/" />
<modified />
</fileset>
</apply>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="${vendordir}/phpunit" failonerror="true"/>
</target>
<target name="package" description="Package the application for distribution">
<copy todir="${basedir}/build/gitlist/">
<fileset dir="${basedir}" excludes="cache/**, build/**, tests/**, pkg_builder/**, phpunit.xml.dist, cache.properties, .gitignore, .travis.yml, build.xml, composer.json, composer.lock, composer.phar, config.ini" />
</copy>
<tar destfile="${basedir}/build/gitlist-master.tar.gz"
basedir="${basedir}/build/"
compression="gzip"
longfile="gnu"
excludes="gitlist-master.tar.gz, **/phpunit.xml.dist, **/composer.lock, **/composer.json, **/.travis.yml, **/test/**, **/tests/**, **/logs/**, **/pdepend/**"
/>
</target>
</project>