Skip to content

Commit 6af4b22

Browse files
Replace Ant build with native Gradle build for DXF library
- Removed ant.importBuild("build.xml") - Added standalone Gradle build logic using Kotlin DSL - Configured Java 17 toolchain - Added core.jar presence check - Created custom dxfJar and clean tasks This removes reliance on Ant for the DXF library as part of the migration effort described in processing#981
1 parent d35f4de commit 6af4b22

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

java/libraries/dxf/build.gradle.kts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
ant.importBuild("build.xml")
1+
plugins {
2+
java
3+
}
4+
5+
6+
java {
7+
toolchain {
8+
languageVersion.set(JavaLanguageVersion.of(17))
9+
}
10+
}
11+
12+
val coreJar = file("../../../core/library/core.jar")
13+
14+
dependencies {
15+
implementation(files(coreJar))
16+
}
17+
18+
tasks.register("checkCore") {
19+
doFirst {
20+
if (!coreJar.exists()) {
21+
throw GradleException("Missing core.jar at $coreJar. Please build the core module first.")
22+
}
23+
}
24+
}
25+
26+
tasks.register<Jar>("dxfJar") {
27+
dependsOn("checkCore", "classes")
28+
archiveBaseName.set("dxf")
29+
destinationDirectory.set(file("library"))
30+
from(sourceSets.main.get().output)
31+
}
32+
33+
tasks.register("clean") {
34+
doLast {
35+
delete("build", "library/dxf.jar")
36+
}
37+
}

0 commit comments

Comments
 (0)