Skip to content

Commit 0ecd509

Browse files
committed
feat: add new architecture support in Android
- Refactored MParticleModule and MPRoktModule to extend from new base classes for TurboModules. - Updated build.gradle to enable new architecture and adjust build features. - Introduced new Kotlin files for Rokt module implementation in the new architecture.
1 parent 933e55c commit 0ecd509

File tree

15 files changed

+662
-361
lines changed

15 files changed

+662
-361
lines changed

android/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ def supportsNamespace() {
4444
apply plugin: 'org.jlleitschuh.gradle.ktlint'
4545
apply plugin: 'com.android.library'
4646
apply plugin: 'kotlin-android'
47-
//if (isNewArchitectureEnabled()) {
48-
// apply plugin: 'com.facebook.react'
49-
//}
47+
if (isNewArchitectureEnabled()) {
48+
apply plugin: 'com.facebook.react'
49+
}
5050

5151
android {
5252
if (supportsNamespace()) {
5353
namespace 'com.mparticle.react'
54-
buildFeatures.buildConfig = true
54+
buildFeatures {
55+
buildConfig = true
56+
}
5557
sourceSets {
5658
main {
5759
manifest.srcFile "src/main/AndroidManifestNew.xml"
@@ -65,15 +67,15 @@ android {
6567
targetSdkVersion 33
6668
versionCode 2
6769
versionName "2.0.0"
68-
//buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
70+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
6971
}
7072
sourceSets {
7173
main {
72-
//if (isNewArchitectureEnabled()) {
73-
// java.srcDirs += ['src/newarch/java']
74-
//} else {
74+
if (isNewArchitectureEnabled()) {
75+
java.srcDirs += ['src/newarch/java']
76+
} else {
7577
java.srcDirs += ['src/oldarch/java']
76-
//}
78+
}
7779
}
7880
}
7981

android/gradle.properties

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,3 @@ android.useAndroidX=true
2424

2525
# Automatically convert third-party libraries to use AndroidX
2626
android.enableJetifier=true
27-
28-
# Version of flipper SDK to use with React Native
29-
FLIPPER_VERSION=0.125.0
30-
31-
# Use this property to specify which architecture you want to build.
32-
# You can also override it from the CLI using
33-
# ./gradlew <task> -PreactNativeArchitectures=x86_64
34-
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
35-
36-
# Use this property to enable support to the new architecture.
37-
# This will allow you to use TurboModules and the Fabric render in
38-
# your application. You should enable this flag either if you want
39-
# to write custom TurboModules/Fabric components OR use libraries that
40-
# are providing them.
41-
newArchEnabled=false
42-
43-
# The hosted JavaScript engine
44-
# Supported values: expo.jsEngine = "hermes" | "jsc"
45-
expo.jsEngine=jsc
46-
47-
# Enable GIF support in React Native images (~200 B increase)
48-
expo.gif.enabled=true
49-
# Enable webp support in React Native images (~85 KB increase)
50-
expo.webp.enabled=true
51-
# Enable animated webp support (~3.4 MB increase)
52-
# Disabled by default because iOS doesn't support animated webp
53-
expo.webp.animated=false
54-
55-
sonar.gradle.skipCompile=true

0 commit comments

Comments
 (0)