-
Notifications
You must be signed in to change notification settings - Fork 43
/
phing.xml
72 lines (60 loc) · 3.17 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="ai-admin-jqadm" default="all">
<target name="test" description="Executes unit tests" depends="clean">
<echo msg="Executing unit tests" />
<exec command="${bindir}phpunit -d memory_limit=-1 --include-path ${coredir} --configuration=phpunit.xml"
dir="tests" checkreturn="true" logoutput="true" passthru="true"/>
</target>
<target name="coverage" description="Generates code coverage report" depends="clean">
<echo msg="Generating code coverage report" />
<exec command="${bindir}phpunit -d memory_limit=-1 --include-path ${coredir} --configuration=phpunit-coverage.xml"
dir="tests" checkreturn="true" logoutput="true" passthru="true"/>
</target>
<target name="check" description="Executes code sniffer">
<echo msg="Executing code sniffer" />
<exec command="${bindir}phpcs -n --standard=${codestddir}/Aimeos src tests/*/"
checkreturn="true" logoutput="true" passthru="true"/>
</target>
<target name="clean" description="Cleans up temporary files">
<delete file="tests/confdoc.ser" quiet="true" failonerror="false" />
<delete file="tests/coverage.xml" quiet="true" failonerror="false" />
<delete file="tests/coveralls.json" 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 command="find 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=translate:2,2t --keyword=translate:2,3,4t -o i18n/core-admin.pot -f -"
checkreturn="true" logoutput="true" />
<foreach list="./i18n,./i18n/ext" param="i18n-dir" target="i18n-files" />
</target>
<target name="i18n-files" description="Updates translation message files in passed directory">
<foreach param="po-fname" absparam="po-filename" 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-filename" message="Missing file name" />
<echo msg="File: ${po-filename}" />
<exec command="msgmerge --no-wrap -s -U --backup=none ${po-filename} ${i18n-dir}/*.pot" checkreturn="true" logoutput="true" />
</target>
<target name="build" description="Builds package for deployment">
<exec command="tx pull -a -f --minimum-perc=1" checkreturn="true" logoutput="true" passthru="true" />
<foreach param="po-fname" absparam="po-filename" target="build-mo">
<fileset dir="./i18n">
<include name="**/*.po" />
</fileset>
</foreach>
</target>
<target name="build-mo" description="Generates binary translation files">
<fail unless="po-filename" message="Missing file name" />
<echo msg="File: ${po-filename}" />
<exec command="msgfmt --statistics -c -o `echo ${po-filename} | sed s/\.po//` ${po-filename}" checkreturn="true" logoutput="true" />
</target>
<target name="all" depends="i18n,build" description="Builds all parts of the package">
</target>
</project>