-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathphing.xml
90 lines (78 loc) · 3.82 KB
/
phing.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="ai-client-html" default="all">
<target name="test" description="Executes unit tests" depends="clean">
<echo msg="Executing unit tests" />
<exec executable="${bindir}phpunit" dir="tests" checkreturn="true" logoutput="true" passthru="true">
<arg line="-d memory_limit=-1 --include-path ${coredir} --configuration=phpunit.xml" />
</exec>
</target>
<target name="coverage" description="Generates code coverage report" depends="clean">
<echo msg="Generating code coverage report" />
<exec executable="${bindir}phpunit" dir="tests" checkreturn="true" logoutput="true" passthru="true">
<arg line="-d memory_limit=-1 --include-path ${coredir} --configuration=phpunit-coverage.xml" />
</exec>
</target>
<target name="check" description="Executes code sniffer">
<echo msg="Executing code sniffer" />
<exec executable="${bindir}phpcs" checkreturn="true" logoutput="true" passthru="true">
<arg line="-n --standard=${codestddir}/Aimeos src tests/*/" />
</exec>
</target>
<target name="clean" description="Cleans up temporary files">
<delete file="tests/coverage.xml" quiet="true" failonerror="false" />
<delete file="tests/confdoc.ser" quiet="true" failonerror="false" />
<delete quiet="true" failonerror="false" >
<fileset dir="tests">
<include name="*.log" />
</fileset>
</delete>
</target>
<target name="i18n" description="Creates translation message files">
<exec executable="find" checkreturn="true" logoutput="true" passthru="true">
<arg line="src/ templates/ -type f | xgettext -j -s --no-location --no-wrap --add-comments=/// --language=PHP --from-code=UTF-8 --keyword=printf:1 --keyword=sprintf:1 --keyword=dt:2,2t --keyword=dn:2,3,4t --keyword=translate:2,2t --keyword=translate:2,3,4t -o i18n/core-client.pot -f -" />
</exec>
<foreach list="./i18n,./i18n/code" param="i18n-dir" inheritall="true" target="i18n-files" />
<exec executable="tx" checkreturn="true" logoutput="true" passthru="true">
<arg line="push -s -t" />
</exec>
</target>
<target name="i18n-files" description="Updates translation message files in passed directory">
<foreach param="po-filename" absparam="po-filepath" inheritall="true" target="i18n-update">
<fileset dir="${i18n-dir}">
<include name="*.po" />
</fileset>
</foreach>
</target>
<target name="i18n-update" description="Updates translation message files">
<fail unless="po-filepath" message="Missing file name" />
<echo msg="File: ${po-filepath}" />
<exec executable="msgmerge" checkreturn="true" logoutput="true" passthru="true">
<arg line="--no-wrap -s -U --backup=none ${po-filepath} ${i18n-dir}/*.pot" />
</exec>
<exec executable="msgattrib" checkreturn="true" logoutput="true" passthru="true">
<arg line="-s --no-wrap --no-fuzzy -o ${po-filepath} ${po-filepath}" />
</exec>
<exec executable="${bindir}potrans" logoutput="true" passthru="true">
<arg line="deepl --only --dir=${coredir} ${extdir}/${phing.project.name}/${po-filepath}" />
</exec>
</target>
<target name="build" description="Builds package for deployment">
<exec executable="tx" checkreturn="true" logoutput="true" passthru="true">
<arg line="pull -a -f --minimum-perc=1" />
</exec>
<foreach param="po-filename" absparam="po-filepath" target="build-mo">
<fileset dir="./i18n">
<include name="**/*.po" />
</fileset>
</foreach>
</target>
<target name="build-mo" description="Generates binary translation files">
<fail unless="po-filepath" message="Missing file name" />
<echo msg="File: ${po-filepath}" />
<exec executable="msgfmt" checkreturn="true" logoutput="true" passthru="true">
<arg line="--statistics -c -o `echo ${po-filepath} | sed s/\.po//` ${po-filepath}" />
</exec>
</target>
<target name="all" depends="coverage,check" description="Builds all parts of the package">
</target>
</project>