Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6279 from livecodepanos/bugfix-20852
Browse files Browse the repository at this point in the history
[Bug 20852] Ensure the device plist contains correct values for Xcode/SDK versions
  • Loading branch information
livecodepanos committed Jan 18, 2018
2 parents 29865b7 + d4885fb commit 98d69ef
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/notes/bugfix-20582.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ensure the iOS device plist has correct values for the version of Xcode and SDKs used to build the standalone
14 changes: 8 additions & 6 deletions engine/rsrc/mobile-device-template.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,23 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12B411</string>
${DT_PLATFORM_BUILD}
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>8.1</string>
${DT_PLATFORM_VERSION}
<key>DTSDKBuild</key>
<string>12B411</string>
${DT_SDK_BUILD}
<key>DTSDKName</key>
<string>iphoneos8.1</string>
${DT_SDK_NAME}
<key>DTXcode</key>
<string>0610</string>
${DT_XCODE}
<key>DTXcodeBuild</key>
<string>6A1052c</string>
${DT_XCODE_BUILD}
<key>CFBundleDisplayName</key>
${BUNDLE_DISPLAY_NAME_SUPPORT}
<key>UIRequiresFullScreen</key>
<true/>
<key>MinimumOSVersion</key>
${MINIMUM_OS_SUPPORT}
<key>UIDeviceFamily</key>
Expand Down
41 changes: 41 additions & 0 deletions ide-support/revsaveasiosstandalone.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,17 @@ private command revCopyMobileDrivers pDrivers, pAppBundle, pTarget, pSDKs, @rExt
end repeat
end revCopyMobileDrivers

-- Helper function to convert the Xcode version to the format the plist expects. Examples:
-- 7.2 --> 0720
-- 8.3.3 --> 0833
-- 10.2 --> 1020
-- 10.2.1 --> 1021
-- relies on the fact that + 0 to empty gives 0
private function convertXcodeVersion pInput
set the itemdel to "."
return format("%02d%d%d", item 1 of pInput + 0, item 2 of pInput + 0, item 3 of pInput + 0)
end convertXcodeVersion

################################################################################

private command revCopyMobileStackFiles pStackFiles, pBaseFolder, pAppBundle
Expand Down Expand Up @@ -1352,6 +1363,36 @@ private command revCreateMobilePlist pSettings, pAppBundle, pTarget, pFonts, pPl
replace "${CUSTOM_FONTS}" with tCustomFonts in pPlist
replace "${DISABLE_ATS}" with tDisableATS in pPlist

-- PM-2018-01-15: [[Bug 20852]] Get info about Xcode/SDK versions
if pTarget is "Device" then
local tDtPlatformBuild, tDtPlatformVersion, tDtSdkBuild, tDtSdkName, tDtXcode, tDtXcodeBuild

get shell("xcodebuild -version -sdk iphoneos ProductBuildVersion")
-- Those 2 values are the same, e.g. "15C107"
put it into tDtPlatformBuild
put it into tDtSdkBuild

get shell("xcodebuild -version -sdk iphoneos PlatformVersion") -- e.g. "11.2"
put it into tDtPlatformVersion

put "iphoneos" & tDtPlatformVersion into tDtSdkName

get shell("xcodebuild -version | awk '/Xcode/ {print $NF}' ") -- e.g. "9.2"
put it into tDtXcode
put convertXcodeVersion(tDtXcode) into tDtXcode

get shell("xcodebuild -version | awk 'END {print $NF}' ") -- e.g. "9C40b"
put it into tDtXcodeBuild

replace "${DT_PLATFORM_BUILD}" with tDtPlatformBuild in pPlist
replace "${DT_PLATFORM_VERSION}" with tDtPlatformVersion in pPlist
replace "${DT_SDK_BUILD}" with tDtSdkBuild in pPlist
replace "${DT_SDK_NAME}" with tDtSdkName in pPlist
replace "${DT_XCODE}" with tDtXcode in pPlist
replace "${DT_XCODE_BUILD}" with tDtXcodeBuild in pPlist

end if

get empty
repeat for each item tItem in tDeviceFamily
put "<integer>" & tItem & "</integer>" after it
Expand Down

0 comments on commit 98d69ef

Please sign in to comment.