summaryrefslogtreecommitdiff
path: root/buildSrc/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-08-13 18:40:34 +0530
committerGitHub <noreply@github.com>2021-08-13 18:40:34 +0530
commita82f8dda860714f446373e6c9406f13d8d6a2547 (patch)
tree1d40a286751b1ac3801c1240bfa454c84c77dc73 /buildSrc/src
parent70137f31917ba1d28d36d1557808c135828ae433 (diff)
Disable explicit API for tests (#1483)
* build: disable explicit API for test tasks * Remove `internal` modifier from test classes
Diffstat (limited to 'buildSrc/src')
-rw-r--r--buildSrc/src/main/java/PasswordStorePlugin.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/buildSrc/src/main/java/PasswordStorePlugin.kt b/buildSrc/src/main/java/PasswordStorePlugin.kt
index df491e0d..52641526 100644
--- a/buildSrc/src/main/java/PasswordStorePlugin.kt
+++ b/buildSrc/src/main/java/PasswordStorePlugin.kt
@@ -68,9 +68,12 @@ class PasswordStorePlugin : Plugin<Project> {
}
private fun Project.configureExplicitApi() {
- configure<KotlinProjectExtension> { explicitApi() }
+ val project = this
tasks.withType<KotlinCompile> {
- kotlinOptions { freeCompilerArgs = freeCompilerArgs + listOf("-Xexplicit-api=strict") }
+ if (!name.contains("test", ignoreCase = true)) {
+ project.configure<KotlinProjectExtension> { explicitApi() }
+ kotlinOptions { freeCompilerArgs += listOf("-Xexplicit-api=strict") }
+ }
}
}
}