-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
96 lines (80 loc) · 2.13 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
plugins {
// use launch4j to build a native .exe for Windows
id 'edu.sc.seis.launch4j' version '2.4.4'
}
// java plugin is required for e.g. compilation, the application plugin is used to execute the game via gradle
apply plugin: 'java'
apply plugin: 'application'
// give your project a name
archivesBaseName = "SERVUS BONUS"
version = "v1.0.0"
targetCompatibility = "1.8.0"
mainClassName = "de.gurkenlabs.ldjam44.Program"
repositories {
mavenCentral()
}
dependencies {
compile project(':litiengine')
}
sourceSets {
main.java.srcDir "src"
main.resources.srcDirs = ["sprites", "audio", "maps", "misc"]
}
jar {
// include everything from the litiengine and referenced libraries in the jar
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude 'META-INF/services/**'
}
// make sure to only include service providers from the litiengine when directly referencing the project
from ("${project(':litiengine').projectDir}/resources/") {
include 'META-INF/services/**'
}
// exclude the natives: they will be included in the distribution archive
exclude '**/*.dll'
exclude '**/*.jnilib'
exclude '**/*.dylib'
exclude '**/*.so'
exclude 'junit**/**'
from 'game.litidata'
manifest {
attributes 'Class-Path': '.',
'Main-Class': mainClassName
}
}
launch4j {
mainClassName = mainClassName
icon = 'game.ico'
outputDir = 'libs'
outfile = archivesBaseName +'.exe'
companyName = 'gurkenlabs.de'
version = '1.0.0'
textVersion = '1.0.0'
copyright = '2019 gurkenlabs.de'
bundledJrePath = 'jre'
jvmOptions = ['-Xms256m', '-Xmx1024m']
cmdLine = '-release'
}
task copyDistributionFiles(type: Copy) {
def buildFolder = new File(buildDir, 'libs')
from('litiengine/build/libs') {
include '**/*'
exclude '**/*.jar'
exclude '**/*.zip'
exclude 'LICENSE'
exclude 'lib/**'
}
from('dist'){
include 'game.ico'
include 'config.properties'
include 'jre/**'
}
into buildFolder
}
build.dependsOn copyDistributionFiles