Skip to content

Commit db09131

Browse files
committed
Pod & Xcode stuff
1 parent 6a848f8 commit db09131

40 files changed

+1838
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<resources>
2-
<string name="app_name">img-gen-rn</string>
2+
<string name="app_name">AI Image Gen</string>
33
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
44
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
55
</resources>

app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"**/*"
1616
],
1717
"ios": {
18-
"supportsTablet": true
18+
"supportsTablet": true,
19+
"bundleIdentifier": "com.hhtam.imggenrn"
1920
},
2021
"android": {
2122
"adaptiveIcon": {

ios/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
.xcode.env.local
25+
26+
# Bundle artifacts
27+
*.jsbundle
28+
29+
# CocoaPods
30+
/Pods/

ios/.xcode.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This `.xcode.env` file is versioned and is used to source the environment
2+
# used when running script phases inside Xcode.
3+
# To customize your local environment, you can create an `.xcode.env.local`
4+
# file that is not versioned.
5+
6+
# NODE_BINARY variable contains the PATH to the node executable.
7+
#
8+
# Customize the NODE_BINARY variable here.
9+
# For example, to use nvm with brew, add the following line
10+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
11+
export NODE_BINARY=$(command -v node)

ios/Podfile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
2+
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
3+
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
4+
5+
require 'json'
6+
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
7+
8+
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
9+
10+
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
11+
install! 'cocoapods',
12+
:deterministic_uuids => false
13+
14+
prepare_react_native_project!
15+
16+
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
17+
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
18+
# you can also exclude `react-native-flipper` in `react-native.config.js`
19+
#
20+
# ```js
21+
# module.exports = {
22+
# dependencies: {
23+
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
24+
# }
25+
# }
26+
# ```
27+
flipper_config = FlipperConfiguration.disabled
28+
if ENV['NO_FLIPPER'] == '1' then
29+
# Explicitly disabled through environment variables
30+
flipper_config = FlipperConfiguration.disabled
31+
elsif podfile_properties.key?('ios.flipper') then
32+
# Configure Flipper in Podfile.properties.json
33+
if podfile_properties['ios.flipper'] == 'true' then
34+
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
35+
elsif podfile_properties['ios.flipper'] != 'false' then
36+
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
37+
end
38+
end
39+
40+
target 'imggenrn' do
41+
use_expo_modules!
42+
config = use_native_modules!
43+
44+
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
45+
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
46+
47+
# Flags change depending on the env values.
48+
flags = get_default_flags()
49+
50+
use_react_native!(
51+
:path => config[:reactNativePath],
52+
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
53+
:fabric_enabled => flags[:fabric_enabled],
54+
# An absolute path to your application root.
55+
:app_path => "#{Pod::Config.instance.installation_root}/..",
56+
# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
57+
:flipper_configuration => flipper_config
58+
)
59+
60+
post_install do |installer|
61+
react_native_post_install(
62+
installer,
63+
config[:reactNativePath],
64+
# Set `mac_catalyst_enabled` to `true` in order to apply patches
65+
# necessary for Mac Catalyst builds
66+
:mac_catalyst_enabled => false
67+
)
68+
__apply_Xcode_12_5_M1_post_install_workaround(installer)
69+
70+
# This is necessary for Xcode 14, because it signs resource bundles by default
71+
# when building for devices.
72+
installer.target_installation_results.pod_target_installation_results
73+
.each do |pod_name, target_installation_result|
74+
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
75+
resource_bundle_target.build_configurations.each do |config|
76+
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
77+
end
78+
end
79+
end
80+
end
81+
82+
post_integrate do |installer|
83+
begin
84+
expo_patch_react_imports!(installer)
85+
rescue => e
86+
Pod::UI.warn e
87+
end
88+
end
89+
end

0 commit comments

Comments
 (0)