Skip to content

Commit

Permalink
fix androidX legacy dependencies...
Browse files Browse the repository at this point in the history
this is a hacky way to detect when to use the legacy dependecies
from androidX.
  • Loading branch information
diego committed Jul 18, 2019
1 parent 85a7858 commit 9682253
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,19 @@ dependencies {

compileOnly "com.facebook.react:react-native:+"
implementation "com.google.android.libraries.places:places:1.1.0"
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:support-v4:${supportLibVersion}"
implementation "com.google.code.findbugs:jsr305:3.0.2"

Properties prop = new Properties();
InputStream input = null;

input = new FileInputStream("gradle.properties");
prop.load(input);

if (prop.getProperty("android.useAndroidX")) {
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
} else {
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:support-v4:${supportLibVersion}"
}
}

0 comments on commit 9682253

Please sign in to comment.