Remove deprecated method

This commit is contained in:
DenSakh 2022-07-05 17:04:04 +03:00
parent 3825b3f1e0
commit e4c4bdee52
2 changed files with 27 additions and 26 deletions

View File

@ -18,17 +18,17 @@
// original location: // original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle // - 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_COMPILE_SDK_VERSION = 30
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2'
def DEFAULT_MIN_SDK_VERSION = 16 def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 28 def DEFAULT_TARGET_SDK_VERSION = 30
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: 'com.android.library'
apply plugin: 'maven' apply plugin: 'maven-publish'
buildscript { buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone. // The Android Gradle plugin is only required when opening the android folder stand-alone.
@ -39,15 +39,16 @@ buildscript {
repositories { repositories {
google() google()
jcenter() jcenter()
mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.android.tools.build:gradle:3.6.4'
} }
} }
} }
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'maven' apply plugin: 'maven-publish'
android { android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@ -55,6 +56,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
vectorDrawables.useSupportLibrary = true
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }
@ -65,24 +67,26 @@ android {
repositories { repositories {
// ref: https://www.baeldung.com/maven-local-repository // ref: https://www.baeldung.com/maven-local-repository
mavenLocal() mavenCentral()
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"
} }
google()
jcenter()
maven { maven {
// Android JSC is installed from npm // Android JSC is installed from npm
url "$rootDir/../node_modules/jsc-android/dist" url "$rootDir/../node_modules/jsc-android/dist"
} }
google()
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.13.3' implementation 'com.yandex.android:mobmetricalib:5.0.0'
implementation 'com.android.installreferrer:installreferrer:1.1.2' implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'org.codehaus.groovy:groovy-json:3.0.11'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-beta02'
} }
def configureReactNativePom(def pom) { def configureReactNativePom(def pom) {
@ -119,12 +123,13 @@ afterEvaluate { project ->
task androidJavadoc(type: Javadoc) { task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath) classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('compile').asList()) project.getConfigurations().getByName('implementation').setCanBeResolved(true)
classpath += files(project.getConfigurations().getByName('implementation').asList())
include '**/*.java' include '**/*.java'
} }
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc' archiveClassifier = 'javadoc'
from androidJavadoc.destinationDir from androidJavadoc.destinationDir
} }
@ -148,12 +153,11 @@ afterEvaluate { project ->
archives androidJavadocJar archives androidJavadocJar
} }
task installArchives(type: Upload) { publishing {
configuration = configurations.archives repositories {
repositories.mavenDeployer { maven {
// Deploy to react-native-event-bridge/maven, ready to publish to npm url = uri("${rootProject.projectDir}/maven-repo")
repository url: "file://${projectDir}/../android/maven" }
configureReactNativePom pom
} }
} }
} }

View File

@ -31,9 +31,6 @@ 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")) {
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")));
} }