99 lines
2.2 KiB
Groovy
99 lines
2.2 KiB
Groovy
|
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.10.1'
|
||
|
|
||
|
mainClassName = 'itdelatrisu.opsu.Opsu'
|
||
|
buildDir = new File(rootProject.projectDir, "build/")
|
||
|
|
||
|
sourceCompatibility = 1.7
|
||
|
targetCompatibility = 1.7
|
||
|
|
||
|
sourceSets {
|
||
|
main {
|
||
|
java {
|
||
|
srcDir 'src'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
repositories {
|
||
|
mavenCentral()
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
compile 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
||
|
compile 'org.slick2d:slick2d-core:1.0.1'
|
||
|
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.6'
|
||
|
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
|
||
|
}
|
||
|
|
||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||
|
baseName = "opsu"
|
||
|
|
||
|
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
||
|
exclude '**/Thumbs.db'
|
||
|
}
|
||
|
|
||
|
run {
|
||
|
dependsOn 'unpackNatives'
|
||
|
}
|