aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@theqtcompany.com>2015-10-28 19:03:44 -0700
committerJake Petroules <jake.petroules@theqtcompany.com>2015-11-02 16:44:21 +0000
commitce555d558b0b642f0c32fc0ea4cc94ab306735e6 (patch)
tree88b8587402a0bbed7e2b7000982866efac7d14d6
parenta36012d727bb0f755b349e64af481d315c06bd56 (diff)
Deprecate bundle.infoPlistFile and start tagging Info.plist files.
This ensures that artifacts will be appropriately rebuilt if the product's Info.plist file changes, which is currently ignored. Change-Id: I3adf7e74bd32f3bb8d3084061dd2793aa02b932c Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
-rw-r--r--doc/reference/modules/bundle-module.qdoc22
-rw-r--r--examples/cocoa-application/CocoaApplication.qbs2
-rw-r--r--examples/cocoa-touch-application/CocoaTouchApplication.qbs2
-rw-r--r--examples/install-bundle/install-bundle.qbs4
-rw-r--r--share/qbs/modules/bundle/BundleModule.qbs45
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs4
-rw-r--r--share/qbs/modules/cpp/gcc.js4
-rw-r--r--src/lib/corelib/language/tst_language.cpp4
8 files changed, 46 insertions, 41 deletions
diff --git a/doc/reference/modules/bundle-module.qdoc b/doc/reference/modules/bundle-module.qdoc
index deeb3ed83..daa444c3f 100644
--- a/doc/reference/modules/bundle-module.qdoc
+++ b/doc/reference/modules/bundle-module.qdoc
@@ -152,23 +152,13 @@
\li List of resources to copy to a bundle's Resources subdirectory. Files will automatically
be copied into lproj subdirectories corresponding to the input files' paths.
\row
- \li infoPlistFile
- \li \c{path}
- \li 1.4
- \li \c{undefined}
- \li Path to the Info.plist file used by the bundle.
- The contents of this file will be aggregated with the values in \c{infoPlist}.
- If \c{infoPlistFile} and \c{infoPlist} contain the same key, the latter will take
- precedence, but may also be overridden during postprocessing (see \c{processInfoPlist}).
- If undefined, will not be taken into account.
- \row
\li infoPlist
\li \c{object}
\li 1.4
\li \c{undefined}
\li Dictionary of key-value pairs to add to the bundle's Info.plist.
- The contents of this property will be aggregated with the values from \c{infoPlistFile}.
- If \c{infoPlist} and \c{infoPlistFile} contain the same key, the former will take
+ The contents of this property will be aggregated with the values from any plist files.
+ If \c{infoPlist} and any plist files contain the same key, the former will take
precedence, but may also be overridden during postprocessing (see \c{processInfoPlist}).
If undefined, will not be taken into account.
\row
@@ -178,8 +168,8 @@
\li \c{true}
\li Whether to perform post-processing on the aggregated Info.plist contents.
If this property is \c{true}, various post-processing operations will be applied to the
- bundle's property list dictionary after it has been aggregated from the contents of the
- file specified by the \c{infoPlistFile} property and the \c{infoPlist} property.
+ bundle's property list dictionary after it has been aggregated from the contents of any
+ plist files on disk, and the \c{infoPlist} property.
First, values from a list of defaults will be added to the dictionary if they were not
already present. Then, values from the AdditionalInfo key of the platform SDK's
Info.plist file will be added to the dictionary if they were not already present, as
@@ -198,8 +188,8 @@
\li \c{string}
\li 1.4
\li \c{"binary1"} for iOS;
- \c{"same-as-input"} or \c{"xml1"} for OS X depending on whether \c{infoPlistFile} is
- specified; undefined for all other operating systems.
+ \c{"same-as-input"} or \c{"xml1"} for OS X depending on whether a plist file is used;
+ \c{undefined} for all other operating systems.
\li The file format to write the product's resulting Info.plist in.
Possible values: \c{"xml1"}, \c{"binary1"}, \c{"json"}, \c{"same-as-input"}
\endtable
diff --git a/examples/cocoa-application/CocoaApplication.qbs b/examples/cocoa-application/CocoaApplication.qbs
index 95d55e95a..5e9ad9547 100644
--- a/examples/cocoa-application/CocoaApplication.qbs
+++ b/examples/cocoa-application/CocoaApplication.qbs
@@ -45,6 +45,7 @@ CppApplication {
cpp.precompiledHeader: "CocoaApplication/CocoaApplication-Prefix.pch"
+ // TODO: Remove in 1.6
bundle.infoPlistFile: "CocoaApplication/CocoaApplication-Info.plist"
cpp.frameworks: ["Cocoa"]
@@ -54,6 +55,7 @@ CppApplication {
files: [
"AppDelegate.h",
"AppDelegate.m",
+ //"CocoaApplication-Info.plist",
"CocoaApplication-Prefix.pch",
"main.m"
]
diff --git a/examples/cocoa-touch-application/CocoaTouchApplication.qbs b/examples/cocoa-touch-application/CocoaTouchApplication.qbs
index ac5b3dc41..0aa5b31d5 100644
--- a/examples/cocoa-touch-application/CocoaTouchApplication.qbs
+++ b/examples/cocoa-touch-application/CocoaTouchApplication.qbs
@@ -45,6 +45,7 @@ CppApplication {
cpp.precompiledHeader: "CocoaTouchApplication/CocoaTouchApplication-Prefix.pch"
+ // TODO: Remove in 1.6
bundle.infoPlistFile: "CocoaTouchApplication/CocoaTouchApplication-Info.plist"
cpp.frameworks: [ "UIKit", "Foundation", "CoreGraphics" ]
@@ -54,6 +55,7 @@ CppApplication {
files: [
"AppDelegate.h",
"AppDelegate.m",
+ //"CocoaTouchApplication-Info.plist",
"CocoaTouchApplication-Prefix.pch",
"Default-568h@2x.png",
"Default.png",
diff --git a/examples/install-bundle/install-bundle.qbs b/examples/install-bundle/install-bundle.qbs
index b13028582..a1b58e3e3 100644
--- a/examples/install-bundle/install-bundle.qbs
+++ b/examples/install-bundle/install-bundle.qbs
@@ -20,7 +20,7 @@ Project {
}
Group {
- fileTagsFilter: ["infoplist"]
+ fileTagsFilter: ["aggregate_infoplist"]
qbs.install: install && bundle.isBundle && !bundle.embedInfoPlist
qbs.installDir: FileInfo.joinPaths(installDir, FileInfo.path(bundle.infoPlistPath))
}
@@ -49,7 +49,7 @@ Project {
}
Group {
- fileTagsFilter: ["infoplist"]
+ fileTagsFilter: ["aggregate_infoplist"]
qbs.install: install && bundle.isBundle && !bundle.embedInfoPlist
qbs.installDir: FileInfo.joinPaths(installDir, FileInfo.path(bundle.infoPlistPath))
}
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs
index 81961cd7f..5f7b3dfac 100644
--- a/share/qbs/modules/bundle/BundleModule.qbs
+++ b/share/qbs/modules/bundle/BundleModule.qbs
@@ -95,15 +95,10 @@ Module {
property pathList privateHeaders
property pathList resources
- property path infoPlistFile
property var infoPlist
property bool processInfoPlist: true
property bool embedInfoPlist: product.type.contains("application") && !isBundle
- property string infoPlistFormat: {
- if (qbs.targetOS.contains("osx"))
- return infoPlistFile ? "same-as-input" : "xml1";
- return "binary1";
- }
+ property string infoPlistFormat: qbs.targetOS.contains("osx") ? "same-as-input" : "binary1"
property string localizedResourcesFolderSuffix: ".lproj"
@@ -186,18 +181,27 @@ Module {
};
}
+ FileTagger {
+ fileTags: ["infoplist"]
+ patterns: ["Info.plist", "*-Info.plist"]
+ }
+
+ // TODO: Remove in 1.6 (deprecated, backwards compatibility)
+ property path infoPlistFile
+ Group { name: "Info.plist"; files: bundle.infoPlistFile ? [bundle.infoPlistFile] : [] }
+
Rule {
condition: qbs.targetOS.contains("darwin")
multiplex: true
- inputs: ["qbs", "partial_infoplist"]
+ inputs: ["qbs", "infoplist", "partial_infoplist"]
- outputFileTags: ["infoplist"]
+ outputFileTags: ["aggregate_infoplist"]
outputArtifacts: {
var artifacts = [];
if (ModUtils.moduleProperty(product, "isBundle") || ModUtils.moduleProperty(product, "embedInfoPlist")) {
artifacts.push({
filePath: FileInfo.joinPaths(product.destinationDirectory, ModUtils.moduleProperty(product, "infoPlistPath")),
- fileTags: ["infoplist"]
+ fileTags: ["aggregate_infoplist"]
});
}
return artifacts;
@@ -207,8 +211,8 @@ Module {
var cmd = new JavaScriptCommand();
cmd.description = "generating Info.plist for " + product.name;
cmd.highlight = "codegen";
+ cmd.infoPlistFiles = inputs.infoplist;
cmd.partialInfoPlistFiles = inputs.partial_infoplist;
- cmd.infoPlistFile = ModUtils.moduleProperty(product, "infoPlistFile");
cmd.infoPlist = ModUtils.moduleProperty(product, "infoPlist") || {};
cmd.processInfoPlist = ModUtils.moduleProperty(product, "processInfoPlist");
cmd.infoPlistFormat = ModUtils.moduleProperty(product, "infoPlistFormat");
@@ -233,7 +237,14 @@ Module {
// Contains the combination of default, file, and in-source keys and values
// Start out with the contents of this file as the "base", if given
- var aggregatePlist = BundleTools.infoPlistContents(infoPlistFile) || {};
+ var aggregatePlist = {};
+ for (i in infoPlistFiles) {
+ aggregatePlist = BundleTools.infoPlistContents(infoPlistFiles[i].filePath);
+ infoPlistFormat = (infoPlistFormat === "same-as-input")
+ ? BundleTools.infoPlistFormat(infoPlistFiles[i].filePath)
+ : "xml1";
+ break;
+ }
// Add local key-value pairs (overrides equivalent keys specified in the file if
// one was given)
@@ -337,8 +348,8 @@ Module {
// This also follows Xcode behavior
DarwinTools.cleanPropertyList(aggregatePlist);
- if (infoPlistFormat === "same-as-input" && infoPlistFile)
- infoPlistFormat = BundleTools.infoPlistFormat(infoPlistFile);
+ if (infoPlistFormat === "same-as-input")
+ infoPlistFormat = "xml1";
var validFormats = [ "xml1", "binary1", "json" ];
if (!validFormats.contains(infoPlistFormat))
@@ -349,7 +360,7 @@ Module {
plist = new PropertyList();
try {
plist.readFromObject(aggregatePlist);
- plist.writeToFile(outputs.infoplist[0].filePath, infoPlistFormat);
+ plist.writeToFile(outputs.aggregate_infoplist[0].filePath, infoPlistFormat);
} finally {
plist.clear();
}
@@ -361,7 +372,7 @@ Module {
Rule {
condition: qbs.targetOS.contains("darwin")
multiplex: true
- inputs: ["infoplist"]
+ inputs: ["aggregate_infoplist"]
outputFileTags: ["pkginfo"]
outputArtifacts: {
@@ -380,7 +391,7 @@ Module {
cmd.description = "generating PkgInfo for " + product.name;
cmd.highlight = "codegen";
cmd.sourceCode = function() {
- var infoPlist = BundleTools.infoPlistContents(inputs.infoplist[0].filePath);
+ var infoPlist = BundleTools.infoPlistContents(inputs.aggregate_infoplist[0].filePath);
var pkgType = infoPlist['CFBundlePackageType'];
if (!pkgType)
@@ -401,7 +412,7 @@ Module {
Rule {
condition: qbs.targetOS.contains("darwin")
multiplex: true
- inputs: ["infoplist", "pkginfo", "hpp",
+ inputs: ["aggregate_infoplist", "pkginfo", "hpp",
"icns", "resourcerules", "xcent",
"compiled_ibdoc", "compiled_assetcatalog",
"xcode.provisioningprofile.main"]
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index 86788352c..0628be578 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -252,7 +252,7 @@ CppModule {
if (product.type.contains("application") &&
product.moduleProperty("qbs", "targetOS").contains("darwin") &&
product.moduleProperty("bundle", "embedInfoPlist"))
- tags.push("infoplist");
+ tags.push("aggregate_infoplist");
return tags;
}
inputsFromDependencies: ["dynamiclibrary_copy", "staticlibrary"]
@@ -297,7 +297,7 @@ CppModule {
if (product.type.contains("application") &&
product.moduleProperty("qbs", "targetOS").contains("darwin") &&
product.moduleProperty("bundle", "embedInfoPlist"))
- tags.push("infoplist");
+ tags.push("aggregate_infoplist");
return tags;
}
inputsFromDependencies: ["dynamiclibrary_copy", "staticlibrary"]
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 3f1e65b2e..8619265cf 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -174,8 +174,8 @@ function linkerFlags(product, inputs, output) {
}
}
- if (inputs.infoplist)
- args.push("-sectcreate", "__TEXT", "__info_plist", inputs.infoplist[0].filePath);
+ if (inputs.aggregate_infoplist)
+ args.push("-sectcreate", "__TEXT", "__info_plist", inputs.aggregate_infoplist[0].filePath);
var stdlib = product.moduleProperty("cpp", "cxxStandardLibrary");
if (stdlib && product.moduleProperty("qbs", "toolchain").contains("clang"))
diff --git a/src/lib/corelib/language/tst_language.cpp b/src/lib/corelib/language/tst_language.cpp
index 5b4142547..6e76cd33e 100644
--- a/src/lib/corelib/language/tst_language.cpp
+++ b/src/lib/corelib/language/tst_language.cpp
@@ -1777,7 +1777,7 @@ void TestLanguage::wildcards()
QVERIFY(product);
GroupPtr group;
if (useGroup) {
- QCOMPARE(product->groups.count(), 2);
+ QCOMPARE(product->groups.count(), 3);
foreach (const GroupPtr &rg, product->groups) {
if (rg->name == groupName) {
group = rg;
@@ -1785,7 +1785,7 @@ void TestLanguage::wildcards()
}
}
} else {
- QCOMPARE(product->groups.count(), 1);
+ QCOMPARE(product->groups.count(), 2);
group = product->groups.first();
}
QVERIFY(group);