xcode generator: don't modify or copy QMAKE_INFO_PLIST

If the project has a custom Info.plist assigned to
QMAKE_INFO_PLIST, we should leave it as-is without
scanning and replacing contents inside it. Since we
always copy the file to the build folder at qmake
time, any later attempts to modify the source file
will not have any effect.

A better solution is to just reference the custom
plist directly from the Xcode, without modifying it.

This change will also stop unixmake2 from assigning the
default plist to QMAKE_INFO_PLIST, since we need to
know in the xcode generator if the variable was set in
the project or not.

Task-number: QTBUG-38260
Change-Id: I3c488b2960170c544d94f9db89d3ca95ee290bdd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2014-05-15 10:09:50 +02:00 committed by The Qt Project
parent bf50bf737b
commit 4be7cd09d6
2 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the qmake application of the Qt Toolkit.
@ -1390,9 +1390,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
project->isActiveConfig("lib_bundle"))) {
QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), Option::output_dir, input_dir);
if (plist.isEmpty())
if (!plist.isEmpty()) {
if (exists(plist))
t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", plist) << ";\n";
else
warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData());
} else {
plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
if (exists(plist)) {
QFile plist_in_file(plist);
if (plist_in_file.open(QIODevice::ReadOnly)) {
QTextStream plist_in(&plist_in_file);
@ -1422,8 +1426,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";\n";
}
}
} else {
warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData());
}
}

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the qmake application of the Qt Toolkit.
@ -732,6 +732,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//copy the plist
QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())),
info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString());
if (info_plist.isEmpty())
info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
bundledFiles << info_plist_out;
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
t << info_plist_out << ": \n\t";
@ -1269,8 +1271,6 @@ void UnixMakefileGenerator::init2()
if(plist.isEmpty())
plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
if(exists(Option::fixPathToLocalOS(plist))) {
if(project->isEmpty("QMAKE_INFO_PLIST"))
project->values("QMAKE_INFO_PLIST").append(plist);
project->values("QMAKE_INFO_PLIST_OUT").append(project->first("DESTDIR") +
project->first("QMAKE_BUNDLE") +
"/Contents/Info.plist");