Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mobile-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pod-install:
codegen:
@echo "Generating React Native codegen artifacts..."
@RCT_NEW_ARCH_ENABLED=1 node node_modules/react-native/scripts/generate-codegen-artifacts.js \
--path . --targetPlatform ios --outputPath ios/build/generated/ios
--path . --targetPlatform ios --outputPath ios
@echo "✓ Codegen complete"

# --- Nim build pipeline ---
Expand Down
4 changes: 3 additions & 1 deletion mobile-app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
react {
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
hermesCommand = new File(["node", "--print", "require.resolve('hermes-compiler/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/hermesc/%OS-BIN%/hermesc"
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()

enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean()
Expand Down Expand Up @@ -93,6 +93,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"

buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
signingConfigs {
debug {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,35 @@ import android.content.res.Configuration
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.ReactHost
import com.facebook.react.common.ReleaseLevel
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint
import com.facebook.react.defaults.DefaultReactNativeHost

import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper
import expo.modules.ExpoReactHostFactory

import com.nimbridge.NimBridgePackage

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
this,
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
add(NimBridgePackage())
}

override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
}
)

override val reactHost: ReactHost
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
override val reactHost: ReactHost by lazy {
ExpoReactHostFactory.getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
add(NimBridgePackage())
}
)
}

override fun onCreate() {
super.onCreate()
DefaultNewArchitectureEntryPoint.releaseLevel = ReleaseLevel.STABLE
DefaultNewArchitectureEntryPoint.releaseLevel = try {
ReleaseLevel.valueOf(BuildConfig.REACT_NATIVE_RELEASE_LEVEL.uppercase())
} catch (e: IllegalArgumentException) {
ReleaseLevel.STABLE
}
loadReactNative(this)
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
23 changes: 21 additions & 2 deletions mobile-app/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties
ENV['RCT_NEW_ARCH_ENABLED'] = '0' if podfile_properties['newArchEnabled'] == 'false'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']

platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
platform :ios, podfile_properties['ios.deploymentTarget'] || '16.4'
install! 'cocoapods',
:deterministic_uuids => false

Expand Down Expand Up @@ -72,7 +72,7 @@ target 'nimrnmobileapp' do
target.build_configurations.each do |config|
config.build_settings['COMPILER_INDEX_STORE_ENABLE'] = 'NO'
config.build_settings.delete('MACOSX_DEPLOYMENT_TARGET')
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.4'
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
config.build_settings['ENABLE_PREVIEWS'] = 'NO'
Expand All @@ -83,6 +83,25 @@ target 'nimrnmobileapp' do
end
end

# fmt 11.0.2's consteval path fails to compile under Xcode 26's clang;
# patch base.h so FMT_USE_CONSTEVAL stays at 0 regardless of detection.
fmt_base_h = File.join(installer.sandbox.root, 'fmt/include/fmt/base.h')
if File.exist?(fmt_base_h)
File.chmod(0644, fmt_base_h)
contents = File.read(fmt_base_h)
unless contents.include?('// react-native-nim: force FMT_USE_CONSTEVAL=0')
patched = contents.sub(
'// Detect consteval, C++20 constexpr extensions and std::is_constant_evaluated.',
"// react-native-nim: force FMT_USE_CONSTEVAL=0 to avoid Xcode 26 consteval evaluation bugs\n#define FMT_USE_CONSTEVAL 0\n#if 0\n// Detect consteval, C++20 constexpr extensions and std::is_constant_evaluated."
)
patched = patched.sub(
/\#if FMT_USE_CONSTEVAL\n\# define FMT_CONSTEVAL consteval/,
"#endif\n#if FMT_USE_CONSTEVAL\n# define FMT_CONSTEVAL consteval"
)
File.write(fmt_base_h, patched)
end
end


# when building for devices.
installer.target_installation_results.pod_target_installation_results
Expand Down
Loading
Loading