Skip to content

Commit a188245

Browse files
committed
Add React Native during android module development
1 parent cd689e8 commit a188245

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

android/app/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,16 @@ repositories {
6262
google()
6363
}
6464

65+
def isInDevelopment = project.hasProperty('CodePush_development') && project.property('CodePush_development') == "true"
66+
6567
dependencies {
66-
// For < 0.71, this will be from the local maven repo
67-
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
68-
//noinspection GradleDynamicVersion
69-
implementation "com.facebook.react:react-native:+"
68+
if (isInDevelopment) {
69+
implementation("com.facebook.react:react-android:0.71.+")
70+
} else {
71+
// For < 0.71, this will be from the local maven repo
72+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
73+
//noinspection GradleDynamicVersion
74+
implementation "com.facebook.react:react-native:+"
75+
}
7076
implementation "com.nimbusds:nimbus-jose-jwt:9.37.3"
7177
}

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
CodePush_minSdkVersion=16
22
CodePush_targetSdkVersion=31
33
CodePush_compileSdkVersion=31
4+
# CodePush_development=true # enable this when developing on the module outside a React Native app

0 commit comments

Comments
 (0)