diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2021-08-13 18:40:34 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 18:40:34 +0530 |
commit | a82f8dda860714f446373e6c9406f13d8d6a2547 (patch) | |
tree | 1d40a286751b1ac3801c1240bfa454c84c77dc73 /buildSrc/src/main/java | |
parent | 70137f31917ba1d28d36d1557808c135828ae433 (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/main/java')
-rw-r--r-- | buildSrc/src/main/java/PasswordStorePlugin.kt | 7 |
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") } + } } } } |