-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Project-Wide Gradle Config and bump version to 2.5.0
- Loading branch information
Showing
3 changed files
with
79 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ iOS/Android Google Places Widgets (Autocomplete, Place Picker) and API Services | |
<img width=200 title="Place Picker Open - iOS" src="./shots/picker-ios.png"> | ||
|
||
## Versioning: | ||
- for RN >= 0.40.0, use v2+ (e.g. react-native-google-places@2.4.0) | ||
- for RN (0.33.0 - 0.39.0), use v1+ or 0.8.8 (e.g. [email protected]) | ||
- for RN >= 0.40.0, use v2+ (e.g. react-native-google-places@2.5.0) | ||
- for RN (0.33.0 - 0.39.0), use v1+ or 0.8.8 (e.g. [email protected]) **No longer updated** | ||
|
||
## Sample App | ||
- A new [sample app](https://github.com/tolu360/TestRNGP) is available to help with sample usage and debugging issues. | ||
|
@@ -106,6 +106,46 @@ dependencies { | |
compile project(':react-native-google-places') | ||
} | ||
``` | ||
- Option 1: Use Project-Wide Gradle Config: | ||
|
||
You can define *[project-wide properties](https://developer.android.com/studio/build/gradle-tips.html)* (**recommended**) in your root `/android/build.gradle`, and let the library auto-detect the presence of the following properties: | ||
|
||
```groovy | ||
buildscript {...} | ||
allprojects {...} | ||
/** | ||
+ Project-wide Gradle configuration properties (replace versions as appropriate) | ||
*/ | ||
ext { | ||
compileSdkVersion = 25 | ||
targetSdkVersion = 25 | ||
buildToolsVersion = "25.0.2" | ||
supportLibVersion = "25.0.2" | ||
googlePlayServicesVersion = "11.6.2" | ||
androidMapsUtilsVersion = "0.5+" | ||
} | ||
``` | ||
|
||
- Option 2: Use Specific Gradle Config: | ||
|
||
If you do **not** have *project-wide properties* defined or want to use a different Google Play-Services version than the one included in this library (shown above), use the following instead (switch 11.6.2 for the desired version): | ||
|
||
```groovy | ||
... | ||
dependencies { | ||
... | ||
compile(project(':react-native-google-places')){ | ||
exclude group: 'com.google.android.gms', module: 'play-services-base' | ||
exclude group: 'com.google.android.gms', module: 'play-services-places' | ||
exclude group: 'com.google.android.gms', module: 'play-services-location' | ||
} | ||
compile 'com.google.android.gms:play-services-base:11.6.2' | ||
compile 'com.google.android.gms:play-services-places:11.6.2' | ||
compile 'com.google.android.gms:play-services-location:11.6.2' | ||
} | ||
``` | ||
|
||
- Add the following in your `...MainApplication.java` file: | ||
|
||
```java | ||
|
@@ -425,9 +465,9 @@ You have to link dependencies and re-run the build: | |
exclude group: 'com.google.android.gms', module: 'play-services-places' | ||
exclude group: 'com.google.android.gms', module: 'play-services-location' | ||
} | ||
compile 'com.google.android.gms:play-services-base:10.2.0' | ||
compile 'com.google.android.gms:play-services-places:10.2.0' | ||
compile 'com.google.android.gms:play-services-location:10.2.0' | ||
compile 'com.google.android.gms:play-services-base:11.6.2' | ||
compile 'com.google.android.gms:play-services-places:11.6.2' | ||
compile 'com.google.android.gms:play-services-location:11.6.2' | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,45 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
def DEFAULT_COMPILE_SDK_VERSION = 25 | ||
def DEFAULT_BUILD_TOOLS_VERSION = "25.0.2" | ||
def DEFAULT_TARGET_SDK_VERSION = 25 | ||
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "11.6.2" | ||
def DEFAULT_ANDROID_MAPS_UTILS_VERSION = "0.5+" | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION | ||
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
|
||
packagingOptions { | ||
exclude 'META-INF/LICENSE' | ||
exclude 'META-INF/DEPENDENCIES.txt' | ||
exclude 'META-INF/LICENSE.txt' | ||
exclude 'META-INF/NOTICE.txt' | ||
exclude 'META-INF/NOTICE' | ||
exclude 'META-INF/DEPENDENCIES' | ||
exclude 'META-INF/notice.txt' | ||
exclude 'META-INF/license.txt' | ||
exclude 'META-INF/dependencies.txt' | ||
exclude 'META-INF/LGPL2.1' | ||
} | ||
|
||
lintOptions { | ||
disable 'InvalidPackage' | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'com.facebook.react:react-native:+' | ||
compile 'com.google.android.gms:play-services-base:10.2.4' | ||
compile 'com.google.android.gms:play-services-places:10.2.4' | ||
compile 'com.google.android.gms:play-services-location:10.2.4' | ||
compile 'com.google.maps.android:android-maps-utils:0.3.4' | ||
def googlePlayServicesVersion = rootProject.hasProperty('googlePlayServicesVersion') ? rootProject.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION | ||
def androidMapsUtilsVersion = rootProject.hasProperty('androidMapsUtilsVersion') ? rootProject.androidMapsUtilsVersion : DEFAULT_ANDROID_MAPS_UTILS_VERSION | ||
|
||
provided "com.facebook.react:react-native:+" | ||
compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion" | ||
compile "com.google.android.gms:play-services-places:$googlePlayServicesVersion" | ||
compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion" | ||
compile "com.google.maps.android:android-maps-utils:$androidMapsUtilsVersion" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"description": "iOS/Android Google Places Widgets (Autocomplete, Place Picker) and API Services for React Native Apps", | ||
"main": "index.js", | ||
"author": "Tolu Olowu (Arttitude 360) <[email protected]>", | ||
"version": "2.4.8", | ||
"version": "2.5.0", | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
|