iOS Export: Updated Info.plist. Framework embedding. Fixes for search paths

This commit is contained in:
Sergey Minakov 2020-07-02 12:46:57 +03:00
parent 519024829a
commit e2a45fe840
3 changed files with 52 additions and 4 deletions

View file

@ -16,6 +16,20 @@
D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; }; D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
90A13CD024AA68E500E8464F /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
$pbx_embeded_frameworks
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1F1575711F582BE20003B888 /* dylibs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dylibs; path = "$binary/dylibs"; sourceTree = "<group>"; }; 1F1575711F582BE20003B888 /* dylibs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dylibs; path = "$binary/dylibs"; sourceTree = "<group>"; };
DEADBEEF1F582BE20003B888 /* $binary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot; path = "$binary.a"; sourceTree = "<group>"; }; DEADBEEF1F582BE20003B888 /* $binary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot; path = "$binary.a"; sourceTree = "<group>"; };
@ -105,6 +119,7 @@
D0BCFE3018AEBDA2004A7AAE /* Sources */, D0BCFE3018AEBDA2004A7AAE /* Sources */,
D0BCFE3118AEBDA2004A7AAE /* Frameworks */, D0BCFE3118AEBDA2004A7AAE /* Frameworks */,
D0BCFE3218AEBDA2004A7AAE /* Resources */, D0BCFE3218AEBDA2004A7AAE /* Resources */,
90A13CD024AA68E500E8464F /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -230,7 +245,6 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
1F1575721F582BE20003B888 /* dylibs in Resources */,
D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */, D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */,
D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */, D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */,
D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */, D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */,
@ -284,7 +298,9 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"FRAMEWORK_SEARCH_PATHS[arch=*]" = "$binary/**"; "FRAMEWORK_SEARCH_PATHS[arch=*]" = (
"$(PROJECT_DIR)/**",
);
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
@ -327,7 +343,9 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"FRAMEWORK_SEARCH_PATHS[arch=*]" = "$binary/**"; "FRAMEWORK_SEARCH_PATHS[arch=*]" = (
"$(PROJECT_DIR)/**",
);
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@ -357,6 +375,10 @@
DEVELOPMENT_TEAM = $team_id; DEVELOPMENT_TEAM = $team_id;
INFOPLIST_FILE = "$binary/$binary-Info.plist"; INFOPLIST_FILE = "$binary/$binary-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)", "$(PROJECT_DIR)",
@ -383,6 +405,10 @@
DEVELOPMENT_TEAM = $team_id; DEVELOPMENT_TEAM = $team_id;
INFOPLIST_FILE = "$binary/$binary-Info.plist"; INFOPLIST_FILE = "$binary/$binary-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)", "$(PROJECT_DIR)",

View file

@ -26,6 +26,8 @@
<string>$signature</string> <string>$signature</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$version</string> <string>$version</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false />
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>LSSupportsOpeningDocumentsInPlace</key> <key>LSSupportsOpeningDocumentsInPlace</key>

View file

@ -663,17 +663,33 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese
String pbx_frameworks_refs; String pbx_frameworks_refs;
String pbx_resources_build; String pbx_resources_build;
String pbx_resources_refs; String pbx_resources_refs;
String pbx_embeded_frameworks;
const String file_info_format = String("$build_id = {isa = PBXBuildFile; fileRef = $ref_id; };\n") + const String file_info_format = String("$build_id = {isa = PBXBuildFile; fileRef = $ref_id; };\n") +
"$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n"; "$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n";
for (int i = 0; i < p_additional_assets.size(); ++i) { for (int i = 0; i < p_additional_assets.size(); ++i) {
String additional_asset_info_format = file_info_format;
String build_id = (++current_id).str(); String build_id = (++current_id).str();
String ref_id = (++current_id).str(); String ref_id = (++current_id).str();
String framework_id = "";
const IOSExportAsset &asset = p_additional_assets[i]; const IOSExportAsset &asset = p_additional_assets[i];
String type; String type;
if (asset.exported_path.ends_with(".framework")) { if (asset.exported_path.ends_with(".framework")) {
additional_asset_info_format += "$framework_id = {isa = PBXBuildFile; fileRef = $ref_id; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };\n";
framework_id = (++current_id).str();
pbx_embeded_frameworks += framework_id + ",\n";
type = "wrapper.framework"; type = "wrapper.framework";
} else if (asset.exported_path.ends_with(".xcframework")) {
additional_asset_info_format += "$framework_id = {isa = PBXBuildFile; fileRef = $ref_id; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };\n";
framework_id = (++current_id).str();
pbx_embeded_frameworks += framework_id + ",\n";
type = "wrapper.xcframework";
} else if (asset.exported_path.ends_with(".dylib")) { } else if (asset.exported_path.ends_with(".dylib")) {
type = "compiled.mach-o.dylib"; type = "compiled.mach-o.dylib";
} else if (asset.exported_path.ends_with(".a")) { } else if (asset.exported_path.ends_with(".a")) {
@ -698,7 +714,10 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese
format_dict["name"] = asset.exported_path.get_file(); format_dict["name"] = asset.exported_path.get_file();
format_dict["file_path"] = asset.exported_path; format_dict["file_path"] = asset.exported_path;
format_dict["file_type"] = type; format_dict["file_type"] = type;
pbx_files += file_info_format.format(format_dict, "$_"); if (framework_id.length() > 0) {
format_dict["framework_id"] = framework_id;
}
pbx_files += additional_asset_info_format.format(format_dict, "$_");
} }
// Note, frameworks like gamekit are always included in our project.pbxprof file // Note, frameworks like gamekit are always included in our project.pbxprof file
@ -732,6 +751,7 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese
str = str.replace("$additional_pbx_frameworks_refs", pbx_frameworks_refs); str = str.replace("$additional_pbx_frameworks_refs", pbx_frameworks_refs);
str = str.replace("$additional_pbx_resources_build", pbx_resources_build); str = str.replace("$additional_pbx_resources_build", pbx_resources_build);
str = str.replace("$additional_pbx_resources_refs", pbx_resources_refs); str = str.replace("$additional_pbx_resources_refs", pbx_resources_refs);
str = str.replace("$pbx_embeded_frameworks", pbx_embeded_frameworks);
CharString cs = str.utf8(); CharString cs = str.utf8();
p_project_data.resize(cs.size() - 1); p_project_data.resize(cs.size() - 1);