forked from itdelatrisu/opsu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (92 loc) · 2.48 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'application'
import org.apache.tools.ant.filters.*
group = 'itdelatrisu'
version = '0.12.1'
mainClassName = 'itdelatrisu.opsu.Opsu'
buildDir = new File(rootProject.projectDir, "build/")
def useXDG = 'false'
if (hasProperty('XDG')) {
useXDG = XDG
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceSets {
main {
java {
srcDir 'src'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile('org.lwjgl.lwjgl:lwjgl:2.9.3') {
exclude group: 'net.java.jinput', module: 'jinput'
}
compile('org.slick2d:slick2d-core:1.0.1') {
exclude group: 'org.lwjgl.lwjgl', module: 'lwjgl'
}
compile 'org.jcraft:jorbis:0.0.17'
compile 'net.lingala.zip4j:zip4j:1.3.2'
compile 'com.googlecode.soundlibs:jlayer:1.0.1-1'
compile 'com.googlecode.soundlibs:mp3spi:1.9.5-1'
compile 'com.googlecode.soundlibs:tritonus-share:0.3.7-2'
compile 'org.xerial:sqlite-jdbc:3.8.10.2'
compile 'org.json:json:20140107'
compile 'net.java.dev.jna:jna:4.1.0'
compile 'net.java.dev.jna:jna-platform:4.1.0'
compile 'org.apache.maven:maven-artifact:3.3.3'
compile 'org.apache.commons:commons-compress:1.9'
compile 'org.tukaani:xz:1.5'
compile 'com.github.jponge:lzma-java:1.3'
}
def nativePlatforms = ['windows', 'linux', 'osx']
nativePlatforms.each { platform -> //noinspection GroovyAssignabilityCheck
task "${platform}Natives" {
def outputDir = "${buildDir}/natives/"
inputs.files(configurations.compile)
outputs.dir(outputDir)
doLast {
copy {
def artifacts = configurations.compile.resolvedConfiguration.resolvedArtifacts
.findAll { it.classifier == "natives-$platform" }
artifacts.each {
from zipTree(it.file)
}
into outputDir
}
}
}
}
processResources {
from 'res'
exclude '**/Thumbs.db'
filesMatching('version') {
expand(version: project.version, timestamp: new Date().format("yyyy-MM-dd HH:mm"))
}
}
task unpackNatives {
description "Copies native libraries to the build directory."
dependsOn nativePlatforms.collect { "${it}Natives" }.findAll { tasks[it] }
}
jar {
manifest {
attributes 'Implementation-Title': 'opsu!',
'Implementation-Version': version,
'Main-Class': mainClassName,
'Use-XDG': useXDG
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
baseName = "opsu"
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude '**/Thumbs.db'
outputs.upToDateWhen { false }
}
run {
dependsOn 'unpackNatives'
}