1.我在我的项目rootDir上删除了我的build.gradle
allprojects{
apply plugin: 'idea'
group = 'com.gridsum'
version = '0.1'
}
subprojects{
apply plugin: 'scala'
//apply from: "$rootDir/gradle/scalastyle.gradle"
apply from: "$rootDir/gradle/scoverage.gradle"
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.11.7'
testCompile 'org.scalatest:scalatest_2.11:2.2.4'
testCompile 'junit:junit:4.12'
}
}
2。 declear另一个buildScript" scoverage.gradle"在gradleDir
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.scoverage:gradle-scoverage:1.0-5-g9c68988'
}
}
apply plugin: 'scoverage'
ext {
scalaBinaryVersion = '2.11'
scoverageVersion = '1.0.2'
}
dependencies {
scoverage "org.scoverage:scalac-scoverage-plugin_${scalaBinaryVersion}:${scoverageVersion}",
"org.scoverage:scalac-scoverage-runtime_${scalaBinaryVersion}:${scoverageVersion}"
}
答案 0 :(得分:0)
不幸的是,这不起作用。您应用的脚本中的buildScript
块将不会被评估。您需要将buildScript
块放在应用scoverage.gradle
的脚本中。使其工作的其他方法是使用init scripts。