1- buildscript {
2- repositories {
3- google()
4- jcenter()
5- }
6-
7- dependencies {
8- // noinspection GradleDependency
9- classpath rootProject. ext. has(' gradleBuildTools' ) ? rootProject. ext. get(' gradleBuildTools' ) : ' com.android.tools.build:gradle:3.3.0'
10- classpath ' com.github.dcendents:android-maven-gradle-plugin:2.1'
11- }
12- }
13-
14- def getExtOrDefault (name ) {
15- return rootProject. ext. has(name) ? rootProject. ext. get(name) : project. properties[' ReactNativeSlider_' + name]
1+ plugins {
2+ id " com.android.library"
3+ id " maven-publish"
164}
175
18- def getExtOrIntegerDefault (name ) {
19- return rootProject. ext. has(name) ? rootProject. ext. get(name) : (project. properties[' ReactNativeSlider_' + name]). toInteger()
20- }
21-
22- apply plugin : ' com.android.library'
23- apply plugin : ' com.github.dcendents.android-maven'
24-
256android {
26- compileSdkVersion getExtOrIntegerDefault(' compileSdkVersion' )
27- buildToolsVersion getExtOrDefault(' buildToolsVersion' )
7+ compileSdkVersion 30
288
29- defaultConfig {
30- minSdkVersion getExtOrIntegerDefault( ' minSdkVersion' )
31- targetSdkVersion getExtOrIntegerDefault( ' targetSdkVersion' )
32- }
9+ defaultConfig {
10+ minSdkVersion 21
11+ targetSdkVersion 30
12+ }
3313}
3414
3515repositories {
36- google()
37- jcenter()
38- mavenCentral()
39- if (project == rootProject) {
40- maven {
41- url " https://a8c-libs.s3.amazonaws.com/android/ react-native-mirror "
16+ if (project == rootProject) {
17+ maven { url " https://a8c-libs.s3.amazonaws.com/android/react-native-mirror " }
18+ } else {
19+ // When building as a dep, the RN's maven repo is locally in the node_modules folder
20+ def nodeModulesPath = " ${ project.buildDir } /../../node_modules/ "
21+ maven { url " ${ nodeModulesPath } / react-native/android " }
4222 }
43- } else {
44- // When building as a dep, the RN's maven repo is locally in the node_modules folder
45- def nodeModulesPath = " ${ project.buildDir} /../../node_modules/"
46- maven { url " ${ nodeModulesPath} /react-native/android" }
47- }
23+
24+ google()
25+ jcenter()
26+ mavenCentral()
4827}
4928
5029dependencies {
51- if (project == rootProject) {
52- // If this is the root project (e.g. Jitpack), specify a version
53- implementation ' com.facebook.react:react-native:0.64.0'
54- } else {
55- // noinspection GradleDynamicVersion
56- api " com.facebook.react:react-native:+"
57- }
58- }
30+ if (project == rootProject) {
31+ // If this is the root project (e.g. Jitpack), specify a version
32+ implementation ' com.facebook.react:react-native:0.64.0'
33+ } else {
34+ // noinspection GradleDynamicVersion
35+ api " com.facebook.react:react-native:+"
36+ }
37+ }
38+
39+ afterEvaluate {
40+ publishing {
41+ publications {
42+ release(MavenPublication ) {
43+ from components. release
44+ groupId = ' com.github.wordpress-mobile'
45+ artifactId = ' react-native-slider'
46+ }
47+ }
48+ }
49+ }
0 commit comments