Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #472

Merged
merged 8 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update dependencies
  • Loading branch information
qiuxiang committed Feb 13, 2019
commit fdecd43c441612781d90bd85f0c0fb8b913c8234
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
aliases:
- &android
components:
- build-tools-27.0.3
- android-27
- build-tools-28.0.3
- android-28
- extra-android-m2repository
- extra-android-support

Expand All @@ -22,9 +22,9 @@ aliases:
|
nvm install node
yarn global add react-native-cli
react-native init App --version="0.52.3"
react-native init App --version="0.58.4"
cd App
yarn add react-native-amap3d
yarn add react-native-amap3d@beta

jobs:
include:
Expand All @@ -48,11 +48,11 @@ jobs:
- yarn
- cd android
- ./gradlew build
- ls -l app/build/outputs/apk
- ls -lh app/build/outputs/apk

- stage: "build test for example"
language: objective-c
osx_image: xcode9.3
osx_image: xcode10.1
cache: *ios-cache
before_install:
script:
Expand All @@ -75,19 +75,19 @@ jobs:
- react-native link
- cd android
- ./gradlew build
- ls -l app/build/outputs/apk/
- ls -lh app/build/outputs/apk/

- stage: "build test for new project"
language: objective-c
osx_image: xcode9.3
osx_image: xcode10.1
cache: *ios-cache
script:
- brew install yarn
- *init-new-project
- cd ios
- |
cat << EOF > Podfile
platform :ios, '8.0'
platform :ios, '9.0'
target 'App' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
Expand All @@ -99,7 +99,7 @@ jobs:
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-amap3d', path: '../node_modules/react-native-amap3d/lib/ios'
end
Expand Down
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ android {
}
}
}
lintOptions {
abortOnError false
}
}

dependencies {
Expand Down
12 changes: 6 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

buildscript {
ext {
buildToolsVersion = "27.0.3"
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -34,6 +34,6 @@ allprojects {


task wrapper(type: Wrapper) {
gradleVersion = '4.4'
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-4.7-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'RNAMap3D'
rootProject.name = 'rn-amap3d'
include ':react-native-amap3d'
project(':react-native-amap3d').projectDir = new File(rootProject.projectDir, '../lib/android')

Expand Down
5 changes: 5 additions & 0 deletions example/examples/controls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
import { StyleSheet, Switch, Text, View } from 'react-native'
import { MapView } from 'react-native-amap3d'
import { requestLocationPermission } from '../utils'
import styles from '../styles'

export default class ControlsExample extends Component {
Expand All @@ -15,6 +16,10 @@ export default class ControlsExample extends Component {
showsLocationButton: false,
}

componentDidMount() {
requestLocationPermission()
}

render() {
return (
<View style={StyleSheet.absoluteFill}>
Expand Down
8 changes: 7 additions & 1 deletion example/examples/events.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { Component } from 'react'
import { FlatList, StyleSheet, Text, View } from 'react-native'
import { MapView } from 'react-native-amap3d'
import { requestLocationPermission } from '../utils'

const styles = StyleSheet.create({
body: {
flex: 1,
},
logs: {
elevation: 8,
flex: 1,
backgroundColor: '#fff',
},
logText: {
Expand All @@ -27,11 +29,15 @@ export default class EventsExample extends Component {
logs: [],
}

componentDidMount() {
requestLocationPermission()
}

_log(event, data) {
this.setState({
logs: [
{
key: Date.now(),
key: Date.now().toString(),
time: new Date().toLocaleString(),
event,
data: JSON.stringify(data, null, 2),
Expand Down
23 changes: 23 additions & 0 deletions example/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { PermissionsAndroid } from "react-native";

export async function requestLocationPermission() {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
{
title: "Location Permission",
message: "location test.",
buttonNeutral: "Ask Me Later",
buttonNegative: "Cancel",
buttonPositive: "OK"
}
);
if (granted === PermissionsAndroid.RESULTS.ACCESS_COARSE_LOCATION) {
console.log("You can use the camera");
} else {
console.log("Camera permission denied");
}
} catch (err) {
console.warn(err);
}
}
4 changes: 2 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '8.0'
platform :ios, '9.0'

# The target name is most likely the name of your project.
target 'RNAMap3D' do
Expand All @@ -18,7 +18,7 @@ target 'RNAMap3D' do

# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-amap3d', path: '../lib/ios/'
Expand Down
10 changes: 5 additions & 5 deletions lib/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

buildscript {
ext.kotlin_version = '1.2.41'
ext.kotlin_version = '1.3.10'

repositories {
jcenter()
Expand All @@ -14,17 +14,17 @@ buildscript {
}

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 27
}
}

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.amap.api:3dmap:6.5.0'
compile 'com.amap.api:3dmap:6.6.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-amap3d",
"version": "1.0.2",
"version": "1.0.3-0",
"description": "react-native 高德地图组件,支持 Android + iOS",
"author": "Qiu Xiang <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -29,13 +29,10 @@
"reload": "adb reverse tcp:8081 tcp:8081 && adb shell input text rr",
"run-ios": "node node_modules/react-native/local-cli/cli.js run-ios"
},
"peerDependencies": {
"react-native": ">=0.47"
},
"devDependencies": {
"metro-react-native-babel-preset": "0.51.0",
"metro-react-native-babel-preset": "0.51.1",
"react": "16.6.3",
"react-native": "0.57.8",
"react-native": "0.58.4",
"react-navigation": "^1.5.11"
},
"rnpm": {
Expand Down