forked from maglnet/ComposerRequireChecker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
102 lines (85 loc) · 4.26 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
<?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 command="${php-executable} vendor/phpunit/phpunit/phpunit" passthru="true" checkreturn="true"/>
<exec command="${php-executable} bin/composer-require-checker.php" passthru="true" checkreturn="true"/>
</target>
<!-- ============================================ -->
<!-- Target: phar-prepare-dependencies -->
<!-- ============================================ -->
<target name="phar-prepare-dependencies">
<!--install dependencies without development requirements-->
<composer command="install">
<arg value="--no-dev"/>
<arg value="-o"/>
</composer>
</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="run-test">
<!--create the package-->
<php expression="file_put_contents('bin/clistub.php', '#!/usr/bin/env php' . PHP_EOL . 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" depends="phar-build">
<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>