@@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
2828}
2929
3030apply plugin : ' com.android.library'
31- apply plugin : ' maven'
31+ apply plugin : ' maven-publish '
3232
3333buildscript {
3434 // The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -47,7 +47,7 @@ buildscript {
4747}
4848
4949apply plugin : ' com.android.library'
50- apply plugin : ' maven'
50+ apply plugin : ' maven-publish '
5151
5252android {
5353 compileSdkVersion safeExtGet(' compileSdkVersion' , DEFAULT_COMPILE_SDK_VERSION )
@@ -119,17 +119,18 @@ afterEvaluate { project ->
119119 task androidJavadoc(type : Javadoc ) {
120120 source = android. sourceSets. main. java. srcDirs
121121 classpath + = files(android. bootClasspath)
122- classpath + = files(project. getConfigurations(). getByName(' compile' ). asList())
122+ project. getConfigurations(). getByName(' implementation' ). setCanBeResolved(true )
123+ classpath + = files(project. getConfigurations(). getByName(' implementation' ). asList())
123124 include ' **/*.java'
124125 }
125126
126127 task androidJavadocJar(type : Jar , dependsOn : androidJavadoc) {
127- classifier = ' javadoc'
128+ archiveClassifier = ' javadoc'
128129 from androidJavadoc. destinationDir
129130 }
130131
131132 task androidSourcesJar(type : Jar ) {
132- classifier = ' sources'
133+ archiveClassifier = ' sources'
133134 from android. sourceSets. main. java. srcDirs
134135 include ' **/*.java'
135136 }
@@ -143,17 +144,11 @@ afterEvaluate { project ->
143144 }
144145 }
145146
146- artifacts {
147- archives androidSourcesJar
148- archives androidJavadocJar
149- }
150-
151- task installArchives(type : Upload ) {
152- configuration = configurations. archives
153- repositories. mavenDeployer {
154- // Deploy to react-native-event-bridge/maven, ready to publish to npm
155- repository url : " file://${ projectDir} /../android/maven"
156- configureReactNativePom pom
157- }
147+ publishing {
148+ repositories {
149+ maven {
150+ url = uri(" ${ rootProject.projectDir} /maven-repo" )
151+ }
152+ }
158153 }
159154}
0 commit comments