2017-08-12 16:42:31 +02:00
|
|
|
plugins {
|
2018-03-31 16:09:44 +02:00
|
|
|
id 'com.github.johnrengelman.shadow' version '2.0.3'
|
2018-02-12 14:46:47 +01:00
|
|
|
id 'com.palantir.git-version' version '0.10.1'
|
2017-08-12 16:42:31 +02:00
|
|
|
id 'java'
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-03-31 16:09:44 +02:00
|
|
|
compile 'org.ow2.asm:asm:6.1.1'
|
2018-03-31 12:49:41 +02:00
|
|
|
compile 'org.nanohttpd:nanohttpd:2.3.1'
|
2017-08-12 16:42:31 +02:00
|
|
|
testCompile 'junit:junit:4.12'
|
|
|
|
}
|
|
|
|
|
2018-04-04 13:42:09 +02:00
|
|
|
sourceCompatibility = 8
|
|
|
|
|
2017-12-02 11:15:54 +01:00
|
|
|
def gitInfo = versionDetails()
|
2018-02-13 04:52:43 +01:00
|
|
|
version = '1.1.' + (System.getenv('BUILD_NUMBER')?:'0-SNAPSHOT') + '-' + gitInfo.gitHashFull[0..6]
|
2017-12-02 11:15:54 +01:00
|
|
|
if (!gitInfo.isCleanTag) version += '.dirty'
|
2017-08-12 16:42:31 +02:00
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes (
|
|
|
|
'Implementation-Title': project.name,
|
|
|
|
'Implementation-Version': version,
|
2017-12-02 11:15:54 +01:00
|
|
|
'Implementation-Vendor': 'to2mbn',
|
|
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
2018-04-04 13:42:09 +02:00
|
|
|
'Automatic-Module-Name': 'org.to2mbn.authlibinjector',
|
2018-02-17 14:39:33 +01:00
|
|
|
'Premain-Class': 'org.to2mbn.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
|
|
'Agent-Class': 'org.to2mbn.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
|
|
'Can-Retransform-Classes': true,
|
2018-04-04 13:42:09 +02:00
|
|
|
'Can-Redefine-Classes': true,
|
|
|
|
'Git-Commit': gitInfo.gitHashFull,
|
|
|
|
'Git-IsClean': gitInfo.isCleanTag
|
2017-08-12 16:42:31 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2017-08-13 11:43:13 +02:00
|
|
|
|
2018-02-12 14:46:47 +01:00
|
|
|
processResources {
|
|
|
|
from('LICENSE') {
|
|
|
|
rename('LICENSE', 'authlib-injector.txt')
|
|
|
|
into 'META-INF/licenses'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-13 11:43:13 +02:00
|
|
|
shadowJar {
|
|
|
|
classifier = null
|
2017-12-02 10:45:28 +01:00
|
|
|
|
|
|
|
exclude 'META-INF/maven/**'
|
2018-02-12 14:00:15 +01:00
|
|
|
exclude 'module-info.class'
|
2018-04-04 13:42:09 +02:00
|
|
|
|
|
|
|
// nanohttpd
|
2018-03-31 12:49:41 +02:00
|
|
|
exclude 'LICENSE.txt'
|
2018-04-04 13:42:09 +02:00
|
|
|
exclude 'fi/iki/elonen/util/**'
|
|
|
|
exclude 'META-INF/nanohttpd/mimetypes.properties'
|
2017-12-02 10:45:28 +01:00
|
|
|
|
|
|
|
relocate 'org.objectweb.asm', 'org.to2mbn.authlibinjector.internal.org.objectweb.asm'
|
2018-03-31 12:49:41 +02:00
|
|
|
relocate 'fi.iki.elonen', 'org.to2mbn.authlibinjector.internal.fi.iki.elonen'
|
2017-08-13 11:43:13 +02:00
|
|
|
}
|
2017-12-02 11:15:54 +01:00
|
|
|
|
|
|
|
defaultTasks 'clean', 'shadowJar'
|