forked from processing/processing4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
90 lines (81 loc) · 2.39 KB
/
build.gradle.kts
File metadata and controls
90 lines (81 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
plugins {
id("java")
}
repositories{
mavenCentral()
google()
maven { url = uri("https://jogamp.org/deployment/maven") }
}
sourceSets{
main{
java{
srcDirs("src")
exclude("processing/mode/java/preproc/**")
}
}
test{
java{
srcDirs("test")
}
}
}
dependencies{
implementation(project(":app"))
implementation(project(":core"))
implementation(project(":java:preprocessor"))
implementation(libs.eclipseJDT)
implementation(libs.eclipseJDTCompiler)
implementation(libs.classpathExplorer)
implementation(libs.netbeansSwing)
implementation(libs.ant)
implementation(libs.lsp4j)
implementation(libs.jsoup)
implementation(libs.antlr)
testImplementation(libs.junit)
testImplementation(libs.mockito)
}
tasks.compileJava{
options.encoding = "UTF-8"
}
// LEGACY TASKS
// Most of these are shims to be compatible with the old build system
// They should be removed in the future, as we work towards making things more Gradle-native
tasks.register<Copy>("extraResources"){
dependsOn(":java:copyCore")
from(".")
include("keywords.txt")
include("theme/**/*")
include("application/**/*")
into( layout.buildDirectory.dir("resources-bundled/common/modes/java"))
}
tasks.register<Copy>("copyCore"){
val coreProject = project(":core")
dependsOn(coreProject.tasks.jar)
from(coreProject.tasks.jar) {
include("core*.jar")
}
rename("core.+\\.jar", "core.jar")
into(coreProject.layout.projectDirectory.dir("library"))
}
val libraries = arrayOf("dxf","io","net","pdf","serial","svg")
libraries.forEach { library ->
tasks.register<Copy>("library-$library-extraResources"){
val build = project(":java:libraries:$library").tasks.named("build")
build.configure {
dependsOn(":java:copyCore")
}
dependsOn(build)
from("libraries/$library")
include("*.properties")
include("library/**/*")
include("examples/**/*")
into( layout.buildDirectory.dir("resources-bundled/common/modes/java/libraries/$library"))
}
tasks.named("extraResources"){ dependsOn("library-$library-extraResources") }
}
tasks.jar { dependsOn("extraResources") }
tasks.processResources{ finalizedBy("extraResources") }
tasks.compileTestJava{ finalizedBy("extraResources") }
tasks.test {
useJUnit()
}