-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
72 lines (72 loc) · 3.45 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
<project name="PHPDemo" default="build" basedir=".">
<!-- props -->
<property name="htdocs.dir" value="f:/app/xampp/htdocs"/>
<property name="version" value="1.0"/>
<property name="task" value="Task 1" />
<property name="repo" value="f:/workspace/PHPAgile" />
<property name="basedir" value="." />
<property name="app" value="demo"/>
<includepath classpath="build/" />
<taskdef name="buildnumber" classname="BuildnumberTask" />
<target name="build" depends="test,analyse">
<!-- Clean up -->
<delete>
<fileset dir="${htdocs.dir}/${app}">
<include name="config/" />
<include name="stockscreener/" />
<include name="composer.json" />
<include name="composer.lock" />
<include name=".htaccess" />
</fileset>
</delete>
<!-- Create build directory -->
<mkdir dir="${htdocs.dir}/${app}"/>
<mkdir dir="${htdocs.dir}/${app}/config"/>
<!-- Copy Files from src to xampp -->
<copy todir="${htdocs.dir}/${app}">
<fileset dir=".">
<include name="config/" />
<include name="stockscreener/" />
<include name="composer.json" />
<include name="composer.lock" />
<include name=".htaccess" />
</fileset>
</copy>
<buildnumber file="buildnumber.txt" property="count" />
<!--<gitcommit repository="${repo}" message="${task}" allFiles="true" />-->
<!--<gittag repository="${repo}" name="${version}.${count}" annotate="true" message="${task}"/> -->
<echo msg="Build done" />
</target>
<target name="clean" depends="composer.update, composer.install">
<echo msg="Running clean" />
</target>
<target name="test">
<exec command="phpunit -c ../../phpunit.xml" dir="vendor/bin/" />
</target>
<target name="analyse">
<exec command="phploc ../../src --log-xml ../../build/phploc.xml" dir="vendor/bin/" />
<exec command="pdepend --summary-xml=../../build/pdepend.xml --jdepend-chart=../../build/jdepend.svg --overview-pyramid=../../build/pyramid.svg ../../src" dir="vendor/bin/" />
<exec command="php vendor/phpcheckstyle/phpcheckstyle/run.php --src src --format html --outdir ./build" />
<exec command="phpmd ../../src html codesize,unusedcode,naming --reportfile ../../build/phpmd.html" dir="vendor/bin/" />
<exec command="phpcpd --fuzzy ../../src --log-pmd=../../build/phpcpd.xml" dir="vendor/bin/" />
<exec command="phpcs --ignore=*/js,*css --report=xml --report-file=../../build/phpcs.xml ../../src" dir="vendor/bin/" />
</target>
<!-- COMPOSER SELF UPDATE -->
<target name="composer.update">
<echo msg="Running composer self-update ..." />
<exec logoutput="true" checkreturn="true" passthru="true" command="composer self-update" dir="${htdocs.dir}/${app}" />
</target>
<!-- END -->
<!-- COMPOSER INSTALL -->
<target name="composer.install">
<echo msg="Running composer install ..." />
<copy todir="${htdocs.dir}/${app}">
<fileset dir=".">
<include name="composer.json" />
<include name="composer.lock" />
</fileset>
</copy>
<exec logoutput="true" checkreturn="true" passthru="true" command="composer install" dir="${htdocs.dir}/${app}" />
</target>
<!-- END -->
</project>