-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
90 lines (74 loc) · 2.99 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jawira/emoji-catalog" default="help">
<property name="emoji.source" value="https://unicode.org/Public/emoji/16.0/emoji-test.txt"/>
<target name="setup" description="Prepare project for dev" depends="composer:install"/>
<target name="qa" description="Quality assurance"
depends="composer:validate,php:lint,emoji:tests"/>
<target name="update" description="Update class and catalog"
depends="emoji:download-source,emoji:update,doc:update,emoji:count"/>
<target name="composer:validate" description="Validate composer.json">
<composer command="validate">
<arg value="--no-interaction"/>
<arg value="--profile"/>
<arg value="--strict"/>
<arg value="--quiet"/>
</composer>
</target>
<target name="composer:install" description="Install for dev">
<composer command="install">
<arg value="--quiet"/>
<arg value="--no-suggest"/>
<arg value="--no-interaction"/>
<arg value="--profile"/>
<arg value="--prefer-dist"/>
</composer>
</target>
<target name="emoji:download-source">
<mkdir dir="resources/unicode"/>
<httpget dir="resources/unicode" url="${emoji.source}"/>
</target>
<target name="emoji:update" description="Generate Emoji class">
<autoloader autoloaderpath="vendor/autoload.php"/>
<taskdef name="emoji-update" classname="\Jawira\EmojiTask\EmojiUpdateTask"/>
<emoji-update/>
</target>
<target name="doc:update">
<autoloader autoloaderpath="vendor/autoload.php"/>
<taskdef name="catalog-update" classname="\Jawira\EmojiTask\CatalogUpdateTask"/>
<catalog-update/>
</target>
<target name="php:lint" description="Check PHP syntax">
<phplint deprecatedAsError="true" haltonfailure="true">
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
<target name="emoji:tests" description="Test some fully-qualified emojis">
<autoloader autoloaderpath="vendor/autoload.php"/>
<php function="vanilla"/>
</target>
<target name="emoji:count" description="Count constants in Emoji class">
<autoloader autoloaderpath="vendor/autoload.php"/>
<adhoc-task name="emoji-count">
class EmojiCountTask extends \Phing\Task {
function main() {
$emojiReflection = new ReflectionClass(\Jawira\EmojiCatalog\Emoji::class);
$constants = $emojiReflection->getConstants();
$count = count($constants);
$this->log("Emoji count: $count");
$this->project->setProperty('emoji-count', $count);
}
}
</adhoc-task>
<emoji-count/>
</target>
<target name="help">
<uptodate property="uptodate.visualizer" srcfile="build.xml" targetfile="build.png"/>
<runtarget target="visualizer"/>
<open path="build.png"/>
</target>
<target name="visualizer" unless="uptodate.visualizer" description="Create buildfile map">
<visualizer/>
</target>
</project>