一、在App gradle中配置以下信息
java
[object Object]
apply from: 'http://nexus.sdp.nd/nexus/service/local/repositories/android/content/com/nd/sdp/sdp-android-app/1.3.0/sdp-android-app-1.3.0.gradle' apply plugin: "sonar-runner" sonarRunner { toolVersion = '2.3' // default sonarProperties { property "sonar.host.url", "http://sonar.sdp.nd" property "sonar.language", "java" property "sonar.sourceEncoding", "UTF-8" property "sonar.profile", "android.sdp.nd" property "sonar.dynamicAnalysis", "reuseReports" property "sonar.sources", android.sourceSets.main.java.srcDirs property "sonar.tests", android.sourceSets.instrumentTest.java.srcDirs property "sonar.java.binaries", "${buildDir}/intermediates/classes" property 'sonar.jacoco.reportPath', "${buildDir}/jacoco/testReleaseUnitTest.exec" property "sonar.jacoco.itReportPath", "$buildDir/jacoco/testReleaseUnitTest.exec" property 'sonar.junit.reportsPath', "${buildDir}/test-results/release" property 'sonar.surefire.reportsPath', "${buildDir}/test-results/release" property "sonar.cobertura.reportPath", "${buildDir}/reports/coverage/debug/report.xml" property "sonar.core.codeCoveragePlugin", "cobertura" } forkOptions { maxHeapSize = '2048m' } } **************************************************************************************************** instrumentTest.setRoot('src/test/') //很重要,請勿更改 instrumentTest { java { srcDirs = [ // 'src/test/java' //UT放置目錄,很重要,請勿更改 'src/androidTest/java' //UT放置目錄,很重要,請勿更改 ] } res.srcDirs = ["src/main/res"] assets.srcDirs = [ 'src/main/assets' ] }
項目如有多個模塊,每一個 模塊的gradle都須要配置android
二、建立gradlerapp