diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-10-21 12:02:23 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 06:32:23 +0000 |
commit | df764932f7fdddea9cea5937c6053a95797d35df (patch) | |
tree | a24e108f9584c60b4f6e18717af4269cbb49c91b /build-logic/android-plugins | |
parent | 7f90d827ae436fe74ce5d3cabb9f1b091462b657 (diff) |
Migrate to Metalava for validating API (#2195)
Diffstat (limited to 'build-logic/android-plugins')
-rw-r--r-- | build-logic/android-plugins/build.gradle.kts | 1 | ||||
-rw-r--r-- | build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt | 10 |
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) + } } } |