summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-05-06 14:05:13 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-13 09:03:53 +0000
commit85e64f95c8637f876ba84dcbd01e375050e76d8c (patch)
tree3c596a7bf8524bf2d2b104af9b4fbc48a956a508
parentecaca66217be76f23e80948c042bc1a2ddeed3f8 (diff)
downloadqttools-85e64f95c8637f876ba84dcbd01e375050e76d8c.tar.gz
Add option for skipping use of private API.
The qsqlodbc and qsqlpsql are known to cause rejections from the Mac App store due to use of private/deprecated API. The plugins are deployed whenever the SQL module is used. Due to this corse granularity of plugin selection apps may find themselves rejected for plugins which they are not actually using. Make macdeployqt print a warning when sqlodbc or sqlpsql is deployed. Add "-appstore-compliant" which will skip deployment of the plugins. Task-number: QTBUG-37835 Task-number: QTBUG-38607 Change-Id: I7325156ffaf228a97d7ceeb12f329b3f10db4ff2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp11
-rw-r--r--src/macdeployqt/shared/shared.cpp16
2 files changed, 25 insertions, 2 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 80c89799f..450d11447 100644
--- a/src/macdeployqt/macdeployqt/main.cpp
+++ b/src/macdeployqt/macdeployqt/main.cpp
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
qDebug() << " -qmldir=<path> : Deploy imports used by .qml files in the given path";
qDebug() << " -always-overwrite : Copy files even if the target file exists";
qDebug() << " -codesign=<ident> : Run codesign with the given identity on all executables";
+ qDebug() << " -appstore-compliant: Skip deployment of components that use private API";
qDebug() << "";
qDebug() << "macdeployqt takes an application bundle as input and makes it";
qDebug() << "self-contained by copying in the Qt frameworks and plugins that";
@@ -61,6 +62,12 @@ int main(int argc, char **argv)
qDebug() << "framework. The accessibility, image formats, and text codec";
qDebug() << "plugins are always copied, unless \"-no-plugins\" is specified.";
qDebug() << "";
+ qDebug() << "Qt plugins may use private API and will cause the app to be";
+ qDebug() << "rejected from the Mac App store. MacDeployQt will print a warning";
+ qDebug() << "when known incompatible plugins are deployed. Use -appstore-compliant ";
+ qDebug() << "to skip these plugins. Currently two SQL plugins are known to";
+ qDebug() << "be incompatible: qsqlodbc and qsqlpsql.";
+ qDebug() << "";
qDebug() << "See the \"Deploying an Application on Qt/Mac\" topic in the";
qDebug() << "documentation for more information about deployment on Mac OS X.";
@@ -83,6 +90,7 @@ int main(int argc, char **argv)
QStringList qmlDirs;
extern bool runCodesign;
extern QString codesignIdentiy;
+ extern bool appstoreCompliant;
for (int i = 2; i < argc; ++i) {
QByteArray argument = QByteArray(argv[i]);
@@ -134,6 +142,9 @@ int main(int argc, char **argv)
runCodesign = true;
codesignIdentiy = argument.mid(index+1);
}
+ } else if (argument == QByteArray("-appstore-compliant")) {
+ LogDebug() << "Argument found:" << argument;
+ appstoreCompliant = true;
} else if (argument.startsWith("-")) {
LogError() << "Unknown argument" << argument << "\n";
return 1;
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index d6dcfb637..c5eb9f9d0 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -55,6 +55,7 @@ bool runStripEnabled = true;
bool alwaysOwerwriteEnabled = false;
bool runCodesign = false;
QString codesignIdentiy;
+bool appstoreCompliant = false;
int logLevel = 1;
using std::cout;
@@ -959,8 +960,19 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSql.framework"))) {
QStringList sqlPlugins = QDir(pluginSourcePath + QStringLiteral("/sqldrivers")).entryList(QStringList() << QStringLiteral("*.dylib"));
foreach (const QString &plugin, sqlPlugins) {
- if (!plugin.endsWith(QStringLiteral("_debug.dylib")))
- pluginList.append(QStringLiteral("sqldrivers/") + plugin);
+ if (plugin.endsWith(QStringLiteral("_debug.dylib")))
+ continue;
+
+ // Some sql plugins are known to cause app store rejections. Skip or warn for these plugins.
+ if (plugin.startsWith(QStringLiteral("libqsqlodbc")) || plugin.startsWith(QStringLiteral("libqsqlpsql"))) {
+ LogWarning() << "Plugin" << plugin << "uses private API and is not Mac App store compliant.";
+ if (appstoreCompliant) {
+ LogWarning() << "Skip plugin" << plugin;
+ continue;
+ }
+ }
+
+ pluginList.append(QStringLiteral("sqldrivers/") + plugin);
}
}