summaryrefslogtreecommitdiff
path: root/build-logic/android-plugins/src/main
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-10-21 12:02:23 +0530
committerGitHub <noreply@github.com>2022-10-21 06:32:23 +0000
commitdf764932f7fdddea9cea5937c6053a95797d35df (patch)
treea24e108f9584c60b4f6e18717af4269cbb49c91b /build-logic/android-plugins/src/main
parent7f90d827ae436fe74ce5d3cabb9f1b091462b657 (diff)
Migrate to Metalava for validating API (#2195)
Diffstat (limited to 'build-logic/android-plugins/src/main')
-rw-r--r--build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt10
1 files changed, 10 insertions, 0 deletions
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)
+ }
}
}