diff --git a/backtrace-library/build.gradle b/backtrace-library/build.gradle index a351741f..104c51e4 100644 --- a/backtrace-library/build.gradle +++ b/backtrace-library/build.gradle @@ -35,6 +35,12 @@ android { buildFeatures { buildConfig = true } + publishing { + singleVariant("release") { + withSourcesJar() + withJavadocJar() + } + } } buildTypes { diff --git a/backtrace-library/publish.gradle b/backtrace-library/publish.gradle index 5f1281b4..c3fb6aa8 100644 --- a/backtrace-library/publish.gradle +++ b/backtrace-library/publish.gradle @@ -80,7 +80,7 @@ afterEvaluate { project -> publishing { publications { release(MavenPublication) { - from components.findByName('release') + from components.release groupId GROUP artifactId POM_ARTIFACT_ID version version @@ -101,63 +101,10 @@ afterEvaluate { project -> } } - if (project.getPlugins().hasPlugin('com.android.application') || - project.getPlugins().hasPlugin('com.android.library')) { - - task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.source - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - excludes = ['**/*.kt'] - } - - task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - archiveClassifier = 'javadoc' - from androidJavadocs.destinationDir - } - - task androidSourcesJar(type: Jar) { - archiveClassifier = 'sources' - from android.sourceSets.main.java.source - } - } - - if (JavaVersion.current().isJava8Compatible()) { - allprojects { - tasks.withType(Javadoc) { - options.addStringOption('Xdoclint:none', '-quiet') - } - } - } - - if (JavaVersion.current().isJava9Compatible()) { - allprojects { - tasks.withType(Javadoc) { - options.addBooleanOption('html5', true) - } - } - } - - artifacts { - if (project.getPlugins().hasPlugin('com.android.application') || - project.getPlugins().hasPlugin('com.android.library')) { - archives androidSourcesJar - archives androidJavadocsJar - } - } - - android.libraryVariants.all { variant -> - tasks.androidJavadocs.doFirst { - classpath += files(variant.javaCompileProvider.get().classpath.files.join(File.pathSeparator)) - } - } - publishing.publications.all { publication -> publication.groupId = GROUP publication.version = version - publication.artifact androidSourcesJar - publication.artifact androidJavadocsJar - configurePom(publication.pom) }