forked from netz98/n98-magerun2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
147 lines (123 loc) · 5.29 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
141
142
143
144
145
146
147
<?xml version="1.0"?>
<!--
Phing build file to create a executable phar file by defined src.
@see http://www.phing.info/
Build phar with:
phing dist
-->
<project name="n98-magerun2" default="dist" basedir=".">
<taskdef name="patched-pharpackage" classname="build.phar.tasks.PatchedPharPackageTask" />
<property name="phar" value="${phing.project.name}.phar"/>
<property name="composer_bin" value="composer"/>
<property name="composer_suffix" value="N98MagerunNTS"/>
<fileset dir="." id="root_folder">
<include name="config.yaml" />
<include name="MIT-LICENSE.txt" />
</fileset>
<fileset dir="src" id="src_folder">
<include name="**/**" />
</fileset>
<fileset dir="res" id="res_folder">
<include name="twig/**" />
</fileset>
<fileset dir="vendor" id="vendor_folder">
<include name="**/**" />
<!-- Binary symlinks and binaries -->
<exclude name="bin/**" />
<exclude name="*/*/bin/**" />
<!-- Vcs, development -->
<exclude name="**/.github/**" />
<exclude name="**/.editorconfig"/>
<exclude name="**/.php_cs*"/>
<exclude name="**/appveyor.yml"/>
<exclude name="**/composer.lock"/>
<exclude name="**/travis.yml*"/>
<!-- Docs -->
<exclude name="**/doc/**" />
<exclude name="**/docs/**" />
<exclude name="**/CHANGELOG*"/>
<exclude name="**/README*"/>
<exclude name="**/PORTING_INFO*"/>
<!-- Unused libs -->
<exclude name="fzaninotto/faker/src/Faker/ORM/**" />
<exclude name="twig/twig/ext/**" />
<!-- Tests -->
<exclude name="**/Tests/**" />
<exclude name="**/tests/**" />
<exclude name="**/test/**"/>
<exclude name="**/phpunit.xml*"/>
<!-- Test and build utils -->
<exclude name="friendsofphp/php-cs-fixer/**"/>
<exclude name="mikey179/**"/>
<exclude name="phing/phing/**"/>
<exclude name="phpunit/**"/>
<exclude name="sebastian/**"/>
<exclude name="seld/phar-utils/**"/>
</fileset>
<target name="composer_install" hidden="true">
<exec command="${composer_bin} config autoloader-suffix ${composer_suffix}" dir="${project.basedir}" passthru="true"
checkreturn="true"/>
<exec command="${composer_bin} install -q --no-dev 2>&1" dir="${project.basedir}" passthru="true"
checkreturn="true"/>
<exec command="${composer_bin} config autoloader-suffix --unset" dir="${project.basedir}" passthru="true"
checkreturn="true"/>
<exec command="patch -p1 < build/phar/patches/composer_autoloader.patch" dir="${project.basedir}" passthru="true"
checkreturn="true"/>
</target>
<target name="dist">
<phingcall target="composer_install"/>
<phingcall target="create_phar">
<property name="compression" value="gzip"/>
</phingcall>
<!-- Revert dev settings -->
<exec command="${composer_bin} install" dir="${project.basedir}" passthru="true" checkreturn="true"/>
</target>
<!-- like "dist" but w/o composer install afterwards as this is for the clean build and deleted anyway -->
<target name="dist_clean">
<phingcall target="composer_install"/>
<phingcall target="create_phar">
<property name="compression" value="gzip"/>
</phingcall>
</target>
<target name="dist_hhvm">
<phingcall target="composer_install"/>
<phingcall target="create_phar">
<property name="compression" value="none" />
</phingcall>
<!-- Revert dev settings -->
<exec command="${composer_bin} install" dir="${project.basedir}" passthru="true" checkreturn="true"/>
</target>
<target name="dist_unix">
<phingcall target="composer_install"/>
<phingcall target="dist_unix">
<property name="compression" value="gzip" />
</phingcall>
<!-- Revert dev settings -->
<exec command="${composer_bin} install" dir="${project.basedir}" passthru="true" checkreturn="true"/>
</target>
<target name="create_phar">
<patched-pharpackage basedir="./" stub="build/phar/_cli_stub.php" signature="sha512" compression="${compression}" destfile="./${phar}">
<metadata>
<element name="name" value="${phing.project.name}"/>
<element name="suffix" value="${composer_suffix}"/>
</metadata>
<fileset refid="root_folder"/>
<fileset refid="src_folder"/>
<fileset refid="res_folder"/>
<fileset refid="vendor_folder"/>
</patched-pharpackage>
<!-- make phar executable -->
<chmod file="./${phar}" mode="775" />
</target>
<target name="install">
<exec command="sudo cp ${project.basedir}/${phar} /usr/local/bin/${phar};"/>
<exec command="sudo chmod a+x /usr/local/bin/${phar};" />
</target>
<target name="test">
<exec command="vendor/bin/phpunit --debug --coverage-html ${project.basedir}/reports/coverage" passthru="true"
checkreturn="true"/>
</target>
<target name="apigen">
<apigen source="src" destination="doc/api" title="n98-magerun API" deprecated="true" todo="true" />
</target>
</project>