forked from giggsey/Locale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
68 lines (56 loc) · 2.14 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="giggsey/locale" default="test">
<property name="build.script" value="build/build.php"/>
<property name="git.url" value="https://github.com/unicode-org/cldr-json.git"/>
<property name="git.path" value="cldr-json"/>
<loadfile property="metadata.version" file="CLDR-VERSION.txt">
<filterchain>
<striplinecomments>
<comment value="#"/>
</striplinecomments>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="data" value="data/"/>
<target name="test" description="Run unit tests" depends="compile">
<exec passthru="true" command="composer run test"/>
</target>
<target name="compile" description="Build data"
depends="cleanup-data,build-data">
</target>
<target name="cleanup-data" description="Cleanup built data">
<delete dir="${data}"/>
<mkdir dir="${data}"/>
</target>
<target name="git-pull">
<available file="${git.path}" type="dir" property="git.path.exists"/>
<if>
<or>
<not>
<isset property="git.path.exists"/>
</not>
<isfalse value="${git.path.exists}"/>
</or>
<then>
<echo>Cloning repository</echo>
<gitclone
repository="${git.url}"
targetPath="${git.path}"
branch="main"/>
</then>
</if>
<gitfetch repository="${git.path}" all="true"/>
<echo message="Pulling Git project @ ${metadata.version}"/>
<gitcheckout
repository="${git.path}"
branchname="${metadata.version}" quiet="false" force="true"/>
</target>
<target name="build-data" depends="git-pull">
<exec executable="${build.script}" passthru="true">
<arg value="Build"/>
<arg value="${metadata.version}"/>
<arg value="${git.path}/cldr-json/cldr-localenames-full/main/"/>
<arg value="${data}"/>
</exec>
</target>
</project>