-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gradle): create test plugin convention for test modules.
- Loading branch information
1 parent
78200c5
commit 93b10d5
Showing
4 changed files
with
35 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
build-logic/plugins/src/main/kotlin/conventions/TestLibraryPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package conventions | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.getByType | ||
import org.jetbrains.compose.ComposeExtension | ||
import org.jetbrains.compose.ExperimentalComposeLibrary | ||
|
||
class TestLibraryPlugin: Plugin<Project> { | ||
@OptIn(ExperimentalComposeLibrary::class) | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("confily.android.library") | ||
apply("confily.android.library.compose") | ||
apply("confily.quality") | ||
} | ||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs") | ||
val compose = extensions.getByType<ComposeExtension>() | ||
dependencies { | ||
add("api", project(":android-core:core-test-patterns")) | ||
add("api", libs.findLibrary("androidx-espresso-core").get()) | ||
add("api", compose.dependencies.uiTestJUnit4) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters