-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
60 lines (50 loc) · 2.26 KB
/
build.gradle
File metadata and controls
60 lines (50 loc) · 2.26 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
plugins {
id 'java'
id 'application'
}
group = 'com.visualbean'
version = '1.0.0'
// ── Java Configuration ──────────────────────────────────────────────
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// ── Main Class ──────────────────────────────────────────────────────
application {
mainClass = 'com.visualbean.Main'
}
// ── Resource Sync ───────────────────────────────────────────────────
// The game code loads assets via new File("resources/...") relative to CWD.
// This task copies src/main/resources/ → resources/ at the project root
// so those paths resolve correctly during development.
tasks.register('prepareResources', Sync) {
from 'src/main/resources'
into "${projectDir}/resources"
}
// ── Run Configuration ───────────────────────────────────────────────
run {
workingDir = projectDir
dependsOn 'prepareResources'
}
// ── Runnable JAR ────────────────────────────────────────────────────
jar {
manifest {
attributes(
'Main-Class': application.mainClass
)
}
// Include all dependencies inside the JAR (fat jar)
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// ── Repositories (for future dependencies) ──────────────────────────
repositories {
mavenCentral()
}
// ── Dependencies ────────────────────────────────────────────────────
dependencies {
// Add dependencies here as needed, e.g.:
// implementation 'com.google.code.gson:gson:2.10.1'
}