38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include "symmake.h" |
42 #include "symmake.h" |
43 #include "initprojectdeploy_symbian.h" |
|
44 |
43 |
45 #include <qstring.h> |
44 #include <qstring.h> |
46 #include <qhash.h> |
45 #include <qhash.h> |
47 #include <qstringlist.h> |
46 #include <qstringlist.h> |
48 #include <qdir.h> |
47 #include <qdir.h> |
49 #include <qdatetime.h> |
48 #include <qdatetime.h> |
50 #include <stdlib.h> |
49 #include <stdlib.h> |
51 #include <qdebug.h> |
50 #include <qdebug.h> |
52 #include <qxmlstream.h> |
51 #include <qxmlstream.h> |
53 #include <qsettings> |
52 #include <QSettings> |
|
53 |
|
54 // Included from tools/shared |
|
55 #include <symbian/epocroot.h> |
54 |
56 |
55 #define RESOURCE_DIRECTORY_MMP "/resource/apps" |
57 #define RESOURCE_DIRECTORY_MMP "/resource/apps" |
56 #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" |
58 #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" |
57 #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" |
59 #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" |
58 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" |
60 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" |
59 #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" |
61 #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" |
60 #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1) |
|
61 |
62 |
62 #define BLD_INF_RULES_BASE "BLD_INF_RULES." |
63 #define BLD_INF_RULES_BASE "BLD_INF_RULES." |
63 #define BLD_INF_TAG_PLATFORMS "prj_platforms" |
64 #define BLD_INF_TAG_PLATFORMS "prj_platforms" |
64 #define BLD_INF_TAG_MMPFILES "prj_mmpfiles" |
65 #define BLD_INF_TAG_MMPFILES "prj_mmpfiles" |
65 #define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" |
66 #define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" |
66 #define BLD_INF_TAG_EXTENSIONS "prj_extensions" |
67 #define BLD_INF_TAG_EXTENSIONS "prj_extensions" |
|
68 #define BLD_INF_TAG_TESTEXTENSIONS "prj_testextensions" |
67 |
69 |
68 #define RSS_RULES "RSS_RULES" |
70 #define RSS_RULES "RSS_RULES" |
69 #define RSS_RULES_BASE "RSS_RULES." |
71 #define RSS_RULES_BASE "RSS_RULES." |
70 #define RSS_TAG_NBROFICONS "number_of_icons" |
72 #define RSS_TAG_NBROFICONS "number_of_icons" |
71 #define RSS_TAG_ICONFILE "icon_file" |
73 #define RSS_TAG_ICONFILE "icon_file" |
|
74 #define RSS_TAG_HEADER "header" |
|
75 #define RSS_TAG_SERVICE_LIST "service_list" |
|
76 #define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list" |
|
77 #define RSS_TAG_DATATYPE_LIST "datatype_list" |
|
78 #define RSS_TAG_FOOTER "footer" |
|
79 #define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag |
72 |
80 |
73 #define MMP_TARGET "TARGET" |
81 #define MMP_TARGET "TARGET" |
74 #define MMP_TARGETTYPE "TARGETTYPE" |
82 #define MMP_TARGETTYPE "TARGETTYPE" |
75 #define MMP_SECUREID "SECUREID" |
83 #define MMP_SECUREID "SECUREID" |
76 #define MMP_OPTION_CW "OPTION CW" |
84 #define MMP_OPTION_CW "OPTION CW" |
88 #define MMP_VERSION "VERSION" |
96 #define MMP_VERSION "VERSION" |
89 #define MMP_START_RESOURCE "START RESOURCE" |
97 #define MMP_START_RESOURCE "START RESOURCE" |
90 #define MMP_END_RESOURCE "END" |
98 #define MMP_END_RESOURCE "END" |
91 |
99 |
92 #define SIS_TARGET "sis" |
100 #define SIS_TARGET "sis" |
|
101 #define INSTALLER_SIS_TARGET "installer_sis" |
|
102 #define ROM_STUB_SIS_TARGET "stub_sis" |
93 #define OK_SIS_TARGET "ok_sis" |
103 #define OK_SIS_TARGET "ok_sis" |
|
104 #define OK_INSTALLER_SIS_TARGET "ok_installer_sis" |
|
105 #define OK_ROM_STUB_SIS_TARGET "ok_stub_sis" |
94 #define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg" |
106 #define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg" |
95 #define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache" |
107 #define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache" |
96 #define RESTORE_BUILD_TARGET "restore_build" |
|
97 |
108 |
98 #define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); |
109 #define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); |
|
110 |
|
111 #define MANUFACTURER_NOTE_FILE "manufacturer_note.txt" |
|
112 #define DEFAULT_MANUFACTURER_NOTE \ |
|
113 "The package is not supported for devices from this manufacturer. Please try the selfsigned " \ |
|
114 "version of the package instead." |
99 |
115 |
100 QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) |
116 QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) |
101 { |
117 { |
102 static QString epocRootStr; |
118 static QString epocRootStr; |
103 if (epocRootStr.isEmpty()) { |
119 if (epocRootStr.isEmpty()) { |
104 QFileInfo efi(epocRoot()); |
120 epocRootStr = epocRoot(); |
105 epocRootStr = efi.canonicalFilePath(); |
121 QFileInfo efi(epocRootStr); |
106 if (epocRootStr.isEmpty()) { |
122 if (!efi.exists() || epocRootStr.isEmpty()) { |
107 fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot())); |
123 fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot())); |
108 epocRootStr = "/"; |
124 epocRootStr = "/"; |
|
125 } else { |
|
126 epocRootStr = efi.absoluteFilePath(); |
109 } |
127 } |
110 if (!epocRootStr.endsWith("/")) |
128 if (!epocRootStr.endsWith("/")) |
111 epocRootStr += "/"; |
129 epocRootStr += "/"; |
112 |
130 |
113 epocRootStr += "epoc32/"; |
131 epocRootStr += "epoc32/"; |
127 resultPath = "."; |
145 resultPath = "."; |
128 |
146 |
129 return resultPath; |
147 return resultPath; |
130 } |
148 } |
131 |
149 |
132 QString SymbianMakefileGenerator::canonizePath(const QString& origPath) |
150 QString SymbianMakefileGenerator::absolutizePath(const QString& origPath) |
133 { |
151 { |
134 // Since current path gets appended almost always anyway, use it as default |
|
135 // for nonexisting paths. |
|
136 static QString defaultPath; |
|
137 if (defaultPath.isEmpty()) { |
|
138 QFileInfo fi("."); |
|
139 defaultPath = fi.canonicalFilePath(); |
|
140 } |
|
141 |
|
142 // Prepend epocroot to any paths beginning with "/epoc32/" |
152 // Prepend epocroot to any paths beginning with "/epoc32/" |
143 QString resultPath = QDir::fromNativeSeparators(origPath); |
153 QString resultPath = QDir::fromNativeSeparators(origPath); |
144 QString tempPath(resultPath); |
154 if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive)) |
145 bool isEpoc = false; |
|
146 if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive)) { |
|
147 isEpoc = true; |
|
148 resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1); |
155 resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1); |
149 } |
|
150 |
156 |
151 QFileInfo fi(fileInfo(resultPath)); |
157 QFileInfo fi(fileInfo(resultPath)); |
152 if(fi.isDir()) { |
158 |
153 if (isEpoc) |
159 // Since origPath can be something given in HEADERS, we need to check if we are dealing |
154 resultPath = fi.absoluteFilePath();//canonicalFilePath(); |
160 // with a file or a directory. In case the origPath doesn't yet exist, isFile() returns |
155 else |
161 // false and we default to assuming it is a dir. |
156 resultPath = fi.canonicalFilePath(); |
162 if (fi.isFile()) { |
|
163 resultPath = fi.absolutePath(); |
157 } else { |
164 } else { |
158 if (isEpoc) |
165 resultPath = fi.absoluteFilePath(); |
159 resultPath = fi.absolutePath();//canonicalPath(); |
|
160 else |
|
161 resultPath = fi.canonicalPath(); |
|
162 } |
|
163 //some fix for the not existed EPOC32\include folder |
|
164 if (isEpoc) { |
|
165 int index = resultPath.lastIndexOf("/epoc32/"); |
|
166 QString tmpRes = resultPath.mid(index); |
|
167 if (tmpRes != tempPath) { |
|
168 //we have the problems for not existed include directory |
|
169 //change the path |
|
170 resultPath.replace(tmpRes, tempPath); |
|
171 } |
|
172 } |
166 } |
173 |
167 |
174 resultPath = QDir::cleanPath(resultPath); |
168 resultPath = QDir::cleanPath(resultPath); |
175 |
|
176 if (resultPath.isEmpty()) |
|
177 resultPath = defaultPath; |
|
178 |
169 |
179 return resultPath; |
170 return resultPath; |
180 } |
171 } |
181 |
172 |
182 SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } |
173 SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } |
313 } |
308 } |
314 if (Option::mkfile::listgen) { |
309 if (Option::mkfile::listgen) { |
315 generatePrint(fileInfo(pkgFile.fileName()).absoluteFilePath()); |
310 generatePrint(fileInfo(pkgFile.fileName()).absoluteFilePath()); |
316 } |
311 } |
317 generatedFiles << pkgFile.fileName(); |
312 generatedFiles << pkgFile.fileName(); |
|
313 QTextStream t(&pkgFile); |
|
314 |
|
315 QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n"); |
|
316 if (installerSisHeader.isEmpty()) |
|
317 installerSisHeader = "0xA000D7CE"; // Use default self-signable UID if not defined |
|
318 |
|
319 QString wrapperStreamBuffer; |
|
320 QTextStream tw(&wrapperStreamBuffer); |
|
321 |
|
322 QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate); |
318 |
323 |
319 // Header info |
324 // Header info |
320 QTextStream t(&pkgFile); |
325 QString wrapperPkgFilename = QString("%1_installer.%2") |
321 t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl; |
326 .arg(fixedTarget) |
322 t << "; This file is generated by qmake and should not be modified by the user" << endl; |
327 .arg("pkg"); |
323 t << ";" << endl << endl; |
328 QString headerComment = "; %1 generated by qmake at %2\n" |
|
329 "; This file is generated by qmake and should not be modified by the user\n" |
|
330 ";\n\n"; |
|
331 t << headerComment.arg(pkgFilename).arg(dateStr); |
|
332 tw << headerComment.arg(wrapperPkgFilename).arg(dateStr); |
324 |
333 |
325 // Construct QStringList from pkg_prerules since we need search it before printed to file |
334 // Construct QStringList from pkg_prerules since we need search it before printed to file |
|
335 // Note: Though there can't be more than one language or header line, use stringlists |
|
336 // in case user wants comments to go with the rules. |
326 QStringList rawPkgPreRules; |
337 QStringList rawPkgPreRules; |
|
338 QStringList languageRules; |
|
339 QStringList headerRules; |
327 foreach(QString deploymentItem, project->values("DEPLOYMENT")) { |
340 foreach(QString deploymentItem, project->values("DEPLOYMENT")) { |
328 foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { |
341 foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { |
329 QStringList pkgrulesValue = project->values(pkgrulesItem); |
342 QStringList pkgrulesValue = project->values(pkgrulesItem); |
330 // If there is no stringlist defined for a rule, use rule name directly |
343 // If there is no stringlist defined for a rule, use rule name directly |
331 // This is convenience for defining single line mmp statements |
344 // This is convenience for defining single line mmp statements |
332 if (pkgrulesValue.isEmpty()) { |
345 if (pkgrulesValue.isEmpty()) { |
333 rawPkgPreRules << pkgrulesItem; |
346 if (pkgrulesItem.startsWith("&")) |
|
347 languageRules << pkgrulesItem; |
|
348 else if (pkgrulesItem.startsWith("#")) |
|
349 headerRules << pkgrulesItem; |
|
350 else |
|
351 rawPkgPreRules << pkgrulesItem; |
334 } else { |
352 } else { |
335 foreach(QString pkgrule, pkgrulesValue) { |
353 if (containsStartWithItem('&', pkgrulesValue)) { |
336 rawPkgPreRules << pkgrule; |
354 foreach(QString pkgrule, pkgrulesValue) { |
|
355 languageRules << pkgrule; |
|
356 } |
|
357 } else if (containsStartWithItem('#', pkgrulesValue)) { |
|
358 foreach(QString pkgrule, pkgrulesValue) { |
|
359 headerRules << pkgrule; |
|
360 } |
|
361 } else { |
|
362 foreach(QString pkgrule, pkgrulesValue) { |
|
363 rawPkgPreRules << pkgrule; |
|
364 } |
337 } |
365 } |
338 } |
366 } |
339 } |
367 } |
340 } |
368 } |
341 |
369 |
342 // Apply some defaults if specific data does not exist in PKG pre-rules |
370 // Apply some defaults if specific data does not exist in PKG pre-rules |
343 |
371 |
344 if (!containsStartWithItem('&', rawPkgPreRules)) { |
372 if (languageRules.isEmpty()) { |
345 // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) |
373 // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) |
346 t << "; Language" << endl; |
374 languageRules << "; Language\n&EN\n\n"; |
347 t << "&EN" << endl << endl; |
375 } else if (headerRules.isEmpty()) { |
348 } else { |
|
349 // In case user defines langs, he must take care also about SIS header |
376 // In case user defines langs, he must take care also about SIS header |
350 if (!containsStartWithItem('#', rawPkgPreRules)) |
377 fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); |
351 fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); |
378 } |
352 } |
379 |
|
380 t << languageRules.join("\n") << endl; |
|
381 tw << languageRules.join("\n") << endl; |
353 |
382 |
354 // name of application, UID and version |
383 // name of application, UID and version |
355 QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); |
384 QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); |
356 |
385 QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; |
357 if (!containsStartWithItem('#', rawPkgPreRules)) { |
386 QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET"))); |
358 QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET"))); |
387 visualTarget = removePathSeparators(visualTarget); |
359 visualTarget = removePathSeparators(visualTarget); |
388 QString wrapperTarget = visualTarget + " installer"; |
360 |
389 |
361 t << "; SIS header: name, uid, version" << endl; |
390 if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) { |
362 t << QString("#{\"%1\"},(%2),%3").arg(visualTarget).arg(uid3).arg(applicationVersion) << endl << endl; |
391 tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion); |
363 } |
392 } else { |
|
393 tw << installerSisHeader << endl; |
|
394 } |
|
395 |
|
396 if (headerRules.isEmpty()) |
|
397 t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion); |
|
398 else |
|
399 t << headerRules.join("\n") << endl; |
364 |
400 |
365 // Localized vendor name |
401 // Localized vendor name |
|
402 QString vendorName; |
366 if (!containsStartWithItem('%', rawPkgPreRules)) { |
403 if (!containsStartWithItem('%', rawPkgPreRules)) { |
367 t << "; Localised Vendor name" << endl; |
404 vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n"; |
368 t << "%{\"Vendor\"}" << endl << endl; |
|
369 } |
405 } |
370 |
406 |
371 // Unique vendor name |
407 // Unique vendor name |
372 if (!containsStartWithItem(':', rawPkgPreRules)) { |
408 if (!containsStartWithItem(':', rawPkgPreRules)) { |
373 t << "; Unique Vendor name" << endl; |
409 vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n"; |
374 t << ":\"Vendor\"" << endl << endl; |
410 } |
375 } |
411 |
|
412 t << vendorName; |
|
413 tw << vendorName; |
376 |
414 |
377 // PKG pre-rules - these are added before actual file installations i.e. SIS package body |
415 // PKG pre-rules - these are added before actual file installations i.e. SIS package body |
378 if (rawPkgPreRules.size()) { |
416 if (rawPkgPreRules.size()) { |
379 t << "; Manual PKG pre-rules from PRO files" << endl; |
417 QString comment = "\n; Manual PKG pre-rules from PRO files\n"; |
|
418 t << comment; |
|
419 tw << comment; |
|
420 |
380 foreach(QString item, rawPkgPreRules) { |
421 foreach(QString item, rawPkgPreRules) { |
|
422 // Only regular pkg file should have package dependencies or pkg header if that is |
|
423 // defined using prerules. |
|
424 if (!item.startsWith("(") && !item.startsWith("#")) { |
|
425 tw << item << endl; |
|
426 } |
381 t << item << endl; |
427 t << item << endl; |
382 } |
428 } |
383 t << endl; |
429 t << endl; |
|
430 tw << endl; |
|
431 } |
|
432 |
|
433 // Begin Manufacturer block |
|
434 if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { |
|
435 QString manufacturerStr("IF "); |
|
436 foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) { |
|
437 manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer)); |
|
438 } |
|
439 // Remove the final OR |
|
440 manufacturerStr.chop(8); |
|
441 t << manufacturerStr << endl; |
384 } |
442 } |
385 |
443 |
386 // Install paths on the phone *** should be dynamic at some point |
444 // Install paths on the phone *** should be dynamic at some point |
387 QString installPathBin = "!:\\sys\\bin"; |
445 QString installPathBin = "!:\\sys\\bin"; |
388 QString installPathResource = "!:\\resource\\apps"; |
446 QString installPathResource = "!:\\resource\\apps"; |
389 QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; |
447 QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; |
390 |
448 |
391 // Find location of builds |
449 // Find location of builds |
392 QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)") |
450 QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)") |
393 .arg(epocRoot()); |
451 .arg(epocRoot()); |
394 |
|
395 |
452 |
396 if (targetType == TypeExe) { |
453 if (targetType == TypeExe) { |
397 // deploy .exe file |
454 // deploy .exe file |
398 t << "; Executable and default resource files" << endl; |
455 t << "; Executable and default resource files" << endl; |
399 QString exeFile = fixedTarget + ".exe"; |
456 QString exeFile = fixedTarget + ".exe"; |
425 } |
482 } |
426 } |
483 } |
427 } |
484 } |
428 |
485 |
429 // deploy any additional DEPLOYMENT files |
486 // deploy any additional DEPLOYMENT files |
430 DeploymentList depList; |
|
431 QString remoteTestPath; |
487 QString remoteTestPath; |
432 remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); |
488 remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); |
|
489 QString zDir = epocRoot() + QLatin1String("epoc32/data/z"); |
433 |
490 |
434 initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); |
491 initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); |
435 if (depList.size()) |
492 if (depList.size()) |
436 t << "; DEPLOYMENT" << endl; |
493 t << "; DEPLOYMENT" << endl; |
437 for (int i = 0; i < depList.size(); ++i) { |
494 for (int i = 0; i < depList.size(); ++i) { |
438 t << QString("\"%1\" - \"%2\"") |
495 QString from = depList.at(i).from; |
439 .arg(QString(depList.at(i).from).replace('\\','/')) |
496 QString to = depList.at(i).to; |
440 .arg(depList.at(i).to) << endl; |
497 |
|
498 // Deploy anything not already deployed from under epoc32 instead from under |
|
499 // \epoc32\data\z\ to enable using pkg file without rebuilding |
|
500 // the project, which can be useful for some binary only distributions. |
|
501 if (!from.contains(QLatin1String("epoc32"), Qt::CaseInsensitive)) { |
|
502 from = to; |
|
503 if (from.size() > 1 && from.at(1) == QLatin1Char(':')) |
|
504 from = from.mid(2); |
|
505 from.prepend(zDir); |
|
506 } else { |
|
507 if (from.size() > 1 && from.at(1) == QLatin1Char(':')) |
|
508 from = from.mid(2); |
|
509 } |
|
510 |
|
511 t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl; |
441 } |
512 } |
442 t << endl; |
513 t << endl; |
443 |
514 |
444 // PKG post-rules - these are added after actual file installations i.e. SIS package body |
515 // PKG post-rules - these are added after actual file installations i.e. SIS package body |
445 t << "; Manual PKG post-rules from PRO files" << endl; |
516 t << "; Manual PKG post-rules from PRO files" << endl; |
456 } |
527 } |
457 } |
528 } |
458 t << endl; |
529 t << endl; |
459 } |
530 } |
460 } |
531 } |
|
532 |
|
533 // Close Manufacturer block |
|
534 if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { |
|
535 QString manufacturerFailNoteFile; |
|
536 if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) { |
|
537 manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3); |
|
538 QFile ft(manufacturerFailNoteFile); |
|
539 if (ft.open(QIODevice::WriteOnly)) { |
|
540 generatedFiles << ft.fileName(); |
|
541 QTextStream t2(&ft); |
|
542 |
|
543 t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl; |
|
544 } else { |
|
545 PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile) |
|
546 } |
|
547 } else { |
|
548 manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join(""); |
|
549 } |
|
550 |
|
551 t << "ELSEIF NOT(0) ; MANUFACTURER" << endl |
|
552 << "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\"" |
|
553 << " - \"\", FILETEXT, TEXTEXIT" << endl |
|
554 << "ENDIF ; MANUFACTURER" << endl; |
|
555 } |
|
556 |
|
557 // Write wrapper pkg |
|
558 if (!installerSisHeader.isEmpty()) { |
|
559 QFile wrapperPkgFile(wrapperPkgFilename); |
|
560 if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { |
|
561 PRINT_FILE_CREATE_ERROR(wrapperPkgFilename); |
|
562 return; |
|
563 } |
|
564 |
|
565 generatedFiles << wrapperPkgFile.fileName(); |
|
566 QTextStream twf(&wrapperPkgFile); |
|
567 |
|
568 twf << wrapperStreamBuffer << endl; |
|
569 |
|
570 // Wrapped files deployment |
|
571 QString currentPath = qmake_getpwd(); |
|
572 QString sisName = QString("%1.sis").arg(fixedTarget); |
|
573 twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl; |
|
574 |
|
575 QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath); |
|
576 bootStrapPath.append("/smartinstaller.sis"); |
|
577 QFileInfo fi(fileInfo(bootStrapPath)); |
|
578 twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl; |
|
579 } |
461 } |
580 } |
462 |
581 |
463 bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src) |
582 bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src) |
464 { |
583 { |
465 bool result = false; |
584 bool result = false; |
690 QStringList overridableMmpKeywords; |
818 QStringList overridableMmpKeywords; |
691 QStringList restrictableMmpKeywords; |
819 QStringList restrictableMmpKeywords; |
692 QStringList restrictedMmpKeywords; |
820 QStringList restrictedMmpKeywords; |
693 bool inResourceBlock = false; |
821 bool inResourceBlock = false; |
694 |
822 |
695 overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE); |
823 overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE) << QLatin1String(MMP_EPOCHEAPSIZE); |
696 restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) |
824 restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) |
697 << QLatin1String(MMP_OPTION_CW) << QLatin1String(MMP_OPTION_ARMCC) |
825 << QLatin1String(MMP_LINKEROPTION_CW) << QLatin1String(MMP_LINKEROPTION_ARMCC) |
698 << QLatin1String(MMP_OPTION_GCCE) << QLatin1String(MMP_LINKEROPTION_CW) |
826 << QLatin1String(MMP_LINKEROPTION_GCCE) |
699 << QLatin1String(MMP_LINKEROPTION_ARMCC) << QLatin1String(MMP_LINKEROPTION_GCCE) |
|
700 << QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) |
827 << QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) |
701 << QLatin1String(MMP_EPOCHEAPSIZE) << QLatin1String(MMP_EPOCSTACKSIZE) |
828 << QLatin1String(MMP_EPOCSTACKSIZE) << QLatin1String(MMP_UID) |
702 << QLatin1String(MMP_UID) << QLatin1String(MMP_VENDORID) |
829 << QLatin1String(MMP_VENDORID) << QLatin1String(MMP_VERSION); |
703 << QLatin1String(MMP_VERSION); |
|
704 |
830 |
705 foreach (QString item, project->values("MMP_RULES")) { |
831 foreach (QString item, project->values("MMP_RULES")) { |
706 if (project->values(item).isEmpty()) { |
832 if (project->values(item).isEmpty()) { |
707 handleMmpRulesOverrides(item, inResourceBlock, restrictedMmpKeywords, |
833 handleMmpRulesOverrides(item, inResourceBlock, restrictedMmpKeywords, |
708 restrictableMmpKeywords, overridableMmpKeywords); |
834 restrictableMmpKeywords, overridableMmpKeywords); |
872 |
998 |
873 |
999 |
874 void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) |
1000 void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) |
875 { |
1001 { |
876 bool skipTargetType = overriddenMmpKeywords.contains(MMP_TARGETTYPE); |
1002 bool skipTargetType = overriddenMmpKeywords.contains(MMP_TARGETTYPE); |
|
1003 bool skipEpocHeapSize = overriddenMmpKeywords.contains(MMP_EPOCHEAPSIZE); |
877 |
1004 |
878 if (targetType == TypeExe) { |
1005 if (targetType == TypeExe) { |
879 t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; |
1006 t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; |
880 if (!skipTargetType) { |
1007 if (!skipTargetType) { |
881 if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) |
1008 if (project->isActiveConfig("stdbinary")) |
882 t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; |
1009 t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; |
883 else |
1010 else |
884 t << MMP_TARGETTYPE "\t\tEXE" << endl; |
1011 t << MMP_TARGETTYPE "\t\tEXE" << endl; |
885 } |
1012 } |
886 } else if (targetType == TypeDll || targetType == TypePlugin) { |
1013 } else if (targetType == TypeDll || targetType == TypePlugin) { |
887 t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; |
1014 t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; |
888 if (!skipTargetType) { |
1015 if (!skipTargetType) { |
889 if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) |
1016 if (project->isActiveConfig("stdbinary")) |
890 t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; |
1017 t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; |
891 else |
1018 else |
892 t << MMP_TARGETTYPE "\t\tDLL" << endl; |
1019 t << MMP_TARGETTYPE "\t\tDLL" << endl; |
893 } |
1020 } |
894 } else if (targetType == TypeLib) { |
1021 } else if (targetType == TypeLib) { |
895 t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; |
1022 t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; |
896 if (!skipTargetType) { |
1023 if (!skipTargetType) { |
897 if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) |
1024 if (project->isActiveConfig("stdbinary")) |
898 t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; |
1025 t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; |
899 else |
1026 else |
900 t << MMP_TARGETTYPE "\t\tLIB" << endl; |
1027 t << MMP_TARGETTYPE "\t\tLIB" << endl; |
901 } |
1028 } |
902 } else { |
1029 } else { |
1334 userItems = userBldInfRules.value(mmpTag); |
1482 userItems = userBldInfRules.value(mmpTag); |
1335 foreach(QString item, userItems) |
1483 foreach(QString item, userItems) |
1336 t << item << endl; |
1484 t << item << endl; |
1337 userBldInfRules.remove(mmpTag); |
1485 userBldInfRules.remove(mmpTag); |
1338 |
1486 |
1339 t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl; |
1487 QString extensionTag; |
|
1488 if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) |
|
1489 extensionTag = QLatin1String(BLD_INF_TAG_TESTEXTENSIONS); |
|
1490 else |
|
1491 extensionTag = QLatin1String(BLD_INF_TAG_EXTENSIONS); |
|
1492 |
|
1493 t << endl << extensionTag << endl << endl; |
1340 |
1494 |
1341 // Generate extension rules |
1495 // Generate extension rules |
1342 |
1496 |
1343 writeBldInfExtensionRulesPart(t, iconFile); |
1497 writeBldInfExtensionRulesPart(t, iconFile); |
1344 |
1498 |
1345 userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS); |
1499 userItems = userBldInfRules.value(extensionTag); |
1346 foreach(QString item, userItems) |
1500 foreach(QString item, userItems) |
1347 t << item << endl; |
1501 t << item << endl; |
1348 userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS); |
1502 userBldInfRules.remove(extensionTag); |
1349 |
1503 |
1350 // Add rest of the user defined content |
1504 // Add rest of the user defined content |
1351 |
1505 |
1352 for (QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) { |
1506 for (QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) { |
1353 t << endl << endl << it.key() << endl << endl; |
1507 t << endl << endl << it.key() << endl << endl; |
1354 userItems = it.value(); |
1508 userItems = it.value(); |
1355 foreach(QString item, userItems) |
1509 foreach(QString item, userItems) |
1356 t << item << endl; |
1510 t << item << endl; |
1357 } |
1511 } |
1358 if (project->values("CONFIG").contains("headerexport", Qt::CaseInsensitive)) { |
1512 } |
1359 writeExportPart(t); |
1513 |
1360 } |
1514 void SymbianMakefileGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems) |
1361 } |
|
1362 |
|
1363 void SymbianMakefileGenerator::writeExportPart(QTextStream &t) |
|
1364 { |
|
1365 QDir currentDir = QDir::current(); |
|
1366 t << "prj_exports" << endl; |
|
1367 |
|
1368 foreach(QString install, project->values("INSTALLS")) { |
|
1369 QString installDir = project->first(install + ".path"); |
|
1370 |
|
1371 // Export macros are the recommended way, but might not be used |
|
1372 // in all cases (such as Qt headers). We handle it either way, |
|
1373 // macros or not. |
|
1374 bool useLayerMacro = false; |
|
1375 if (installDir.startsWith("MW_LAYER_") || |
|
1376 installDir.startsWith("APP_LAYER_") || |
|
1377 installDir.startsWith("APP_LAYER_")) { |
|
1378 useLayerMacro = true; |
|
1379 } else { |
|
1380 #ifdef Q_OS_WIN |
|
1381 // If we are running on Windows, and the export target starts |
|
1382 // with a drive letter, we need to remove it, the build tools |
|
1383 // cannot handle drives in export paths |
|
1384 |
|
1385 if (installDir.length() > 2 && installDir[1] == ':') { |
|
1386 installDir.remove(0, 2); |
|
1387 } |
|
1388 #endif |
|
1389 installDir.replace("\\", "/"); |
|
1390 if (!installDir.endsWith("/")) { |
|
1391 installDir.append("/"); |
|
1392 } |
|
1393 } |
|
1394 |
|
1395 foreach(QString target, project->values(install + ".files")) { |
|
1396 // Handle glob targets (only in the current directory) |
|
1397 if (target.contains("*") || target.contains("?")) { |
|
1398 QDir globber = QDir::current(); |
|
1399 globber.setNameFilters(QStringList(target)); |
|
1400 foreach(QString globbedTarget, globber.entryList()) { |
|
1401 if (useLayerMacro) { |
|
1402 QFileInfo globbedInfo(globbedTarget); |
|
1403 t << globbedTarget << " " << installDir << |
|
1404 "(" << globbedInfo.fileName() << ")" << endl; |
|
1405 } else { |
|
1406 t << globbedTarget << " " << installDir << |
|
1407 globbedTarget << endl; |
|
1408 } |
|
1409 } |
|
1410 } else { |
|
1411 target = currentDir.relativeFilePath(target); |
|
1412 QFileInfo targetInfo(target); |
|
1413 |
|
1414 // Not possible to export whole directories, extension makefile needed for this |
|
1415 // Note that this check requires the file to be exported to exist in the qmake phase! |
|
1416 if (targetInfo.isFile()) { |
|
1417 if (useLayerMacro) { |
|
1418 t << target << " " << installDir << |
|
1419 "(" << targetInfo.fileName() << ")" << endl; |
|
1420 } else { |
|
1421 t << target << " " << installDir << |
|
1422 targetInfo.fileName() << endl; |
|
1423 } |
|
1424 } |
|
1425 } |
|
1426 } |
|
1427 } |
|
1428 t << endl; |
|
1429 } |
|
1430 |
|
1431 void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems) |
|
1432 { |
1515 { |
1433 QString filename(fixedTarget); |
1516 QString filename(fixedTarget); |
1434 filename.append("_reg.rss"); |
1517 filename.append("_reg.rss"); |
1435 QFile ft(filename); |
1518 QFile ft(filename); |
1436 if (ft.open(QIODevice::WriteOnly)) { |
1519 if (ft.open(QIODevice::WriteOnly)) { |
1446 t << "// * user." << endl; |
1529 t << "// * user." << endl; |
1447 t << "// ============================================================================" << endl; |
1530 t << "// ============================================================================" << endl; |
1448 t << endl; |
1531 t << endl; |
1449 t << "#include <" << fixedTarget << ".rsg>" << endl; |
1532 t << "#include <" << fixedTarget << ".rsg>" << endl; |
1450 t << "#include <appinfo.rh>" << endl; |
1533 t << "#include <appinfo.rh>" << endl; |
|
1534 foreach(QString item, userItems[RSS_TAG_HEADER]) |
|
1535 t << item << endl; |
1451 t << endl; |
1536 t << endl; |
1452 t << "UID2 KUidAppRegistrationResourceFile" << endl; |
1537 t << "UID2 KUidAppRegistrationResourceFile" << endl; |
1453 t << "UID3 " << uid3 << endl << endl; |
1538 t << "UID3 " << uid3 << endl << endl; |
1454 t << "RESOURCE APP_REGISTRATION_INFO" << endl; |
1539 t << "RESOURCE APP_REGISTRATION_INFO" << endl; |
1455 t << "\t{" << endl; |
1540 t << "\t{" << endl; |
1456 t << "\tapp_file=\"" << fixedTarget << "\";" << endl; |
1541 t << "\tapp_file=\"" << fixedTarget << "\";" << endl; |
1457 t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; |
1542 t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; |
|
1543 |
|
1544 writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST], |
|
1545 QLatin1String(RSS_TAG_SERVICE_LIST), |
|
1546 QLatin1String("SERVICE_INFO")); |
|
1547 writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST], |
|
1548 QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST), |
|
1549 QLatin1String("FILE_OWNERSHIP_INFO")); |
|
1550 writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST], |
|
1551 QLatin1String(RSS_TAG_DATATYPE_LIST), |
|
1552 QLatin1String("DATATYPE")); |
1458 t << endl; |
1553 t << endl; |
1459 |
1554 |
1460 foreach(QString item, userItems) |
1555 foreach(QString item, userItems[RSS_TAG_DEFAULT]) |
1461 t << "\t" << item << endl; |
1556 t << "\t" << item.replace("\n","\n\t") << endl; |
1462 t << "\t}" << endl; |
1557 t << "\t}" << endl; |
|
1558 |
|
1559 foreach(QString item, userItems[RSS_TAG_FOOTER]) |
|
1560 t << item << endl; |
1463 } else { |
1561 } else { |
1464 PRINT_FILE_CREATE_ERROR(filename) |
1562 PRINT_FILE_CREATE_ERROR(filename) |
|
1563 } |
|
1564 } |
|
1565 |
|
1566 void SymbianMakefileGenerator::writeRegRssList(QTextStream &t, |
|
1567 QStringList &userList, |
|
1568 const QString &listTag, |
|
1569 const QString &listItem) |
|
1570 { |
|
1571 int itemCount = userList.count(); |
|
1572 if (itemCount) { |
|
1573 t << "\t" << listTag << " ="<< endl; |
|
1574 t << "\t\t{" << endl; |
|
1575 foreach(QString item, userList) { |
|
1576 t << "\t\t" << listItem << endl; |
|
1577 t << "\t\t\t{" << endl; |
|
1578 t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl; |
|
1579 t << "\t\t\t}"; |
|
1580 if (--itemCount) |
|
1581 t << ","; |
|
1582 t << endl; |
|
1583 } |
|
1584 t << "\t\t}; "<< endl; |
1465 } |
1585 } |
1466 } |
1586 } |
1467 |
1587 |
1468 void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile) |
1588 void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile) |
1469 { |
1589 { |
1631 } |
1749 } |
1632 } |
1750 } |
1633 } |
1751 } |
1634 } |
1752 } |
1635 } |
1753 } |
1636 if (shortCaption.isEmpty()) |
1754 if (shortCaption.isEmpty()){ |
1637 fprintf(stderr, "Warning: STRING_r_short_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
1755 fprintf(stderr, "Warning: STRING_r_short_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
1638 if (longCaption.isEmpty()) |
1756 fprintf(stderr, " : short caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
|
1757 } |
|
1758 if (longCaption.isEmpty()){ |
1639 fprintf(stderr, "Warning: STRING_r_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
1759 fprintf(stderr, "Warning: STRING_r_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
|
1760 fprintf(stderr, " : caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
|
1761 } |
1640 if (xml.hasError()) |
1762 if (xml.hasError()) |
1641 fprintf(stderr, "ERROR: \"%s\" when parsing ts file\n", qPrintable(xml.errorString())); |
1763 fprintf(stderr, "ERROR: \"%s\" when parsing ts file\n", qPrintable(xml.errorString())); |
1642 } else { |
1764 } else { |
1643 fprintf(stderr, "Could not open ts file (%s)\n", qPrintable(tsFilename)); |
1765 fprintf(stderr, "Could not open ts file (%s)\n", qPrintable(tsFilename)); |
1644 } |
1766 } |
1645 } else { |
1767 } else { |
1646 fprintf(stderr, "ts file does not exist: (%s)\n", qPrintable(tsFilename)); |
1768 fprintf(stderr, "Warning: ts file does not exist: (%s)\n", qPrintable(tsFilename)); |
|
1769 fprintf(stderr, " : short and long caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
1647 } |
1770 } |
1648 |
1771 |
1649 // generate language specific caption loc file |
1772 // generate language specific caption loc file |
1650 QFile ft(locFilename); |
1773 QFile ft(locFilename); |
1651 if (ft.open(QIODevice::WriteOnly)) { |
1774 if (ft.open(QIODevice::WriteOnly)) { |
1713 } else { |
1840 } else { |
1714 fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", |
1841 fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", |
1715 RSS_RULES_BASE, RSS_TAG_ICONFILE); |
1842 RSS_RULES_BASE, RSS_TAG_ICONFILE); |
1716 continue; |
1843 continue; |
1717 } |
1844 } |
|
1845 } else if (newKey == RSS_TAG_HEADER |
|
1846 || newKey == RSS_TAG_SERVICE_LIST |
|
1847 || newKey == RSS_TAG_FILE_OWNERSHIP_LIST |
|
1848 || newKey == RSS_TAG_DATATYPE_LIST |
|
1849 || newKey == RSS_TAG_FOOTER |
|
1850 || newKey == RSS_TAG_DEFAULT) { |
|
1851 userRssRules[newKey] = newValues; |
|
1852 continue; |
1718 } else { |
1853 } else { |
1719 fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", |
1854 fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", |
1720 RSS_RULES_BASE, newKey.toLatin1().constData()); |
1855 RSS_RULES_BASE, newKey.toLatin1().constData()); |
1721 continue; |
1856 continue; |
1722 } |
1857 } |
1723 } |
1858 } |
1724 } |
1859 } |
1725 |
1860 |
|
1861 QStringList newValues; |
1726 foreach(QString item, project->values(RSS_RULES)) { |
1862 foreach(QString item, project->values(RSS_RULES)) { |
1727 // If there is no stringlist defined for a rule, use rule name directly |
1863 // If there is no stringlist defined for a rule, use rule value directly |
1728 // This is convenience for defining single line mmp statements |
1864 // This is convenience for defining single line statements |
1729 if (project->values(item).isEmpty()) { |
1865 if (project->values(item).isEmpty()) { |
1730 userRssRules << item; |
1866 newValues << item; |
1731 } else { |
1867 } else { |
1732 userRssRules << project->values(item); |
1868 newValues << project->values(item); |
1733 } |
1869 } |
1734 } |
1870 } |
|
1871 userRssRules[RSS_TAG_DEFAULT] << newValues; |
1735 |
1872 |
1736 // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist |
1873 // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist |
1737 // or neither of them exist |
1874 // or neither of them exist |
1738 if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) || |
1875 if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) || |
1739 (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) { |
1876 (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) { |
2054 t << siscommand << endl; |
2196 t << siscommand << endl; |
2055 t << endl; |
2197 t << endl; |
2056 |
2198 |
2057 t << OK_SIS_TARGET ":" << endl; |
2199 t << OK_SIS_TARGET ":" << endl; |
2058 |
2200 |
2059 QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ |
2201 QString pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ |
2060 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") |
2202 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") |
2061 .arg(fixedTarget) |
2203 .arg(fixedTarget) |
2062 .arg("pkg"); |
2204 .arg("pkg"); |
2063 t << pkgcommand << endl; |
2205 t << pkgcommand << endl; |
2064 t << endl; |
2206 t << endl; |
2065 |
2207 |
|
2208 QString sisName = fixedTarget; |
|
2209 sisName += ".sis"; |
|
2210 |
|
2211 t << sisName << ":" << endl; |
|
2212 t << "\t$(MAKE) -s -f $(MAKEFILE) " SIS_TARGET << endl << endl; |
|
2213 |
|
2214 t << ROM_STUB_SIS_TARGET ":" << endl; |
|
2215 QString stubsiscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \ |
|
2216 "$(MAKE) -s -f $(MAKEFILE) %4," \ |
|
2217 "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \ |
|
2218 "$(MAKE) -s -f $(MAKEFILE) %5))," \ |
|
2219 "$(MAKE) -s -f $(MAKEFILE) %6)") |
|
2220 .arg(fixedTarget) |
|
2221 .arg("pkg") |
|
2222 .arg(MAKE_CACHE_NAME) |
|
2223 .arg(OK_ROM_STUB_SIS_TARGET) |
|
2224 .arg(FAIL_SIS_NOCACHE_TARGET) |
|
2225 .arg(FAIL_SIS_NOPKG_TARGET); |
|
2226 t << stubsiscommand << endl; |
|
2227 t << endl; |
|
2228 |
|
2229 t << OK_ROM_STUB_SIS_TARGET ":" << endl; |
|
2230 |
|
2231 QString stubpkgcommand = QString::fromLatin1("\tcreatepackage.bat -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ |
|
2232 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") |
|
2233 .arg(fixedTarget) |
|
2234 .arg("pkg"); |
|
2235 t << stubpkgcommand << endl; |
|
2236 t << endl; |
|
2237 |
|
2238 t << INSTALLER_SIS_TARGET ": " << sisName << endl; |
|
2239 siscommand = QString::fromLatin1("\t$(if $(wildcard %1_installer.%2)," \ |
|
2240 "$(MAKE) -s -f $(MAKEFILE) %3," \ |
|
2241 "$(MAKE) -s -f $(MAKEFILE) %4)") |
|
2242 .arg(fixedTarget) |
|
2243 .arg("pkg") |
|
2244 .arg(OK_INSTALLER_SIS_TARGET) |
|
2245 .arg(FAIL_SIS_NOPKG_TARGET); |
|
2246 t << siscommand << endl; |
|
2247 t << endl; |
|
2248 |
|
2249 t << OK_INSTALLER_SIS_TARGET ": " << endl; |
|
2250 |
|
2251 pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \ |
|
2252 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") |
|
2253 .arg(fixedTarget) |
|
2254 .arg("pkg"); |
|
2255 t << pkgcommand << endl; |
|
2256 t << endl; |
|
2257 |
2066 t << FAIL_SIS_NOPKG_TARGET ":" << endl; |
2258 t << FAIL_SIS_NOPKG_TARGET ":" << endl; |
2067 t << "\t$(error PKG file does not exist, 'SIS' target is only supported for executables or projects with DEPLOYMENT statement)" << endl; |
2259 t << "\t$(error PKG file does not exist, '" SIS_TARGET "' and '" INSTALLER_SIS_TARGET "' target are only supported for executables or projects with DEPLOYMENT statement)" << endl; |
2068 t << endl; |
2260 t << endl; |
2069 |
2261 |
2070 t << FAIL_SIS_NOCACHE_TARGET ":" << endl; |
2262 t << FAIL_SIS_NOCACHE_TARGET ":" << endl; |
2071 t << "\t$(error Project has to be build before calling 'SIS' target)" << endl; |
2263 t << "\t$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" << endl; |
2072 t << endl; |
|
2073 |
|
2074 |
|
2075 t << RESTORE_BUILD_TARGET ":" << endl; |
|
2076 t << "-include " MAKE_CACHE_NAME << endl; |
|
2077 t << endl; |
2264 t << endl; |
2078 } |
2265 } |
2079 |
2266 |
2080 void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) |
2267 void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) |
2081 { |
2268 { |