Skip to content

Commit

Permalink
Fix runClient and runServer Gradle tasks (MightyPirates#2673)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Xyxen authored and payonel committed Dec 18, 2017
1 parent 7194981 commit fd9b815
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ repositories {
configurations {
provided
embedded
compile.extendsFrom provided, embedded
compile.extendsFrom embedded
}

dependencies {
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit fd9b815

Please sign in to comment.