-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
105 lines (90 loc) · 3.46 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
103
104
105
<?xml version="1.0" encoding="UTF-8"?>
<project name="German phpBB Translation" description="The phpBB forum software" default="all" basedir="">
<property name="validator-version" value="3.3" />
<property name="language" value="${language}" />
<property name="version" value="${version}" />
<if>
<equals arg1="${package-version}" arg2="" />
<then>
<property name="package-version" value="${version}" />
</then>
<else>
<property name="package-version" value="${package-version}" />
</else>
</if>
<!-- These are the main targets which you will probably want to use -->
<target name="all" depends="prepare-structure,prepare,test,package" />
<target name="build" depends="prepare-structure,prepare,package" />
<target name="prepare-test" depends="prepare-structure,prepare" />
<target name="test" depends="lint,validate" />
<target name="clean">
<delete dir="packages" />
</target>
<target name="prepare-structure" depends="clean">
<mkdir dir="packages" />
<mkdir dir="packages/de" />
<mkdir dir="packages/de_x_sie" />
<mkdir dir="packages/en" />
<mkdir dir="packages/upload" />
<mkdir dir="packages/git" />
</target>
<target name="prepare">
<echo msg="Extracting ${version}" />
<phingcall target="git-archive">
<property name="archive-version" value="${version}" />
</phingcall>
<foreach list="en,${language}" param="package-language" target="prepare-package-language" />
</target>
<target name="package">
<phingcall target="create-package-language">
<property name="package-language" value="${language}" />
<property name="package-version" value="${package-version}" />
</phingcall>
</target>
<target name="git-archive">
<echo msg="Getting archive for ${archive-version}" />
<exec command="git archive ${archive-version} --format zip --output packages/git/${archive-version}.zip"
checkreturn="true" />
<unzip file="packages/git/${archive-version}.zip" todir="packages/git/${archive-version}" />
</target>
<target name="prepare-package-language">
<echo msg="Preparing package (${package-language})" />
<copy todir="packages/${package-language}">
<fileset dir="packages/git/${version}">
<include name="**/${package-language}/**" />
</fileset>
</copy>
<copy todir="packages/${package-language}/language/${package-language}">
<filelist dir="packages/git/${version}" files="LICENSE,AUTHORS.md,README.md" />
</copy>
</target>
<target name="create-package-language">
<echo msg="Creating archives (${package-language} ${package-version})" />
<zip basedir="packages/${package-language}/" destfile="packages/upload/phpBB_lang_${package-language}-${package-version}.zip" />
<tar basedir="packages/${package-language}/" destfile="packages/upload/phpBB_lang_${package-language}-${package-version}.tar.bz2" compression="bzip2" />
</target>
<target name="validate">
<if>
<os family="windows"/>
<then>
<exec command="vendor\bin\translation.php.bat
validate ${language} --package-dir=packages --phpbb-version=${validator-version} --display-notices --ansi"
passthru="true"
checkreturn="true" />
</then>
<else>
<exec command="php vendor/bin/translation.php
validate ${language} --package-dir=packages --phpbb-version=${validator-version} --display-notices --ansi"
passthru="true"
checkreturn="true" />
</else>
</if>
</target>
<target name="lint">
<phplint>
<fileset dir="language">
<include name="**/${language}/*.php"/>
</fileset>
</phplint>
</target>
</project>