diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-08-28 18:05:13 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-08-30 17:58:15 +0000 |
commit | 56aa7f98c2b9e49ee67d5b87628a9d5724c42181 (patch) | |
tree | 78923f4232736ff2d4285b8bcb53614c83894f12 /share | |
parent | ece472d180eebc49f8c3efa88ff36b057c62e058 (diff) |
AndroidApk: don't error out if no AndroidManifest.xml file exists
If the AndroidManifest.xml files does not exist at the *default* file
path, simply don't add it to the project. Only if the user explicitly
specifies an AndroidManifest.xml do we error out now.
This prepares for adding Manifest Merger support, which allows projects
to omit an Android manifest file entirely, in which case Qbs will
synthesize one from various properties.
Change-Id: I7c7ff2290c4d0a02d215ab35228edabfa02c307d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/base/AndroidApk.qbs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/share/qbs/imports/qbs/base/AndroidApk.qbs b/share/qbs/imports/qbs/base/AndroidApk.qbs index c6f3ce7de..8ba7ff049 100644 --- a/share/qbs/imports/qbs/base/AndroidApk.qbs +++ b/share/qbs/imports/qbs/base/AndroidApk.qbs @@ -29,6 +29,7 @@ ****************************************************************************/ import qbs +import qbs.File import qbs.FileInfo Product { @@ -44,7 +45,10 @@ Product { property path resourcesDir: FileInfo.joinPaths(sourceSetDir, "res") property path assetsDir: FileInfo.joinPaths(sourceSetDir, "assets") property path sourcesDir: FileInfo.joinPaths(sourceSetDir, legacyLayout ? "src" : "java") - property path manifestFile: FileInfo.joinPaths(sourceSetDir, "AndroidManifest.xml") + property path manifestFile: defaultManifestFile + + readonly property path defaultManifestFile: FileInfo.joinPaths(sourceSetDir, + "AndroidManifest.xml") Group { name: "java sources" @@ -72,6 +76,9 @@ Product { Group { name: "manifest" condition: product.automaticSources - files: [manifestFile] + fileTags: ["android.manifest"] + files: manifestFile && manifestFile !== defaultManifestFile + ? [manifestFile] + : (File.exists(defaultManifestFile) ? [defaultManifestFile] : []) } } |