-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
151 lines (128 loc) · 4.08 KB
/
build.gradle
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id 'java'
id 'idea'
id 'application'
}
group = "com.rvandoosselaer"
version = "1.0.0-SNAPSHOT"
sourceCompatibility = 1.8
ext {
blocksVersion = "[1.5,)"
jmeUtilsVersion = "[1.0,)"
jmeVersion = "[3.3,)"
slf4jVersion = "[2.0,)"
log4j2Version = "[2.13,)"
jacksonVersion = "[2.10,)"
lemurVersion = "[1.13,)"
lemurProtoVersion = "[1.11,)"
lombokVersion = "[1.18,)"
groovyVersion = "[3.0,)"
simFXVersion = "[1.0,)"
}
repositories {
jcenter()
maven {
url 'https://dl.bintray.com/remyvd/rvandoosselaer'
}
mavenLocal()
}
dependencies {
runtime project(':assets')
// JME
implementation "org.jmonkeyengine:jme3-core:${jmeVersion}"
implementation "org.jmonkeyengine:jme3-desktop:${jmeVersion}"
implementation "org.jmonkeyengine:jme3-lwjgl:${jmeVersion}"
implementation "org.jmonkeyengine:jme3-effects:${jmeVersion}"
// Utils
implementation "com.rvandoosselaer:jme-utils:${jmeUtilsVersion}"
implementation "com.rvandoosselaer:blocks:${blocksVersion}"
implementation "com.simsilica:lemur:${lemurVersion}"
implementation "com.simsilica:lemur-proto:${lemurProtoVersion}"
implementation "com.simsilica:sim-fx:${simFXVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
runtime "org.codehaus.groovy:groovy-all:${groovyVersion}"
// Logging
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.slf4j:jul-to-slf4j:${slf4jVersion}"
implementation "org.apache.logging.log4j:log4j-api:${log4j2Version}"
implementation "org.apache.logging.log4j:log4j-core:${log4j2Version}"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:${log4j2Version}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
}
application {
mainClassName = 'com.rvandoosselaer.blocksbuilder.Main'
applicationDefaultJvmArgs = [
"-Dlog4j.configurationFile=[MY_APP_HOME]/conf/log4j2.yml",
"-Dapplication.configurationFile=[MY_APP_HOME]/conf/application.properties",
"-Dscene.dir=[MY_APP_HOME]/scenes/"
]
}
// create a properties file with the version in
task createProperties(dependsOn: processResources) {
doLast {
new File("$buildDir/resources/main/version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p.store w, null
}
}
}
// copy the generated javadocs into the /docs folder for the github pages
task copyJavadoc(dependsOn: javadoc) {
doLast {
copy {
from "$buildDir/docs"
into "$projectDir/docs"
}
}
}
// remove the generated javadocs in the /docs folder
task cleanJavadoc(type: Delete) {
delete "$projectDir/docs/javadoc/"
}
test {
useJUnitPlatform()
}
task cleanNatives(type: Delete) {
delete "$projectDir/liblwjgl.dylib"
delete "$projectDir/libopenal.dylib"
delete "$projectDir/libbulletjme.dylib"
}
task cleanDistFolder(type: Delete) {
delete "$projectDir/src/dist"
}
task copyDistFiles(type: Copy) {
from file("$projectDir/src/main/resources/log4j2.yml") into file("$projectDir/src/dist/conf")
from file("$projectDir/src/main/resources/application.properties") into file("$projectDir/src/dist/conf")
}
task cleanTextures {
doLast {
delete "$projectDir/assets/Textures/blocks/"
mkdir "$projectDir/assets/Textures/blocks/"
}
}
clean {
dependsOn cleanNatives
dependsOn cleanJavadoc
dependsOn cleanDistFolder
}
classes {
dependsOn createProperties
}
build {
dependsOn copyDistFiles
dependsOn copyJavadoc
}
jar {
exclude("**/log4j2.yml")
exclude("**/application.properties")
}
startScripts.doLast {
unixScript.text = unixScript.text.replace('[MY_APP_HOME]', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('[MY_APP_HOME]', '%~dp0..')
}
javadoc {
failOnError = false
}