Skip to content

Commit

Permalink
Merge branch 'master' into github-update-cicd-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszLitwiniuk authored Jun 11, 2024
2 parents b810e2b + 27da3aa commit 43d21e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 54 deletions.
6 changes: 6 additions & 0 deletions backtrace-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ android {
buildFeatures {
buildConfig = true
}
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

buildTypes {
Expand Down
55 changes: 1 addition & 54 deletions backtrace-library/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}

Expand Down

0 comments on commit 43d21e8

Please sign in to comment.