Sonarqube 8.6 Scanning React-native gradle project

Hi @Shay_Gold ,

See Task dependencies for Gradle sonar scanner. Example:

// build.gradle
project.tasks["sonarqube"].dependsOn "anotherTask"

Yes, it is possible, but you’ll need to experiment with defining the source.sources and sonar.tests analysis parameters. Suppose Gradle owns the scan process, then take a look at this post:

sonarqube {
  properties {
    property 'sonar.sources', 'src/main/java,src/main/webapp'
    property 'sonar.tests', 'src/test/java,src/frontend/test'
  }
}

You may need to ensure the scope of your folders/files are within the right directory if you intend on the the Gradle scanner “owning” the scan process.

Alternatively, assuming you only have Swift and not Objective-C code (if you do, then you’ll need to use the build-wrapper), you could go the opposite direction and scan the entire project with just the pure Sonar scanner CLI and make sure to define the sonar.java.binaries and sonar.java.libraries etc. parameters (see Java analysis parameters for more details).

Joe