forked from itdelatrisu/opsu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
121 lines (103 loc) · 2.74 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
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.16.0'
mainClassName = 'itdelatrisu.opsu.Opsu'
buildDir = new File(rootProject.projectDir, "build/")
def useXDG = 'false'
if (hasProperty('XDG')) {
useXDG = XDG
}
def excludeFFmpeg = false
if (hasProperty('excludeFFmpeg')) {
excludeFFmpeg = true
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceSets {
main {
java {
srcDir 'src'
}
}
}
repositories {
mavenCentral()
maven {
url "$rootProject.projectDir/repo"
}
}
dependencies {
compile('org.lwjgl.lwjgl:lwjgl:2.9.3') {
exclude group: 'net.java.jinput', module: 'jinput'
}
compile('org.slick2d:slick2d-core:1.0.2') {
exclude group: 'org.lwjgl.lwjgl', module: 'lwjgl'
exclude group: 'org.jcraft', module: 'jorbis'
exclude group: 'javax.jnlp', module: 'jnlp-api'
}
compile 'net.lingala.zip4j:zip4j:1.3.2'
compile 'com.googlecode.soundlibs:jlayer:1.0.1.4'
compile('com.googlecode.soundlibs:mp3spi:1.9.5.4') {
exclude group: 'com.googlecode.soundlibs', module: 'tritonus-share'
}
compile 'com.googlecode.soundlibs:tritonus-all:0.3.7.2'
compile 'org.xerial:sqlite-jdbc:3.15.1'
compile 'org.json:json:20160810'
compile 'net.java.dev.jna:jna:4.2.2'
compile 'net.java.dev.jna:jna-platform:4.2.2'
compile 'org.apache.maven:maven-artifact:3.3.3'
compile 'org.tukaani:xz:1.6'
compile 'net.indiespot:media:0.8.9'
}
def nativePlatforms = ['windows', 'linux', 'osx', 'all']
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'
if (excludeFFmpeg)
exclude 'ffmpeg*'
outputs.upToDateWhen { false }
}
run {
dependsOn 'unpackNatives'
}