blob: 1225c4741048d2d91843d827cd388f65ccaa7f3b [file] [log] [blame] [raw]
buildscript {
dependencies {
classpath 'org.jdom:jdom2:2.0.6'
classpath 'org.ow2.asm:asm:5.1'
classpath 'org.ow2.asm:asm-commons:5.1'
classpath 'commons-io:commons-io:2.5'
classpath 'org.apache.ant:ant:1.9.7'
classpath 'org.codehaus.plexus:plexus-utils:3.0.24'
classpath 'org.vafer:jdependency:1.1'
classpath files('gradle/plugins/shadowPlugin.jar')
}
}
plugins {
id 'java'
id 'de.undercouch.download' version '3.1.1'
}
apply plugin: com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
tasks.withType(AbstractCompile) {
classpath += configurations.shadow
}
group 'protocolsupport'
version '4.26.dev'
sourceCompatibility = 1.7
import de.undercouch.gradle.tasks.download.Download
def dllibs = new File('dllibs')
dllibs.mkdirs()
/*
task updateLibs(type: Download) {
src([
'http://yivesmirror.com/files/spigot/spigot-1.11.2-R0.1-SNAPSHOT.jar',
'https://bamboo.gserv.me/artifact/GSPP-SRV/shared/build-latestSuccessful/Version-Independent-Server-JAR/glowstone.jar'
])
dest dllibs
onlyIfNewer true
overwrite true
}
*/
compileJava.dependsOn(clean)
//compileJava.dependsOn(updateLibs)
compileJava.finalizedBy(test)
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}
test {
java {
srcDirs = ['tests']
}
}
}
repositories {
mavenCentral()
}
dependencies {
//shadow files('buildprocessor/BuildProcessor.jar', new File(dllibs, 'spigot-1.11.2-R0.1-SNAPSHOT.jar'), new File(dllibs, 'glowstone.jar'))
shadow files(new File(dllibs, 'spigot-1.11.2-20170514-6e3cec8.jar'), new File(dllibs, 'glowstone-2017.6.0.jar'))
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
compile group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
shadowJar {
doFirst {
new File(destinationDir, archiveName).delete()
}
from sourceSets.main.java.srcDirs
from 'LICENSE'
minimizeJar = true
destinationDir = file('target')
archiveName = 'ProtocolSupport.jar'
exclude 'META-INF/**'
relocate 'org.apache', 'protocolsupport.libs.org.apache'
relocate 'gnu.trove', 'protocolsupport.libs.gnu.trove'
relocate 'com.google.gson', 'protocolsupport.libs.com.google.gson'
}
jar.enabled = false
jar.finalizedBy(shadowJar)