Skip to content

Commit

Permalink
Rewrite the Info.plist variable replacement handling
Browse files Browse the repository at this point in the history
This ensures that the same set of variables can be successfully replaced
in both the Makefile and Xcode generators. It also switches the default
templates to use the Xcode-style ${var} syntax instead of the @var@
syntax for better Info.plist compatibility across generators.

Change-Id: Iff330bafd152773aafac9143c4a34e34f92f0ce6
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
jakepetroules committed Jan 6, 2018
1 parent b739b3a commit 0749ba2
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 75 deletions.
23 changes: 23 additions & 0 deletions mkspecs/features/mac/default_post.prf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,29 @@ app_extension_api_only {
}

macx-xcode {
qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
!isEmpty(QMAKE_PKGINFO_TYPEINFO): \
qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
else: \
qmake_pkginfo_typeinfo.value = "????"
QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo

!isEmpty(VERSION) {
l = $$split(VERSION, '.') 0 0 # make sure there are at least three
VER_MAJ = $$member(l, 0, 0)
VER_MIN = $$member(l, 1, 1)
VER_PAT = $$member(l, 2, 2)
unset(l)

qmake_full_version.name = QMAKE_FULL_VERSION
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version

qmake_short_version.name = QMAKE_SHORT_VERSION
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
}

!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
debug_information_format.name = DEBUG_INFORMATION_FORMAT
debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
Expand Down
10 changes: 6 additions & 4 deletions mkspecs/macx-clang/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-clang/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
10 changes: 6 additions & 4 deletions mkspecs/macx-g++/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-g++/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
10 changes: 6 additions & 4 deletions mkspecs/macx-icc/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-icc/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
14 changes: 8 additions & 6 deletions mkspecs/macx-ios-clang/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>UILaunchStoryboardName</key>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-ios-clang/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
12 changes: 6 additions & 6 deletions mkspecs/macx-tvos-clang/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIcons</key>
Expand All @@ -16,25 +16,25 @@
<string>App Icon - Small</string>
</dict>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>AppleTVOS</string>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>9.1</string>
<string>${TVOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-tvos-clang/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
12 changes: 7 additions & 5 deletions mkspecs/macx-watchos-clang/Info.plist.app
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>MinimumOSVersion</key>
<string>${WATCHOS_DEPLOYMENT_TARGET}</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>UISupportedInterfaceOrientations</key>
Expand Down
10 changes: 5 additions & 5 deletions mkspecs/macx-watchos-clang/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>${QMAKE_SHORT_VERSION}</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>${QMAKE_FULL_VERSION}</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
Loading

0 comments on commit 0749ba2

Please sign in to comment.