-
Notifications
You must be signed in to change notification settings - Fork 72
/
build.xml
106 lines (89 loc) · 4.43 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================== -->
<!-- Phing Build instructions -->
<!-- http://www.phing.info/ -->
<!-- http://www.phing.info/get/phing-latest.phar -->
<!-- php -d phar.readonly=Off phing-latest.phar phar-build-release -->
<!-- ============================================================== -->
<project name="composer-require-checker" default="phar-build">
<property name="build-dir" value="build"/>
<property name="phar-dir" value="build/phar"/>
<!-- ============================================ -->
<!-- Target: prepare -->
<!-- ============================================ -->
<target name="prepare">
<echo msg="preparing build directory"/>
<mkdir dir="${build-dir}"/>
</target>
<!-- ============================================ -->
<!-- Target: run-test -->
<!-- ============================================ -->
<target name="run-test">
<php returnProperty="php-executable" expression="PHP_BINARY" level="debug"/>
<exec executable="${php-executable}" checkreturn="true" passthru="true">
<arg line="vendor/phpunit/phpunit/phpunit"/>
</exec>
<exec executable="${php-executable}" checkreturn="true" passthru="true">
<arg line="bin/composer-require-checker.php"/>
</exec>
</target>
<!-- ============================================ -->
<!-- Target: phar-prepare-dependencies -->
<!-- ============================================ -->
<target name="phar-prepare-dependencies">
<!--install dependencies without development requirements-->
<exec executable="composer" checkreturn="true" passthru="true">
<arg line="--no-interaction install --no-dev --optimize-autoloader"/>
</exec>
</target>
<!-- ============================================ -->
<!-- Target: prepare-dev-dependencies -->
<!-- ============================================ -->
<target name="prepare-dev-dependencies">
<!--install dependencies with development requirements-->
<composer command="install"/>
</target>
<!-- ============================================ -->
<!-- Target: phar-build -->
<!-- ============================================ -->
<target name="phar-build" depends="phar-prepare-dependencies">
<!--create the package-->
<mkdir dir="${build-dir}" />
<php expression="file_put_contents('bin/clistub.php', '#!/usr/bin/env php' . chr(10) . Phar::createDefaultStub('bin/composer-require-checker.php'))"/>
<pharpackage basedir="./"
destfile="${build-dir}/${phing.project.name}.phar"
stub="bin/clistub.php"
compression="gzip">
<fileset dir="./">
<include name="src/**/*.php"/>
<include name="bin/*"/>
<include name="vendor/**"/>
<include name="LICENSE"/>
<include name="composer.json"/>
<include name="composer.lock"/>
</fileset>
</pharpackage>
</target>
<target name="phar-sign">
<delete file="${build-dir}/${phing.project.name}.phar.asc"/>
<exec executable="gpg" checkreturn="true" passthru="true">
<arg value="--batch" />
<arg value="--local-user" />
<arg value="[email protected]" />
<arg value="--detach-sign" />
<arg value="--output" />
<arg path="${build-dir}/${phing.project.name}.phar.asc" />
<arg path="${build-dir}/${phing.project.name}.phar" />
</exec>
<exec executable="gpg" checkreturn="true" passthru="true">
<arg value="--verify" />
<arg path="${build-dir}/${phing.project.name}.phar.asc" />
<arg path="${build-dir}/${phing.project.name}.phar" />
</exec>
</target>
<!-- ============================================ -->
<!-- Target: phar-build-release -->
<!-- ============================================ -->
<target name="phar-build-release"
depends="prepare-dev-dependencies, run-test, phar-prepare-dependencies, phar-build, phar-sign"/>
</project>