Alix Alix - 3 months ago 16
Android Question

Proper configuration for "sonar.libraries" in a modern Gradle Android project

What I want to achieve:

In sonar it is possible to track third party dependencies used throughout Projects by setting the property "sonar.libraries" and perhaps there are more benefits

What I tried to do:

I set the value to

build/intermediates/pre-dexed/debug/*.jar
but this seems to have little effect.

Question:

Since it is no longer needed to use the "libs" folder for third party dependencies, what is the recommendation for the property called "sonar.libraries"?

Answer

We need to implement special processing when an Android project is detected. Correctly setting sonar.java.libraries is one of the requirements. A ticket already exists, feel free to vote or provide a pull request. https://jira.sonarsource.com/browse/SONARGRADL-6

Update: we have released version 2.1 of the plugin (currently RC1) that natively supports Android projects. Properties sonar.java.binaries and sonar.java.libraries will be automatically populated.