Disable WiX-based MSI generation for the moment
[LibreOffice.git] / odk / util / check.pl
blob8c1728671d91894af987009c130ba3543836d582
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 exist
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 = ( "cppumaker","javamaker",
49 "unoidl-read", "unoidl-write",
50 "unoapploader", "uno-skeletonmaker" );
52 foreach $i (@binarylist)
54 if (!check_file("bin/$i$ExePrefix")) {
55 $return++;
56 print "\nERROR: \"bin/$i$ExePrefix\" is missing\n";
57 } else {
58 print "+";
62 if ($OperatingSystem eq "windows") {
63 if (!check_file("bin/climaker.exe")) {
64 $return++;
65 print "\nERROR: \"bin/climaker.exe\" is missing\n";
66 } else {
67 print "+";
70 } else {
71 print "\nERROR: \"bin\" is missing\n";
72 $return++;
74 print "\n";
76 # packaging files
77 print "check packaging files: ";
78 if (check_dir("docs")) {
79 my @filelist = ( "install.html",
80 "sdk_styles.css","tools.html",
81 "images/arrow-1.gif", "images/arrow-3.gif",
82 "images/odk-footer-logo.gif",
83 "images/bg_table.png","images/bg_table2.png",
84 "images/bg_table3.png", "images/nav_down.png",
85 "images/nav_home.png","images/nav_left.png",
86 "images/nav_right.png","images/nav_up.png",
87 "images/sdk_head-1.png", "images/sdk_head-2.png",
88 "images/sdk_line-1.gif", "images/sdk_line-2.gif",
89 "images/nada.gif",
90 "images/arrow-2.gif", "images/bluball.gif",
91 "images/ooo-main-app_32.png");
93 foreach $i (@filelist)
95 if (!check_file("docs/$i")) {
96 $return++;
97 print "\nERROR: \"docs/$i\" is missing\n";
98 } else {
99 print "+";
102 } else {
103 print "\nERROR: \"docs\" is missing\n";
104 $return++;
106 print "\n";
108 #check configure files
109 print "check config files: ";
110 if ($OperatingSystem eq "windows") {
111 if (!check_file("setsdkenv_windows.bat")) {
112 print "\nERROR: \"setsdkenv_windows.bat\" is missing\n";
113 $return++;
115 if (!check_file("cfgWin.js")) {
116 print "\nERROR: \"cfgWin.js\" is missing\n";
117 $return++;
119 } else {
120 if (!check_file("configure.pl")) {
121 print "\nERROR: \"configure.pl\" is missing\n";
122 $return++;
124 if (!check_file("config.guess")) {
125 print "\nERROR: \"config.guess\" is missing\n";
126 $return++;
128 if (!check_file("config.sub")) {
129 print "\nERROR: \"config.sub\" is missing\n";
130 $return++;
132 if (!check_file("setsdkenv_unix")) {
133 print "\nERROR: \"setsdkenv_unix\" is missing\n";
134 $return++;
136 if (!check_file("setsdkenv_unix.sh.in")) {
137 print "\nERROR: \"setsdkenv_unix.sh.in\" is missing\n";
138 $return++;
141 print "\n";
143 #check setting files
144 print "check setting files: ";
145 if (check_dir("settings")) {
146 if (!check_file("settings/settings.mk")) {
147 print "\nERROR: \"settings/settings.mk\" is missing\n";
148 $return++;
150 if (!check_file("settings/std.mk")) {
151 print "\nERROR: \"settings/std.mk\" is missing\n";
152 $return++;
154 if (!check_file("settings/stdtarget.mk")) {
155 print "\nERROR: \"settings/stdtarget.mk\" is missing\n";
156 $return++;
158 } else {
159 print "\nERROR: \"settings\" is missing\n";
160 $return++;
162 print "\n";
164 #check cpp docu, it is only a first and simple check
165 # improvement required
166 if ($ENV{'DOXYGEN'} ne '') {
167 print "check cpp docu: ";
168 if (check_dir("docs/cpp/ref")) {
169 if (!check_file("docs/cpp/ref/index.html")) {
170 print "\nERROR: \"docs/cpp/ref/index.html\" is missing\n";
171 $return++;
173 } else {
174 print "\nERROR: \"docs/cpp/ref\" is missing\n";
175 $return++;
177 print "\n";
180 #check java docu, it is only a first and simple check
181 # improvement required
182 my $solar_java = $ENV{"ENABLE_JAVA"};
183 my $JDK = $ENV{"JDK"};
184 if (defined($solar_java) && $solar_java ne "" && (!defined($JDK) || $JDK ne "gcj")) {
185 print "check java docu: ";
186 if (check_dir("docs/java/ref")) {
187 if (!check_file("docs/java/ref/index.html")) {
188 print "\nERROR: \"docs/java/ref/index.html\" is missing\n";
189 $return++;
192 my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
193 "uno","uno/class-use","comp","comp/helper",
194 "comp/helper/class-use");
196 foreach $i (@dir_list)
198 if (!check_dir("docs/java/ref/com/sun/star/$i")) {
199 $return++;
200 print "\nERROR: \"docs/java/ref/com/sun/star/$i\" is missing\n";
201 } else {
202 print "+";
205 } else {
206 print "\nERROR: \"docs/java/ref\" is missing\n";
207 $return++;
209 print "\n";
212 #check idl docu, it is only a first and simple check
213 # improvement required
214 if ($ENV{'DOXYGEN'} ne '') {
215 print "check idl docu: ";
216 if (check_dir("docs/idl/ref")) {
217 if (!check_file("docs/idl/ref/index.html")) {
218 print "\nERROR: \"docs/idl/ref/index.html\" is missing\n";
219 $return++;
221 if (!check_file("docs/idl/ref/classes.html")) {
222 print "\nERROR: \"docs/idl/ref/classes.html\" is missing\n";
223 $return++;
225 if (!check_file("docs/idl/ref/namespaces.html")) {
226 print "\nERROR: \"docs/idl/ref/namespaces.html\" is missing\n";
227 $return++;
230 my @idl_dirlist = ( "accessibility",
231 "animations",
232 "auth",
233 "awt",
234 "awt/tab",
235 "awt/tree",
236 "awt/grid",
237 "beans",
238 "bridge",
239 "bridge/oleautomation",
240 "chart",
241 "chart2",
242 "chart2/data",
243 "configuration",
244 "configuration/backend",
245 "configuration/backend/xml",
246 "configuration/bootstrap",
247 "connection",
248 "container",
249 "cui",
250 "datatransfer",
251 "datatransfer/clipboard",
252 "datatransfer/dnd",
253 "deployment",
254 "deployment/ui",
255 "document",
256 "drawing",
257 "drawing/framework",
258 "embed",
259 "form",
260 "form/binding",
261 "form/component",
262 "form/control",
263 "form/inspection",
264 "form/runtime",
265 "form/submission",
266 "form/validation",
267 "formula",
268 "frame",
269 "frame/status",
270 "gallery",
271 "geometry",
272 "graphic",
273 "i18n",
274 "image",
275 "inspection",
276 "io",
277 "java",
278 "lang",
279 "ldap",
280 "linguistic2",
281 "loader",
282 "logging",
283 "mail",
284 "media",
285 "mozilla",
286 "packages",
287 "packages/manifest",
288 "packages/zip",
289 "plugin",
290 "presentation",
291 "reflection",
292 "registry",
293 "rendering",
294 "report",
295 "report/inspection",
296 "resource",
297 "scanner",
298 "script",
299 "script/browse",
300 "script/provider",
301 "sdb",
302 "sdb/application",
303 "sdb/tools",
304 "sdbc",
305 "sdbcx",
306 "security",
307 "sheet",
308 "smarttags",
309 "style",
310 "svg",
311 "system",
312 "table",
313 "task",
314 "text",
315 "text/fieldmaster",
316 "text/textfield",
317 "text/textfield/docinfo",
318 "ucb",
319 "ui",
320 "ui/dialogs",
321 "uno",
322 "uri",
323 "util",
324 "view",
325 "xforms",
326 "xml",
327 "xml/crypto",
328 "xml/crypto/sax",
329 "xml/csax",
330 "xml/dom",
331 "xml/dom/events",
332 "xml/dom/views",
333 "xml/input",
334 "xml/sax",
335 "xml/wrapper",
336 "xml/xpath",
337 "xsd" );
339 # Due to MSI limitations have to use SHORT_NAMES on windows so can't check
340 if ($OperatingSystem ne "windows") {
341 foreach $i (@idl_dirlist)
343 $i =~ s/\//_1_1/g;
344 if (!check_file("docs/idl/ref/namespacecom_1_1sun_1_1star_1_1$i.html")) {
345 $return++;
346 print "\nERROR: \"docs/idl/ref/namespacecom_1_1sun_1_1star_1_1$i.html\" is missing\n";
347 } else {
348 print "+";
352 } else {
353 print "\nERROR: \"docs/idl/ref\" is missing\n";
354 $return++;
356 print "\n";
359 } else {
360 print "\nERROR: \"$SdkDir\" is missing\n";
361 $return++;
364 if( $return != 0 )
366 print "ERROR\n";
367 } else {
368 print "OK\n";
370 exit $return;