Skip to content

Commit

Permalink
Use new Javadocs and Source (#42)
Browse files Browse the repository at this point in the history
* add api client with grpc kotlin

* use the new way of creating source and jar docs
  • Loading branch information
nplasterer authored Mar 2, 2023
1 parent b75604b commit 582ee97
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ android {
kotlinOptions {
jvmTarget = '11'
}
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

protobuf {
Expand Down Expand Up @@ -77,35 +83,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
archiveClassifier.set('javadoc')
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

tasks.withType(Javadoc).all {
enabled = false
}

artifacts {
archives androidJavadocsJar, androidSourcesJar
}

afterEvaluate {
publishing {
publications {
Expand All @@ -114,14 +91,7 @@ afterEvaluate {
artifactId = "android"
version = System.getenv("RELEASE_VERSION")

if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}

artifact androidSourcesJar
artifact androidJavadocsJar
from components.release

pom {
name = "XMTP"
Expand Down

0 comments on commit 582ee97

Please sign in to comment.