Last active
April 10, 2025 03:01
-
-
Save gerin98/64cea9e0161aca0376a3e916df247af2 to your computer and use it in GitHub Desktop.
Test Targets plugin
This file contains hidden or 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
| data class TestTargetsConfig( | |
| var testTargets: Set<String> = emptySet() | |
| ) | |
| abstract class TestTargetsTask : DefaultTask() { | |
| @get:Input | |
| abstract val testTargetsConfig: Property<TestTargetsConfig> | |
| @TaskAction | |
| fun main() { | |
| val basePackageName = "com.wf.test.uitests" | |
| val fileComponent = FilesChangedComponent(project) | |
| val modulesComponent = ModulesChangedComponent(project) | |
| val filesChanged = fileComponent.diff() | |
| val modulesChanged = modulesComponent.affectedModules(filesChanged) | |
| val targets = getTestTargets(projectDir, fileComponent, modulesComponent) | |
| testTargetsConfig.get().apply { | |
| testTargets = targets | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment