Skip to content

Commit 5f08aa0

Browse files
committed
define a custom compile config to copy jars
1 parent 647a1ea commit 5f08aa0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mode/build.gradle

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@ import java.nio.file.Files
22
import org.zeroturnaround.zip.ZipUtil
33
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
44

5+
6+
// Extend compile to copy the jars from gradle-tooling and slf4j:
7+
// https://stackoverflow.com/a/43602463
8+
configurations {
9+
compile.extendsFrom compileAndCopy
10+
}
11+
512
dependencies {
613
compile group: "org.processing", name: "core", version: "${processingVersion}"
714
compile group: "org.processing", name: "pde", version: "${processingVersion}"
815
compile group: "org.processing", name: "java-mode", version: "${processingVersion}"
916

10-
compileOnly "org.gradle:gradle-tooling-api:${toolingVersion}"
11-
compileOnly "org.slf4j:slf4j-api:${slf4jVersion}"
12-
compileOnly "org.slf4j:slf4j-simple:${slf4jVersion}"
17+
compileAndCopy "org.gradle:gradle-tooling-api:${toolingVersion}"
18+
compileAndCopy "org.slf4j:slf4j-api:${slf4jVersion}"
19+
compileAndCopy "org.slf4j:slf4j-simple:${slf4jVersion}"
1320
}
1421

1522
// This task copies the gradle tooling jar into the mode folder
1623
task copyToLib(type: Copy) {
17-
from configurations.compileOnly.files
24+
from configurations.compileAndCopy.files
1825
into "mode"
1926
}
2027
build.dependsOn(copyToLib)

0 commit comments

Comments
 (0)