aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-12-03 15:08:33 +0530
committerGitHub <noreply@github.com>2021-12-03 09:38:33 +0000
commit208eed426907b235e20429dfc23473211a609e2e (patch)
tree1df46bc45d473161255fb792a7770d76880e5f24
parentd9727f7a4c9513f20168013924f742f850e2009d (diff)
Turn on explicit API for Kotlin JVM projects (#1568)
-rw-r--r--autofill-parser/build.gradle.kts1
-rw-r--r--build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.kotlin-library.gradle.kts17
-rw-r--r--crypto-common/build.gradle.kts2
-rw-r--r--crypto-pgpainless/build.gradle.kts2
-rw-r--r--format-common/build.gradle.kts3
-rw-r--r--openpgp-ktx/build.gradle.kts1
6 files changed, 23 insertions, 3 deletions
diff --git a/autofill-parser/build.gradle.kts b/autofill-parser/build.gradle.kts
index fea86ce6..b97afc0c 100644
--- a/autofill-parser/build.gradle.kts
+++ b/autofill-parser/build.gradle.kts
@@ -6,6 +6,7 @@
plugins {
id("com.github.android-password-store.android-library")
id("com.github.android-password-store.kotlin-android")
+ id("com.github.android-password-store.kotlin-library")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("com.github.android-password-store.psl-plugin")
diff --git a/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.kotlin-library.gradle.kts b/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.kotlin-library.gradle.kts
new file mode 100644
index 00000000..516f5e4f
--- /dev/null
+++ b/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.kotlin-library.gradle.kts
@@ -0,0 +1,17 @@
+/*
+ * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
+import org.gradle.kotlin.dsl.withType
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
+plugins { id("com.github.android-password-store.kotlin-common") }
+
+tasks.withType<KotlinCompile>().configureEach {
+ kotlinOptions {
+ if (!name.contains("test", ignoreCase = true)) {
+ freeCompilerArgs += listOf("-Xexplicit-api=strict")
+ }
+ }
+}
diff --git a/crypto-common/build.gradle.kts b/crypto-common/build.gradle.kts
index 40e39339..b644cddd 100644
--- a/crypto-common/build.gradle.kts
+++ b/crypto-common/build.gradle.kts
@@ -4,7 +4,7 @@
*/
plugins {
kotlin("jvm")
- id("com.github.android-password-store.kotlin-common")
+ id("com.github.android-password-store.kotlin-library")
}
dependencies { implementation(libs.thirdparty.kotlinResult) }
diff --git a/crypto-pgpainless/build.gradle.kts b/crypto-pgpainless/build.gradle.kts
index 103463c3..ee55f349 100644
--- a/crypto-pgpainless/build.gradle.kts
+++ b/crypto-pgpainless/build.gradle.kts
@@ -5,7 +5,7 @@
plugins {
kotlin("jvm")
- id("com.github.android-password-store.kotlin-common")
+ id("com.github.android-password-store.kotlin-library")
}
dependencies {
diff --git a/format-common/build.gradle.kts b/format-common/build.gradle.kts
index 7ed598e3..e5400bcc 100644
--- a/format-common/build.gradle.kts
+++ b/format-common/build.gradle.kts
@@ -2,9 +2,10 @@
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
+
plugins {
kotlin("jvm")
- id("com.github.android-password-store.kotlin-common")
+ id("com.github.android-password-store.kotlin-library")
}
dependencies {
diff --git a/openpgp-ktx/build.gradle.kts b/openpgp-ktx/build.gradle.kts
index b2c25c94..37ebbc62 100644
--- a/openpgp-ktx/build.gradle.kts
+++ b/openpgp-ktx/build.gradle.kts
@@ -6,6 +6,7 @@
plugins {
id("com.github.android-password-store.android-library")
id("com.github.android-password-store.kotlin-android")
+ id("com.github.android-password-store.kotlin-library")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
}