From fca3cd05c1c021b535e0730ce06615b3fa0441b5 Mon Sep 17 00:00:00 2001 From: Senol Atac Date: Thu, 30 Sep 2021 01:05:39 +0300 Subject: [PATCH] fix(Android): Fix androidJavadoc compile problem. (#129) * Create gradle.properties * Update build.gradle * Delete gradle.properties --- android/build.gradle | 70 +------------------------------------------- 1 file changed, 1 insertion(+), 69 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 170b3d4..13c7e43 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,4 @@ -import groovy.json.JsonSlurper + // android/build.gradle @@ -22,7 +22,6 @@ def safeExtGet(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. @@ -41,7 +40,6 @@ buildscript { } apply plugin: 'com.android.library' -apply plugin: 'maven' android { compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) @@ -76,69 +74,3 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules } - -def configureReactNativePom(def pom) { - def packageJson = new JsonSlurper().parseText(file('../package.json').text) - - pom.project { - name packageJson.title - artifactId packageJson.name - version = packageJson.version - group = "com.reactlibrary" - description packageJson.description - url packageJson.repository.baseUrl - - licenses { - license { - name packageJson.license - url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename - distribution 'repo' - } - } - } -} - -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 - } - } -}