Skip to content

Commit

Permalink
Update iOS templates to support 0.72
Browse files Browse the repository at this point in the history
  • Loading branch information
rthic23 committed Jul 17, 2024
1 parent dbe4ae5 commit 23c58a2
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 6 deletions.
4 changes: 3 additions & 1 deletion ern-core/src/iosUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ function switchToOldDirectoryStructure(
}

export const getDefaultIosDeploymentTarget = (rnVersion: string): string => {
if (semver.gte(rnVersion, '0.64.0')) {
if (semver.gte(rnVersion, '0.72.0')) {
return '12.4';
} else if (semver.gte(rnVersion, '0.64.0')) {
return '11.0';
} else if (semver.gte(rnVersion, '0.63.0')) {
return '10.0';
Expand Down
6 changes: 3 additions & 3 deletions ern-runner-gen-ios/src/IosRunnerGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export default class IosRunerGenerator implements RunnerGenerator {
path.join(config.extra.containerGenWorkingDir, 'out/ios'),
);
const mustacheView = {
deploymentTarget: semver.gte(config.reactNativeVersion, '0.64.0')
? '11.0'
: '10.3',
deploymentTarget: semver.gte(config.reactNativeVersion, '0.72.0')
? '12.4'
: '11.0',
isReactNativeDevSupportEnabled:
config.reactNativeDevSupportEnabled === true ? 'true' : 'false',
miniAppName: config.mainMiniAppName,
Expand Down
38 changes: 36 additions & 2 deletions ern-runner-gen-ios/src/hull/ErnRunner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
6E6BEDD6262F9F10003F9D7B /* MainNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6BEDD3262F9F10003F9D7B /* MainNavigationController.swift */; };
6E6BEDD7262F9F10003F9D7B /* RunnerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6BEDD4262F9F10003F9D7B /* RunnerConfig.swift */; };
6E6BEDD8262F9F10003F9D7B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6BEDD5262F9F10003F9D7B /* AppDelegate.swift */; };
7EEF60E22C1977D3008291B7 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 7EEF60E02C1977D3008291B7 /* PrivacyInfo.xcprivacy */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -63,6 +64,7 @@
6E6BEDD3262F9F10003F9D7B /* MainNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainNavigationController.swift; sourceTree = "<group>"; };
6E6BEDD4262F9F10003F9D7B /* RunnerConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RunnerConfig.swift; sourceTree = "<group>"; };
6E6BEDD5262F9F10003F9D7B /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7EEF60E02C1977D3008291B7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -106,6 +108,7 @@
304F3E971EEF455C00F1E36B /* ErnRunner */ = {
isa = PBXGroup;
children = (
7EEF60E02C1977D3008291B7 /* PrivacyInfo.xcprivacy */,
6E6BEDD5262F9F10003F9D7B /* AppDelegate.swift */,
6E6BEDD3262F9F10003F9D7B /* MainNavigationController.swift */,
6E6BEDD4262F9F10003F9D7B /* RunnerConfig.swift */,
Expand Down Expand Up @@ -134,6 +137,7 @@
304F3E911EEF455C00F1E36B /* Sources */,
304F3E921EEF455C00F1E36B /* Frameworks */,
304F3E931EEF455C00F1E36B /* Resources */,
7EEF60E72C1979DC008291B7 /* Bundle React Native code and images */,
304F3ECB1EEF597600F1E36B /* Embed Frameworks */,
);
buildRules = (
Expand Down Expand Up @@ -208,13 +212,37 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7EEF60E22C1977D3008291B7 /* PrivacyInfo.xcprivacy in Resources */,
304F3EA81EEF455C00F1E36B /* LaunchScreen.storyboard in Resources */,
304F3EA51EEF455C00F1E36B /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
7EEF60E72C1979DC008291B7 /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
304F3E911EEF455C00F1E36B /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -346,7 +374,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ErnRunner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.ernrunner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -359,7 +390,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ErnRunner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.ernrunner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
38 changes: 38 additions & 0 deletions ern-runner-gen-ios/src/hull/ErnRunner/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

0 comments on commit 23c58a2

Please sign in to comment.