Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build.xml « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: df3a8939dc45cd66519e7b91dc6691240e194dfe (plain)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<project name="piwik" default="all" basedir=".">

	<property file="build.properties" />
	<property file="defaults.properties" />

	<target name="chmod">
		<condition property="chmodcondition">
			<and>
				<os family="unix"/>
				<available file="${basedir}/../build" type="dir"/>
			</and>
		</condition>
		<antcall target="chmod-inner"/>		
	</target>

	<target name="chmod-inner" if="chmodcondition">

		<property file="${basedir}/webtest/config/webtest.properties" />

		<copy file="${basedir}/webtest/chmod.php" tofile="${basedir}/../build/chmod.php" overwrite="true">
			<filterset>
			      <filter token="PATH" value="${basedir}/../build"/>
		    </filterset>
		</copy>

		<!-- <get src="${wt.config.protocol}://${wt.config.host}:${wt.config.port}/${wt.config.basepath}/chmod.php" dest="/dev/null" ignoreerrors="true"/> -->

		<exec executable="wget">
			<arg value="${wt.config.protocol}://${wt.config.host}:${wt.config.port}/${wt.config.basepath}/chmod.php"/>
			<arg value="--output-document=/dev/null" />
			<arg value="--no-check-certificate" />
		</exec>
	</target>

	<target name="clean">
		<delete dir="${basedir}/../build" />
		<delete dir="${basedir}/results" />
	</target>

	<target name="prepare-build-filesystem" depends="clean">
		<mkdir dir="${basedir}/../build" />
		<copy todir="${basedir}/../build">
			<fileset dir="${basedir}/..">
				<include name="config/**" />
				<include name="core/**" />
				<include name="js/**" />
				<include name="lang/**" />
				<include name="libs/**" />
				<include name="misc/**" />
				<include name="plugins/**" />
				<include name="tests/**" />
				<include name="themes/**" />
				<include name="tmp/**" />
				<include name="*.*" />
				<include name="*" />
			</fileset>
		</copy>
		<mkdir dir="${basedir}/../build/tmp/templates_c"/>
		<mkdir dir="${basedir}/../build/tmp/cache"/>
		<mkdir dir="${basedir}/../build/tmp/latest"/>
		<chmod perm="a+rw">
			<dirset dir="${basedir}/../build">
				<include name="config" />
				<include name="tmp" />
				<include name="tmp/templates_c" />
				<include name="tmp/cache" />
				<include name="tmp/latest" />
			</dirset>
		</chmod>
	</target>

	<target name="process-build-resources-pdo-mysql" depends="prepare-build-filesystem">
		<copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../build/config/config.ini.php" overwrite="true">
			<filterset>
				<filtersfile file="${basedir}/build.properties"/>
			</filterset>
		</copy>	
	</target>

	<target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql">

		<echo>PDO_MYSQL unit tests started</echo>

		<mkdir dir="${basedir}/../build/test-results"/>
		<exec executable="${php.executable}" dir="${basedir}/../build/tests" failonerror="true" failifexecutionfails="true">		
			<arg value="all_tests.php" />
		</exec>

		<echo>PDO_MYSQL unit tests finished</echo>

	</target>

	<target name="process-build-resources-mysqli" depends="prepare-build-filesystem">
		<copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../build/config/config.ini.php" overwrite="true">
			<filterset>
				<filtersfile file="${basedir}/build.properties"/>
			</filterset>
		</copy>	
	</target>

	<target name="test-mysqli" depends="process-build-resources-mysqli">

		<echo>MYSQLI unit tests started</echo>

		<mkdir dir="${basedir}/../build/test-results"/>
		<exec executable="${php.executable}" dir="${basedir}/../build/tests" failonerror="true" failifexecutionfails="true">		
			<arg value="all_tests.php" />
		</exec>

		<echo>MYSQLI unit tests finished</echo>

	</target>

	<target name="phpdoc">

		<echo>phpDocumentor started</echo>

		<delete dir="${basedir}/build/phpdocumentor-report"/>
		<mkdir dir="${basedir}/build/phpdocumentor-report"/>
		<exec executable="${php.executable}" dir="${basedir}/../build" failonerror="true" failifexecutionfails="true">
			<arg value="${phpdocumentor.home}/phpDocumentor/phpdoc.inc" />
			<arg value="--useconfig"/>
			<arg path="${basedir}/../misc/phpdoc-config.ini"/>
		</exec>

		<copy todir="${phpdocumentor.report.dir}" overwrite="true" failonerror="true" verbose="true">
			<fileset dir="${basedir}/../build/documentation"/>
		</copy>

		<echo>phpDocumentor finished</echo>		

	</target>

	<target name="webtest">
		<delete file="${basedir}/../build/config/config.ini.php"/>
		<ant antfile="${basedir}/build-canoo.xml"/>
	</target>

	<target name="schemaspy">

		<echo>SchemaSpy started</echo>

		<delete dir="${basedir}/build/schemaspy-report"/>
		<mkdir dir="${basedir}/build/schemaspy-report"/>

		<echo message="Generating schema for MySql" />
		<java jar="${basedir}/lib/java/schemaSpy_3.1.1.jar" fork="true"  failonerror="true" maxmemory="256m" dir="${basedir}">
			<arg value="-t"/>
			<arg value="mysql"/>
			<arg value="-host"/>
			<arg value="${database.main.host}:${database.main.port}"/>
			<arg value="-db"/>
			<arg value="${database.main.name}"/>
			<arg value="-cp"/>
			<arg path="${basedir}/lib/java/mysql-connector-java-5.1.7.jar"/>
			<arg value="-u"/>
			<arg value="${database.main.username}"/>
			<arg value="-o"/>
			<arg path="${basedir}/build/schemaspy-report"/>
			<arg value="-p"/>
			<arg value="${database.main.password}"/>
		</java>

		<copy todir="${schemaspy.report.dir}" overwrite="true" failonerror="true" verbose="true">
			<fileset dir="${basedir}/build/schemaspy-report"/>
		</copy>

		<echo>SchemaSpy finished</echo>

	</target>

	<target name="all">
		<antcall target="chmod"/>
		<antcall target="test-pdo-mysql"/>
		<!-- antcall target="test-mysqli"/ -->
		<antcall target="webtest"/>
		<antcall target="chmod"/>
		<antcall target="phpdoc"/>
		<antcall target="schemaspy"/>
	</target>

</project>