android-testify icon indicating copy to clipboard operation
android-testify copied to clipboard

Improve error messages

Open PatrickVvB opened this issue 1 year ago • 0 comments

Hi! In our project we using gradle composite builds. And this makes some problems with gradle tasks findings while sync the project. It is good when you have full understanding how composite build works and how other projects see path for another, but other cases some errors can frustrated. For example, we have project like this: |-- foo-project | |-- composite-project | | |-- feature-1 | | |-- feature-2 | | |-- domain | | |-- ui | |-- settings.gradle.kts |-- settings.gradle.kts When we apply testify plugin on android library module it is try to find installDebugAndroidTest task using tasks.findByPath(moduleName + installDebugAndroidTest). If we apply testify plugin on ui (feature-2:ui) module and define only applicationPackageId and testPackageId, fallback value for moduleName will be "ui" (project.name). tasks.findByPath cant find the tasks and return null and pass it to dependsOn, and we got 'A dependency must not be empty' exception.

In reality full task path will be : composite-project:feature-2:ui:installDebugAndroidTest. But if we wont to find this task inside composite-project (ui module build.gradle.kts), we must to pass : feature-2:ui:installDebugAndroidTest (as in define in composite-project-settings.gradle.kts)

This feedback relates to:

  • [ ] The Kotlin library
  • [ x ] The Gradle plugin
  • [ ] The IntelliJ Platform plugin
  • [ ] The sample code
  • [ ] The documentation

Solution can be check finding task for null. And if it is null, throw exception with used parameters.

PatrickVvB avatar Nov 02 '24 13:11 PatrickVvB