Skip to content

Commit a50ce75

Browse files
Merge pull request #14 from SourcePointUSA/DIA-5402-update_RN_version
DIA-5402 update React Native version from 0.74.4 to 0.79.2
2 parents 04b04cd + 110cd65 commit a50ce75

File tree

90 files changed

+7149
-7756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+7149
-7756
lines changed

.detoxrc.js

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,90 @@
22
module.exports = {
33
testRunner: {
44
args: {
5-
'$0': 'jest',
6-
config: 'e2e/jest.config.js'
5+
$0: 'jest',
6+
config: 'e2e/jest.config.js',
77
},
88
jest: {
9-
setupTimeout: 120000
10-
}
9+
setupTimeout: 120000,
10+
},
1111
},
1212
apps: {
1313
'ios.debug': {
1414
start: 'yarn example start',
1515
type: 'ios.app',
16-
binaryPath: 'example/ios/build/Build/Products/Debug-iphonesimulator/SourcepointCmpExample.app',
17-
build: 'xcodebuild -workspace example/ios/SourcepointCmpExample.xcworkspace -scheme SourcepointCmpExample -configuration Debug -sdk iphonesimulator -derivedDataPath example/ios/build'
16+
binaryPath:
17+
'example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeCmpExample.app',
18+
build:
19+
'xcodebuild -workspace example/ios/ReactNativeCmpExample.xcworkspace -scheme ReactNativeCmpExample -configuration Debug -sdk iphonesimulator -derivedDataPath example/ios/build',
1820
},
1921
'android.debug': {
2022
start: 'yarn example start',
2123
type: 'android.apk',
2224
binaryPath: 'example/android/app/build/outputs/apk/debug/app-debug.apk',
23-
build: 'cd example/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
24-
reversePorts: [8081]
25+
build:
26+
'cd example/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
27+
reversePorts: [8081],
2528
},
2629
'ios.release': {
2730
type: 'ios.app',
28-
binaryPath: 'example/ios/build/Build/Products/Release-iphonesimulator/SourcepointCmpExample.app',
29-
build: 'xcodebuild -workspace example/ios/SourcepointCmpExample.xcworkspace -scheme SourcepointCmpExample -configuration Release -sdk iphonesimulator -derivedDataPath example/ios/build'
31+
binaryPath:
32+
'example/ios/build/Build/Products/Release-iphonesimulator/ReactNativeCmpExample.app',
33+
build:
34+
'xcodebuild -workspace example/ios/ReactNativeCmpExample.xcworkspace -scheme ReactNativeCmpExample -configuration Release -sdk iphonesimulator -derivedDataPath example/ios/build',
3035
},
3136
'android.release': {
3237
type: 'android.apk',
33-
binaryPath: 'example/android/app/build/outputs/apk/release/app-release.apk',
34-
build: 'cd example/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
35-
reversePorts: [8081]
36-
}
38+
binaryPath:
39+
'example/android/app/build/outputs/apk/release/app-release.apk',
40+
build:
41+
'cd example/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
42+
reversePorts: [8081],
43+
},
3744
},
3845
devices: {
3946
simulator: {
4047
type: 'ios.simulator',
4148
device: {
42-
type: 'iPhone 15'
43-
}
49+
type: 'iPhone 16',
50+
},
4451
},
4552
emulator: {
4653
type: 'android.emulator',
4754
device: {
48-
avdName: 'Pixel_9_API_34'
49-
}
55+
avdName: 'Pixel_9_API_34',
56+
},
5057
},
5158
// attached: {
5259
// type: 'android.attached',
5360
// device: {
54-
// adbName: '.*'
55-
// }
61+
// adbName: '.*',
62+
// },
5663
// },
5764
},
5865
configurations: {
5966
'ios.sim.debug': {
6067
device: 'simulator',
61-
app: 'ios.debug'
68+
app: 'ios.debug',
6269
},
6370
'android.emu.debug': {
6471
device: 'emulator',
65-
app: 'android.debug'
72+
app: 'android.debug',
6673
},
6774
'ios.sim.release': {
6875
device: 'simulator',
69-
app: 'ios.release'
76+
app: 'ios.release',
7077
},
7178
'android.emu.release': {
7279
device: 'emulator',
73-
app: 'android.release'
74-
}
80+
app: 'android.release',
81+
},
7582
// 'android.att.debug': {
7683
// device: 'attached',
77-
// app: 'android.debug'
84+
// app: 'android.debug',
7885
// },
7986
// 'android.att.release': {
8087
// device: 'attached',
81-
// app: 'android.release'
88+
// app: 'android.release',
8289
// },
83-
}
90+
},
8491
};

CONTRIBUTING.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The [example app](/example/) demonstrates usage of the library. You need to run
2323

2424
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
2525

26-
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/SourcepointCmpExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > @sourcepoint/react-native-cmp`.
26+
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ReactNativeCmpExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > @sourcepoint/react-native-cmp`.
2727

2828
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `sourcepoint-react-native-cmp` under `Android`.
2929

