astrisk
astrisk

Reputation: 1

my gradle buildScript don't work

1.I am declear my build.gradle on my project rootDir

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 another buildScript "scoverage.gradle" in 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. It repoert an error "Plguin not found" ,I don't know what is wrong?

Upvotes: 0

Views: 740

Answers (1)

Opal
Opal

Reputation: 84756

Unfortunately this won't work. buildScript block in the script you apply from will not be evaluated. You need to put the buildScript block in the script you apply the scoverage.gradle. Other way to make it work is to use init scripts.

Upvotes: 1

Related Questions