update rn68
This commit is contained in:
parent
36605766b8
commit
df7eaa23e8
@ -1,163 +1,65 @@
|
|||||||
/*
|
buildscript {
|
||||||
* Version for React Native
|
if (project == rootProject) {
|
||||||
* © 2020 YANDEX
|
repositories {
|
||||||
* You may not use this file except in compliance with the License.
|
google()
|
||||||
* You may obtain a copy of the License at
|
mavenCentral()
|
||||||
* https://yandex.com/legal/appmetrica_sdk_agreement/
|
jcenter()
|
||||||
*/
|
}
|
||||||
|
|
||||||
// android/build.gradle
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// based on:
|
apply plugin: 'com.android.library'
|
||||||
//
|
|
||||||
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
|
|
||||||
// original location:
|
|
||||||
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
|
|
||||||
//
|
|
||||||
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
|
|
||||||
// original location:
|
|
||||||
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
|
|
||||||
|
|
||||||
def DEFAULT_COMPILE_SDK_VERSION = 28
|
|
||||||
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
|
|
||||||
def DEFAULT_MIN_SDK_VERSION = 16
|
|
||||||
def DEFAULT_TARGET_SDK_VERSION = 28
|
|
||||||
|
|
||||||
def safeExtGet(prop, fallback) {
|
def safeExtGet(prop, fallback) {
|
||||||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
|
||||||
apply plugin: 'maven'
|
|
||||||
|
|
||||||
buildscript {
|
|
||||||
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
||||||
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
||||||
// module dependency in an application project.
|
|
||||||
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
|
|
||||||
if (project == rootProject) {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
|
||||||
apply plugin: 'maven'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
compileSdkVersion safeExtGet('AwesomeModule_compileSdkVersion', 29)
|
||||||
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
minSdkVersion safeExtGet('AwesomeModule_minSdkVersion', 16)
|
||||||
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
targetSdkVersion safeExtGet('AwesomeModule_targetSdkVersion', 29)
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
disable 'GradleCompatible'
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// ref: https://www.baeldung.com/maven-local-repository
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven {
|
maven {
|
||||||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
||||||
url "$rootDir/../node_modules/react-native/android"
|
url("$rootDir/../node_modules/react-native/android")
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// Android JSC is installed from npm
|
|
||||||
url "$rootDir/../node_modules/jsc-android/dist"
|
|
||||||
}
|
}
|
||||||
google()
|
google()
|
||||||
|
mavenCentral()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//noinspection GradleDynamicVersion
|
//noinspection GradleDynamicVersion
|
||||||
implementation 'com.facebook.react:react-native:+' // From node_modules
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||||
implementation 'com.yandex.android:mobmetricalib:3.18.0'
|
implementation 'com.yandex.android:mobmetricalib:4.2.0'
|
||||||
implementation "com.yandex.android:mobmetricapushlib:1.10.0"
|
implementation "com.yandex.android:mobmetricapushlib:2.1.1"
|
||||||
implementation "com.android.support:support-compat:28.0.0"
|
implementation "com.android.support:support-compat:28.0.0"
|
||||||
implementation 'com.android.installreferrer:installreferrer:1.1.2'
|
implementation 'com.android.installreferrer:installreferrer:1.1.2'
|
||||||
implementation "com.google.firebase:firebase-messaging:21.0.0"
|
implementation "com.google.firebase:firebase-messaging:22.0.0"
|
||||||
implementation "com.google.android.gms:play-services-base:17.5.0"
|
implementation "com.google.android.gms:play-services-base:17.5.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
def configureReactNativePom(def pom) {
|
|
||||||
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
|
|
||||||
|
|
||||||
pom.project {
|
|
||||||
name packageJson.title
|
|
||||||
artifactId packageJson.name
|
|
||||||
version = packageJson.version
|
|
||||||
group = "com.yandex.metrica.plugin.reactnative"
|
|
||||||
description packageJson.description
|
|
||||||
url packageJson.repository.baseUrl
|
|
||||||
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name packageJson.license
|
|
||||||
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
|
|
||||||
distribution 'repo'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id packageJson.author.username
|
|
||||||
name packageJson.author.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate { project ->
|
|
||||||
// some Gradle build hooks ref:
|
|
||||||
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
|
|
||||||
task androidJavadoc(type: Javadoc) {
|
|
||||||
source = android.sourceSets.main.java.srcDirs
|
|
||||||
classpath += files(android.bootClasspath)
|
|
||||||
classpath += files(project.getConfigurations().getByName('compile').asList())
|
|
||||||
include '**/*.java'
|
|
||||||
}
|
|
||||||
|
|
||||||
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
|
||||||
classifier = 'javadoc'
|
|
||||||
from androidJavadoc.destinationDir
|
|
||||||
}
|
|
||||||
|
|
||||||
task androidSourcesJar(type: Jar) {
|
|
||||||
classifier = 'sources'
|
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
include '**/*.java'
|
|
||||||
}
|
|
||||||
|
|
||||||
android.libraryVariants.all { variant ->
|
|
||||||
def name = variant.name.capitalize()
|
|
||||||
def javaCompileTask = variant.javaCompileProvider.get()
|
|
||||||
|
|
||||||
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
|
|
||||||
from javaCompileTask.destinationDir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives androidSourcesJar
|
|
||||||
archives androidJavadocJar
|
|
||||||
}
|
|
||||||
|
|
||||||
task installArchives(type: Upload) {
|
|
||||||
configuration = configurations.archives
|
|
||||||
repositories.mavenDeployer {
|
|
||||||
// Deploy to react-native-event-bridge/maven, ready to publish to npm
|
|
||||||
repository url: "file://${projectDir}/../android/maven"
|
|
||||||
configureReactNativePom pom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -56,9 +56,9 @@ abstract class Utils {
|
|||||||
if (configMap.hasKey("firstActivationAsUpdate")) {
|
if (configMap.hasKey("firstActivationAsUpdate")) {
|
||||||
builder.handleFirstActivationAsUpdate(configMap.getBoolean("firstActivationAsUpdate"));
|
builder.handleFirstActivationAsUpdate(configMap.getBoolean("firstActivationAsUpdate"));
|
||||||
}
|
}
|
||||||
if (configMap.hasKey("installedAppCollecting")) {
|
// if (configMap.hasKey("installedAppCollecting")) {
|
||||||
builder.withInstalledAppCollecting(configMap.getBoolean("installedAppCollecting"));
|
// builder.withInstalledAppCollecting(configMap.getBoolean("installedAppCollecting"));
|
||||||
}
|
// }
|
||||||
if (configMap.hasKey("location")) {
|
if (configMap.hasKey("location")) {
|
||||||
builder.withLocation(toLocation(configMap.getMap("location")));
|
builder.withLocation(toLocation(configMap.getMap("location")));
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-appmetrica-next",
|
"name": "react-native-appmetrica-next",
|
||||||
"title": "Yandex AppMetrica React Native Plugin && AppMetricaPushSDK (fireBase CloudMessage)",
|
"title": "Yandex AppMetrica React Native Plugin && AppMetricaPushSDK (fireBase CloudMessage)",
|
||||||
"version": "1.0.16",
|
"version": "1.0.18",
|
||||||
"description": "React Native plugin for AppMetrica analytics tool",
|
"description": "React Native plugin for AppMetrica analytics tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -31,7 +31,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://appmetrica.yandex.com/docs",
|
"homepage": "https://appmetrica.yandex.com/docs",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react-native": ">=0.59.0 <1.0.x"
|
"react-native": ">=0.65.0 <1.0.x"
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
|||||||
s.requires_arc = true
|
s.requires_arc = true
|
||||||
|
|
||||||
s.dependency "React"
|
s.dependency "React"
|
||||||
s.dependency 'YandexMobileMetrica', '4.0.0'
|
s.dependency 'YandexMobileMetrica', '4.2.0'
|
||||||
s.dependency 'YandexMobileMetricaPush', '1.1.1'
|
s.dependency 'YandexMobileMetricaPush', '1.1.1'
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user