@@ -47,33 +47,10 @@ To run the example app on iOS:
4747
yarn example ios
4848
```
4949

50-
By default, the example is configured to build with the old architecture. To run the example with the new architecture, you can do the following:
51-
52-
1. For Android, run:
53-
54-
```sh
55-
ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android
56-
```
57-
58-
2. For iOS, run:
59-
60-
```sh
61-
cd example/ios
62-
RCT_NEW_ARCH_ENABLED=1 pod install
63-
cd -
64-
yarn example ios
65-
```
66-
67-
If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders:
68-
69-
```sh
70-
yarn clean
71-
```
72-
7350
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
7451

7552
```sh
76-
Running "SourcepointCmpExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
53+
Running "ReactNativeCmpExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
7754
```
7855

7956
Note the `"fabric":true` and `"concurrentRoot":true` properties.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 André Herculano
3+
Copyright (c) 2025 André Herculano
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
66
in the Software without restriction, including without limitation the rights

ReactNativeCmp.podspec

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
puts "Min iOS version: #{min_ios_version_supported} (from .podspec)"
6+
7+
Pod::Spec.new do |s|
8+
s.name = "ReactNativeCmp"
9+
s.version = package["version"]
10+
s.summary = package["description"]
11+
s.homepage = package["homepage"]
12+
s.license = package["license"]
13+
s.authors = package["author"]
14+
15+
s.platforms = { :ios => min_ios_version_supported }
16+
s.source = { :git => "https://github.com/SourcePointUSA/react-native-sourcepoint-cmp.git", :tag => "#{s.version}" }
17+
18+
s.dependency "ConsentViewController", "7.9.0"
19+
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
20+
s.private_header_files = "ios/**/*.h"
21+
22+
install_modules_dependencies(s)
23+
end

android/build.gradle

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,38 @@
11
buildscript {
2-
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
3-
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SourcepointCmp_kotlinVersion"]
2+
ext.getExtOrDefault = {name ->
3+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeCmp_' + name]
4+
}
45

56
repositories {
67
google()
78
mavenCentral()
89
}
910

1011
dependencies {
11-
classpath "com.android.tools.build:gradle:7.2.2"
12+
classpath "com.android.tools.build:gradle:8.7.2"
1213
// noinspection DifferentKotlinGradleVersion
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
1415
}
1516
}
1617

17-
def isNewArchitectureEnabled() {
18-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19-
}
2018

2119
apply plugin: "com.android.library"
2220
apply plugin: "kotlin-android"
2321

24-
if (isNewArchitectureEnabled()) {
25-
apply plugin: "com.facebook.react"
26-
}
27-
28-
def getExtOrDefault(name) {
29-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["SourcepointCmp_" + name]
30-
}
22+
apply plugin: "com.facebook.react"
3123

3224
def getExtOrIntegerDefault(name) {
33-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["SourcepointCmp_" + name]).toInteger()
34-
}
35-
36-
def supportsNamespace() {
37-
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38-
def major = parsed[0].toInteger()
39-
def minor = parsed[1].toInteger()
40-
41-
// Namespace support was added in 7.3.0
42-
return (major == 7 && minor >= 3) || major >= 8
25+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeCmp_" + name]).toInteger()
4326
}
4427

4528
android {
46-
if (supportsNamespace()) {
47-
namespace "com.sourcepoint.reactnativecmp"
48-
49-
sourceSets {
50-
main {
51-
manifest.srcFile "src/main/AndroidManifestNew.xml"
52-
}
53-
}
54-
}
29+
namespace "com.sourcepoint.reactnativecmp"
5530

5631
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
5732

5833
defaultConfig {
5934
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
6035
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
6236
}
6337

6438
buildFeatures {
@@ -82,15 +56,10 @@ android {
8256

8357
sourceSets {
8458
main {
85-
if (isNewArchitectureEnabled()) {
86-
java.srcDirs += [
87-
"src/newarch",
88-
// This is needed to build Kotlin project with NewArch enabled
89-
"${project.buildDir}/generated/source/codegen/java"
90-
]
91-
} else {
92-
java.srcDirs += ["src/oldarch"]
93-
}
59+
java.srcDirs += [
60+
"generated/java",
61+
"generated/jni"
62+
]
9463
}
9564
}
9665
}
@@ -103,19 +72,14 @@ repositories {
10372
def kotlin_version = getExtOrDefault("kotlinVersion")
10473

10574
dependencies {
106-
// For < 0.71, this will be from the local maven repo
107-
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
108-
//noinspection GradleDynamicVersion
109-
implementation "com.facebook.react:react-native:+"
75+
implementation "com.facebook.react:react-android"
11076
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
11177

112-
implementation "com.sourcepoint.cmplibrary:cmplibrary:7.8.1"
78+
implementation "com.sourcepoint.cmplibrary:cmplibrary:7.13.0"
11379
}
11480

115-
if (isNewArchitectureEnabled()) {
116-
react {
117-
jsRootDir = file("../src/")
118-
libraryName = "RNSourcepointCmp"
119-
codegenJavaPackageName = "com.sourcepoint.reactnativecmp"
120-
}
81+
react {
82+
jsRootDir = file("../src/")
83+
libraryName = "ReactNativeCmp"
84+
codegenJavaPackageName = "com.sourcepoint.reactnativecmp"
12185
}

android/gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SourcepointCmp_kotlinVersion=1.9.22
2-
SourcepointCmp_minSdkVersion=23
3-
SourcepointCmp_targetSdkVersion=34
4-
SourcepointCmp_compileSdkVersion=34
5-
SourcepointCmp_ndkversion=26.1.10909125
1+
ReactNativeCmp_kotlinVersion=2.0.21
2+
ReactNativeCmp_minSdkVersion=24
3+
ReactNativeCmp_targetSdkVersion=34
4+
ReactNativeCmp_compileSdkVersion=35
5+
ReactNativeCmp_ndkVersion=27.1.12297006
-61.9 KB
Binary file not shown.

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)