Fix runClient and runServer Gradle tasks (#2673)

Compile dependencies are placed on the runtime classpath by Gradle.
Because the compile configuration is set to extend from the provided
config, all of those dependencies are put on the runtime classpath as
well.

In this patch, provided is instead made a separate configuration, and
explicitly added to ONLY the compile classpath of the main sourceset.
This commit is contained in:
Xyxen 2017-12-17 22:10:31 -07:00 committed by payonel
parent 719498163c
commit fd9b81582b

View File

@ -178,7 +178,7 @@ repositories {
configurations {
provided
embedded
compile.extendsFrom provided, embedded
compile.extendsFrom embedded
}
dependencies {
@ -230,6 +230,9 @@ dependencies {
testCompile "org.scalatest:scalatest_2.11:2.2.6"
}
// Add the "provided" dependencies to the compile (but NOT runtime) classpath.
sourceSets.main.compileClasspath += [configurations.provided]
idea.module.scopes.PROVIDED.plus += [configurations.provided]
// TODO Causes errors on Gradle 2 for me (No such property: allDependencies for class: java.io.File).
//eclipse.classpath.plusConfigurations += [configurations.provided]