我的gradle构建脚本不起作用

时间:2015-10-29 15:15:19

标签: gradle

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}"
}
  1. 它重新出现错误"未找到Plguin" ,我不知道出了什么问题?

1 个答案:

答案 0 :(得分:0)

不幸的是,这不起作用。您应用的脚本中的buildScript块将不会被评估。您需要将buildScript块放在应用scoverage.gradle的脚本中。使其工作的其他方法是使用init scripts