-
-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
114 lines (100 loc) · 2.9 KB
/
build.gradle.kts
File metadata and controls
114 lines (100 loc) · 2.9 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
plugins {
java
}
repositories{
mavenCentral()
google()
maven("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(project(":app:utils"))
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
val javaMode = { path : String -> layout.buildDirectory.dir("resources-bundled/common/modes/java/$path") }
val bundle = tasks.register<Copy>("extraResources"){
dependsOn("copyCore")
from(".")
include("keywords.txt")
include("theme/**/*")
include("application/**/*")
into(javaMode(""))
}
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 legacyLibraries = arrayOf("io","net","svg")
legacyLibraries.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( javaMode("/libraries/$library"))
}
bundle.configure {
dependsOn("library-$library-extraResources")
}
}
val libraries = arrayOf("dxf", "pdf", "serial")
libraries.forEach { library ->
val name = "create-$library-library"
tasks.register<Copy>(name) {
group = "libraries"
val project = project(":java:libraries:$library")
val libraryTask = project.tasks.named("createLibrary")
dependsOn(libraryTask)
from(project.layout.buildDirectory.dir("library"))
into(javaMode("/libraries/$library"))
}
bundle.configure {
dependsOn(name)
}
}
tasks.jar { dependsOn("extraResources") }
tasks.processResources{ finalizedBy("extraResources") }
tasks.compileTestJava{ finalizedBy("extraResources") }
tasks.test {
useJUnit()
}