-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
67 lines (58 loc) · 1.81 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
plugins {
id 'java'
id 'application'
id 'distribution'
}
// Define the main class for the application
mainClassName = 'com.bitfire.uracer.URacerDesktop'
// import our simple git version tokenizer
apply from: "${rootDir}/versioninfo.gradle"
def (versionName, versionNameShort, versionCode) = getVersionInfo()
// apply version
version = versionName
dependencies {
compile fileTree(dir: 'libs/jars/', include: ['*.jar'])
compile fileTree(dir: 'libs/jars/gdx', include: ['*.jar'])
}
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { 'lib/' + it.getName() }.join(' '),
'Main-Class': mainClassName
)
}
}
task versionUpdater() {
def versionFilePath = "${rootDir}/uracer-desktop/src/com/bitfire/uracer/VersionInfo.java"
def versionFile = new File(versionFilePath)
if( versionName) {
println "Version is " + versionName + " (" + versionCode.toString() + ")"
println "Writing to ${versionFilePath}"
versionFile.write "package com.bitfire.uracer;\n\n" +
"public final class VersionInfo {\n" +
"\tpublic static final String versionName = \"${versionName}\";\n" +
"\tpublic static final Integer versionCode = ${versionCode};\n\n" +
"\tprivate VersionInfo() {\n\t}\n" +
"}"
} else {
println "Unknown uRacer version, this will be an unversioned build"
versionFile.delete();
}
}
sourceSets {
main {
java.srcDirs = [
'uracer-desktop/src',
'libs/src/box2dlights/box2dLight/src',
'libs/src/java-universal-tween-engine/tween-engine-api/src'
]
}
}
distributions {
main {
baseName = 'uracer-kotd'
contents {
from { 'uracer-desktop/res' }
}
}
}