Skip to content

Commit f372e18

Browse files
committed
Migrated to gradle
1 parent da14fb8 commit f372e18

5 files changed

Lines changed: 54 additions & 42 deletions

File tree

.classpath

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.DS_Store
22
bin/
33
.scannerwork/
4-
.vscode/
4+
.vscode/
5+
.gradle/
6+
build/

.project

Lines changed: 0 additions & 28 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Features in development:
1616

1717
## Building
1818

19-
You need Java 21 and [Apache Ant 1.10.14](https://ant.apache.org) or newer
19+
You need Java 21 and [Gradle](https://gradle.org/)
2020

2121
- Point your JAVA_HOME variable to JDK 21
2222
- Checkout this repository
23-
- Run `ant` to compile the source code
23+
- Run `gradle` to compile the source code
2424

2525
``` text
2626
git clone https://github.com/rmraya/XMLJava.git
2727
cd XMLJava
28-
ant
28+
gradle
2929
```

build.gradle

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
java {
6+
toolchain {
7+
languageVersion = JavaLanguageVersion.of(21)
8+
}
9+
}
10+
11+
sourceSets {
12+
main {
13+
java {
14+
srcDirs = ['src']
15+
}
16+
resources {
17+
srcDirs = ['src']
18+
exclude '**/*.java'
19+
}
20+
}
21+
}
22+
23+
// Disable all caching for fresh builds
24+
gradle.startParameter.buildCacheEnabled = false
25+
tasks.configureEach {
26+
outputs.upToDateWhen { false }
27+
}
28+
29+
tasks.withType(JavaCompile).configureEach {
30+
options.encoding = 'UTF-8'
31+
// Disable incremental compilation for fresh builds
32+
options.incremental = false
33+
}
34+
35+
jar {
36+
archiveBaseName = 'xmljava'
37+
destinationDirectory = file('lib')
38+
}
39+
40+
// Clean task to remove build outputs
41+
tasks.named('clean') {
42+
doFirst {
43+
delete 'lib/xmljava.jar'
44+
}
45+
}
46+
47+
// Default task
48+
defaultTasks 'build'

0 commit comments

Comments
 (0)