Hello
I am trying to set up SonarQube for our Android project. We have a multi module application where some (most) modules are dependant on others. For example they require that module that is implementing them has to declare some resources. We want it that way, because we want our library modules to be customized by application modules. For example we have a module which expects application module to provide string R.string.app_name and drawable R.drawable.app_logo. Each application module can provide different app name and logo if needed. We never run android Tests for sub modules - only for application modules. We also donât need Android Instrumentation Tests as weâre using different, cross platform (ios/android) solution for testing app behavior/visuals.
So weâve set up our project to use sonarqube gradle plpugin v3.5.0.2730, but when we run analysis it always fails on tasks related to android tests, ex. âExecution failed for task â:shared-ui:processDebugAndroidTestResourcesâ.â. This task fails, as shared-ui module contains some resources that are expected to be provided in different module as described above.
What Iâd like to achieve is to disable running androidTest related tasks from SonarQube. We want to analyse our code and unit tests, but skip anything androidTest related. Iâve seen multiple posts about this, but no issue-solving answer was provided. The answer that is the closest to what we want to achieve is SonarScanner for Gradle BUILD FAILED - #11 by will_ren but in fact we want to be able to execute AndroidTests, but only for android-application modules. Besides it doesnât work for gradle 7.0.2, which weâre using.
So is there any way to disable running androidTest related tasks for SonarQube analysis?