-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
63 lines (56 loc) · 1.7 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
plugins {
id 'java'
id 'eclipse'
}
repositories {
mavenCentral()
}
// fix documentation
eclipse {
classpath {
file {
whenMerged {
def lib = entries.find { it.path.contains 'starfarer.api.jar' }
lib.javadocPath = fileReference(file('libs/starfarer.api.zip'))
lib.sourcePath = fileReference(file('libs/starfarer.api.zip'))
}
}
}
}
// project level config
sourceCompatibility = 1.7
targetCompatibility = 1.7
// build everything and make a jar
build {
doLast {
copy {
from jar
into '.'
}
}
}
// compile time dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.10'
implementation group: 'org.lwjgl.lwjgl', name: 'lwjgl', version: '2.9.3'
implementation group: 'org.lwjgl.lwjgl', name: 'lwjgl_util', version: '2.9.3'
implementation group: 'log4j', name: 'log4j', version: '1.2.9'
implementation group: 'org.json', name: 'json', version: '20170516'
implementation group: 'net.java.jinput', name: 'jinput', version: '2.0.7'
implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.7'
// test only
testImplementation 'junit:junit:4.12'
}
// create a release zip
task release(type: Zip) {
def jsonFile = file('assets/mod_info.json')
def slurper = new groovy.json.JsonSlurper()
def parsedJson = slurper.parse(jsonFile)
dependsOn build
archiveFileName = "${project.name}-${parsedJson.version}.zip"
destinationDirectory = file(rootDir)
from 'assets'
from jar
into project.name
}