Bump version to 4.3-4
[LibreOffice.git] / odk / util / check.pl
blob899b42cca0e8182eb49620358e6570c80bc2be22
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # check - a perl script to check some files and directories if they exists
21 # A first simple check if the SDK was built completely.
24 $return = 0;
26 $SdkDir = "$ARGV[0]";
27 $OperatingSystem = "$ARGV[1]";
28 $ExePrefix = "$ARGV[2]";
30 sub check_file
32 my ($file) = @_;
33 return -e "$SdkDir/$file";
36 sub check_dir
38 my ($dir) = @_;
39 return -d "$SdkDir/$dir";
42 print "Check for $OperatingSystem\n";
44 if (-d "$SdkDir") {
45 # check binaries
46 print "check binaries: ";
47 if (check_dir("bin")) {
48 my @binarylist = ( "idlc","cppumaker","javamaker",
49 "regcompare",
50 "unoapploader", "uno-skeletonmaker" );
51 if ($ENV{SYSTEM_UCPP} eq "") {
52 push @binarylist,"ucpp";
55 foreach $i (@binarylist)
57 if (!check_file("bin/$i$ExePrefix")) {
58 $return++;
59 print "\nERROR: \"bin/$i$ExePrefix\" is missing\n";
60 } else {
61 print "+";
65 if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
66 if ($OperatingSystem eq "windows" && !check_file("bin/climaker.exe")) {
67 $return++;
68 print "\nERROR: \"bin/climaker.exe\" is missing\n";
69 } else {
70 print "+";
73 } else {
74 print "\nERROR: \"bin\" is missing\n";
75 $return++;
77 print "\n";
79 # packaging files
80 print "check packaging files: ";
81 if (check_dir("docs")) {
82 my @filelist = ( "install.html",
83 "sdk_styles.css","tools.html",
84 "images/arrow-1.gif", "images/arrow-3.gif",
85 "images/odk-footer-logo.gif",
86 "images/bg_table.png","images/bg_table2.png",
87 "images/bg_table3.png", "images/nav_down.png",
88 "images/nav_home.png","images/nav_left.png",
89 "images/nav_right.png","images/nav_up.png",
90 "images/sdk_head-1.png", "images/sdk_head-2.png",
91 "images/sdk_line-1.gif", "images/sdk_line-2.gif",
92 "images/nada.gif",
93 "images/arrow-2.gif", "images/bluball.gif",
94 "images/ooo-main-app_32.png");
96 foreach $i (@filelist)
98 if (!check_file("docs/$i")) {
99 $return++;
100 print "\nERROR: \"docs/$i\" is missing\n";
101 } else {
102 print "+";
105 } else {
106 print "\nERROR: \"docs\" is missing\n";
107 $return++;
109 print "\n";
111 #check configure files
112 print "check config files: ";
113 if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
114 if (!check_file("setsdkenv_windows.bat")) {
115 print "\nERROR: \"setsdkenv_windows.bat\" is missing\n";
116 $return++;
118 if (!check_file("setsdkenv_windows.template")) {
119 print "\nERROR: \"setsdkenv_windows.template\" is missing\n";
120 $return++;
122 if (!check_file("cfgWin.js")) {
123 print "\nERROR: \"cfgWin.js\" is missing\n";
124 $return++;
126 } else {
127 if (!check_file("configure.pl")) {
128 print "\nERROR: \"configure.pl\" is missing\n";
129 $return++;
131 if (!check_file("config.guess")) {
132 print "\nERROR: \"config.guess\" is missing\n";
133 $return++;
135 if (!check_file("config.sub")) {
136 print "\nERROR: \"config.sub\" is missing\n";
137 $return++;
139 if (!check_file("setsdkenv_unix")) {
140 print "\nERROR: \"setsdkenv_unix\" is missing\n";
141 $return++;
143 if (!check_file("setsdkenv_unix.sh.in")) {
144 print "\nERROR: \"setsdkenv_unix.sh.in\" is missing\n";
145 $return++;
148 print "\n";
150 #check setting files
151 print "check setting files: ";
152 if (check_dir("settings")) {
153 if (!check_file("settings/settings.mk")) {
154 print "\nERROR: \"settings/settings.mk\" is missing\n";
155 $return++;
157 if (!check_file("settings/std.mk")) {
158 print "\nERROR: \"settings/std.mk\" is missing\n";
159 $return++;
161 if (!check_file("settings/stdtarget.mk")) {
162 print "\nERROR: \"settings/stdtarget.mk\" is missing\n";
163 $return++;
165 } else {
166 print "\nERROR: \"settings\" is missing\n";
167 $return++;
169 print "\n";
171 #check cpp docu, it is only a first and simple check
172 # improvement required
173 if ($ENV{'DOXYGEN'} ne '') {
174 print "check cpp docu: ";
175 if (check_dir("docs/cpp/ref")) {
176 if (!check_file("docs/cpp/ref/index.html")) {
177 print "\nERROR: \"docs/cpp/ref/index.html\" is missing\n";
178 $return++;
180 } else {
181 print "\nERROR: \"docs/cpp/ref\" is missing\n";
182 $return++;
184 print "\n";
187 #check java docu, it is only a first and simple check
188 # improvement required
189 my $solar_java = $ENV{"ENABLE_JAVA"};
190 my $JDK = $ENV{"JDK"};
191 if (defined($solar_java) && $solar_java ne "" && (!defined($JDK) || $JDK ne "gcj")) {
192 print "check java docu: ";
193 if (check_dir("docs/java/ref")) {
194 if (!check_file("docs/java/ref/index.html")) {
195 print "\nERROR: \"docs/java/ref/index.html\" is missing\n";
196 $return++;
199 my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
200 "uno","uno/class-use","comp","comp/helper",
201 "comp/helper/class-use");
203 foreach $i (@dir_list)
205 if (!check_dir("docs/java/ref/com/sun/star/$i")) {
206 $return++;
207 print "\nERROR: \"docs/java/ref/com/sun/star/$i\" is missing\n";
208 } else {
209 print "+";
212 } else {
213 print "\nERROR: \"docs/java/ref\" is missing\n";
214 $return++;
216 print "\n";
219 #check idl docu, it is only a first and simple check
220 # improvement required
221 if ($ENV{'DOXYGEN'} ne '') {
222 print "check idl docu: ";
223 if (check_dir("docs/idl/ref")) {
224 if (!check_file("docs/idl/ref/index.html")) {
225 print "\nERROR: \"docs/idl/ref/index.html\" is missing\n";
226 $return++;
228 if (!check_file("docs/idl/ref/classes.html")) {
229 print "\nERROR: \"docs/idl/ref/classes.html\" is missing\n";
230 $return++;
232 if (!check_file("docs/idl/ref/namespaces.html")) {
233 print "\nERROR: \"docs/idl/ref/namespaces.html\" is missing\n";
234 $return++;
237 my @idl_dirlist = ( "accessibility",
238 "animations",
239 "auth",
240 "awt",
241 "awt/tab",
242 "awt/tree",
243 "awt/grid",
244 "beans",
245 "bridge",
246 "bridge/oleautomation",
247 "chart",
248 "chart2",
249 "chart2/data",
250 "configuration",
251 "configuration/backend",
252 "configuration/backend/xml",
253 "configuration/bootstrap",
254 "connection",
255 "container",
256 "cui",
257 "datatransfer",
258 "datatransfer/clipboard",
259 "datatransfer/dnd",
260 "deployment",
261 "deployment/ui",
262 "document",
263 "drawing",
264 "drawing/framework",
265 "embed",
266 "form",
267 "form/binding",
268 "form/component",
269 "form/control",
270 "form/inspection",
271 "form/runtime",
272 "form/submission",
273 "form/validation",
274 "formula",
275 "frame",
276 "frame/status",
277 "gallery",
278 "geometry",
279 "graphic",
280 "i18n",
281 "image",
282 "inspection",
283 "io",
284 "java",
285 "lang",
286 "ldap",
287 "linguistic2",
288 "loader",
289 "logging",
290 "mail",
291 "media",
292 "mozilla",
293 "packages",
294 "packages/manifest",
295 "packages/zip",
296 "plugin",
297 "presentation",
298 "reflection",
299 "registry",
300 "rendering",
301 "report",
302 "report/inspection",
303 "resource",
304 "scanner",
305 "script",
306 "script/browse",
307 "script/provider",
308 "sdb",
309 "sdb/application",
310 "sdb/tools",
311 "sdbc",
312 "sdbcx",
313 "security",
314 "sheet",
315 "smarttags",
316 "style",
317 "svg",
318 "system",
319 "table",
320 "task",
321 "text",
322 "text/fieldmaster",
323 "text/textfield",
324 "text/textfield/docinfo",
325 "ucb",
326 "ui",
327 "ui/dialogs",
328 "uno",
329 "uri",
330 "util",
331 "view",
332 "xforms",
333 "xml",
334 "xml/crypto",
335 "xml/crypto/sax",
336 "xml/csax",
337 "xml/dom",
338 "xml/dom/events",
339 "xml/dom/views",
340 "xml/input",
341 "xml/sax",
342 "xml/wrapper",
343 "xml/xpath",
344 "xsd" );
346 # Due to MSI limitations have to use SHORT_NAMES on windows so can't check
347 if ($OperatingSystem ne "windows") {
348 foreach $i (@idl_dirlist)
350 $i =~ s/\//_1_1/g;
351 if (!check_file("docs/idl/ref/namespacecom_1_1sun_1_1star_1_1$i.html")) {
352 $return++;
353 print "\nERROR: \"docs/idl/ref/namespacecom_1_1sun_1_1star_1_1$i.html\" is missing\n";
354 } else {
355 print "+";
359 } else {
360 print "\nERROR: \"docs/idl/ref\" is missing\n";
361 $return++;
363 print "\n";
366 } else {
367 print "\nERROR: \"$SdkDir\" is missing\n";
368 $return++;
371 if( $return != 0 )
373 print "ERROR\n";
374 } else {
375 print "OK\n";
377 exit $return;