-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
149 lines (131 loc) · 4.72 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0"?>
<project name="USVN" basedir="." default="all">
<property name="testdir" value="tests" override="true" />
<property name="report_test_dir" value="test-report" override="true" />
<property name="report_translation_dir" value="translation-report" override="true" />
<property name="wamp_dir" value="WinInstaller/Files/USVN" override="true" />
<!-- File set -->
<fileset id="testfile" dir=".">
<include name="**/*Test.php" />
<exclude name="www/Zend/**"/>
<exclude name="${report_test_dir}/**" />
<exclude name="${testdir}/**" />
<exclude name="**/.svn/**" />
<exclude name="phing/**" />
<exclude name="scripts**" />
<exclude name="private/**" />
<exclude name="www/SQL/**" />
<exclude name="LICENSE/**" />
</fileset>
<fileset id="projectfile" dir="www">
<include name="**" />
<include name="LICENSE/**" />
<exclude name="**/*Test.php" />
<exclude name="files/**"/>
<exclude name="config.ini"/>
<exclude name=".htaccess"/>
<exclude name="www/bugs/*"/>
<exclude name="**/Test"/>
</fileset>
<!-- Target -->
<target name="all">
<echo msg="Build USVN" />
<phingcall target="lint" />
<phingcall target="translation-compilation" />
<phingcall target="test" />
</target>
<target name="release">
<echo msg="Release USVN ${version}" />
<phingcall target="lint" />
<phingcall target="test-all" />
</target>
<target name="release-wamp">
<echo msg="Release USVN Wamp addon ${version}" />
<phingcall target="wamp" />
</target>
<target name="clean">
<delete dir="${report_test_dir}" />
<delete dir="${report_translation_dir}" />
<delete dir="tests" />
<delete>
<fileset dir=".">
<include name="**/svn-commit*" />
</fileset>
</delete>
</target>
<target name="test-all">
<echo msg="Test PDO_SQLITE" />
<php function="putenv">
<param value="DB=PDO_SQLITE" />
</php>
<phingcall target="test" />
<echo msg="Test PDO_MYSQL" />
<php function="putenv">
<param value="DB=PDO_MYSQL" />
</php>
<phingcall target="test" />
<echo msg="Test MYSQLI" />
<php function="putenv">
<param value="DB=MYSQLI" />
</php>
<phingcall target="test" />
</target>
<target name="test">
<mkdir dir="tests" />
<mkdir dir="tests/tmp" />
<php function="getenv" returnProperty="toto">
<param value="DB"/>
</php>
<property name="report_test_dir" value="${report_test_dir}/${toto}" override="true" />
<echo msg="${toto}" />
<echo msg="${report_test_dir}" />
<delete file="${report_test_dir}/**" />
<mkdir dir="${report_test_dir}" />
<php function="define">
<param value="PHPUnit_MAIN_METHOD"/>
<param value="0"/>
</php>
<phpunit haltonfailure="false" failureproperty="unit_test_failure" errorproperty="unit_test_failure" printsummary="true">
<batchtest>
<fileset refid="testfile" />
</batchtest>
<formatter type="xml" todir="${report_test_dir}" outfile="logfile.xml" />
<formatter type="plain" todir="${report_test_dir}" outfile="logfile.txt" />
</phpunit>
<phpunitreport infile="${report_test_dir}/logfile.xml" styledir="phing" format="frames" todir="${report_test_dir}" />
<fail if="unit_test_failure" message="Unit tests failed!!!" />
</target>
<target name="lint">
<phplint>
<fileset dir=".">
<include name="**/*.php"/>
<include name="**/*.html"/>
<exclude name="${report_test_dir}/**" />
<exclude name="**/Zend/**" />
</fileset>
</phplint>
</target>
<!-- Translation -->
<target name="translation-compilation">
<taskdef name="gettext-compilation" classname="phing.tasks.CompilationGetTextTask" />
<gettext-compilation localedirectory="www/locale/" />
</target>
<target name="translation-findstr">
<taskdef name="gettext-findstr" classname="phing.tasks.FindStrGetTextTask" />
<gettext-findstr localedirectory="www/locale/" scandirectory="www/"/>
</target>
<target name="translation-status">
<taskdef name="gettext-status" classname="phing.tasks.TranslationStatusGetTextTask" />
<mkdir dir="${report_translation_dir}" />
<gettext-status localedirectory="www/locale/" xmloutput="${report_translation_dir}/output.xml"/>
<xslt file="${report_translation_dir}/output.xml" tofile="${report_translation_dir}/index.html" style="phing/translation-status.xsl" overwrite="true"/>
</target>
<!-- Wamp -->
<target name="wamp">
<delete file="${wamp_dir)" />
<mkdir dir="${wamp_dir}" />
<copy todir="${wamp_dir}/">
<fileset refid="projectfile" />
</copy>
</target>
</project>