Skip to content

Commit

Permalink
Added react-native-config android setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Jan 18, 2024
1 parent 1431ac7 commit 5abd653
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/EXAMPLE.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
THIRD_WEB_CLIENT_ID="INSERT_CLIENT_ID_HERE"
THIRD_WEB_CLIENT_ID=INSERT_CLIENT_ID_HERE
6 changes: 6 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'kotlin-android'

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"


import com.android.build.OutputFile

def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
Expand Down Expand Up @@ -268,6 +271,9 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.5"
androidTestUtil "androidx.test.services:test-services:1.4.2"
androidTestUtil 'androidx.test:orchestrator:1.4.2'

// For loading .env
implementation project(':react-native-config')
}

apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
Expand Down
3 changes: 3 additions & 0 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ applyNativeModulesSettingsGradle(settings)

include ':app'
includeBuild(new File(["node", "--print", "require.resolve('react-native-gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile())

include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')

0 comments on commit 5abd653

Please sign in to comment.