summaryrefslogtreecommitdiff
path: root/build-logic/android-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'build-logic/android-plugins')
-rw-r--r--build-logic/android-plugins/build.gradle.kts1
-rw-r--r--build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt10
2 files changed, 11 insertions, 0 deletions
diff --git a/build-logic/android-plugins/build.gradle.kts b/build-logic/android-plugins/build.gradle.kts
index e3ab454f..870f5d18 100644
--- a/build-logic/android-plugins/build.gradle.kts
+++ b/build-logic/android-plugins/build.gradle.kts
@@ -56,6 +56,7 @@ gradlePlugin {
dependencies {
implementation(libs.build.agp)
implementation(libs.build.mavenpublish)
+ implementation(libs.build.metalava)
implementation(libs.build.r8)
implementation(libs.build.semver)
implementation(libs.build.sentry)
diff --git a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
index b005043b..542bfeb6 100644
--- a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
+++ b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
@@ -5,6 +5,8 @@ package app.passwordstore.gradle
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.SonatypeHost
+import me.tylerbwong.gradle.metalava.Documentation
+import me.tylerbwong.gradle.metalava.extension.MetalavaExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
@@ -21,6 +23,7 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
apply(LibraryPlugin::class)
apply(MavenPublishPlugin::class)
apply(SigningPlugin::class)
+ apply("me.tylerbwong.gradle.metalava")
}
project.extensions.getByType<MavenPublishBaseExtension>().run {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
@@ -33,5 +36,12 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
+ project.extensions.getByType<MetalavaExtension>().run {
+ documentation.set(Documentation.PUBLIC)
+ inputKotlinNulls.set(true)
+ outputKotlinNulls.set(true)
+ reportLintsAsErrors.set(true)
+ reportWarningsAsErrors.set(true)
+ }
}
}