forked from MirrorHub/authlib-injector
64 lines
1.6 KiB
Groovy
64 lines
1.6 KiB
Groovy
plugins {
|
|
id 'com.github.johnrengelman.shadow' version '2.0.3'
|
|
id 'com.palantir.git-version' version '0.10.1'
|
|
id 'java'
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
compile 'org.ow2.asm:asm:6.1.1'
|
|
compile 'org.nanohttpd:nanohttpd:2.3.1'
|
|
testCompile 'junit:junit:4.12'
|
|
}
|
|
|
|
sourceCompatibility = 8
|
|
|
|
def buildNumber = System.getenv('AI_BUILD_NUMBER')
|
|
def gitInfo = versionDetails()
|
|
version = '1.1.' + (buildNumber?:'0-SNAPSHOT') + '-' + gitInfo.gitHashFull[0..6]
|
|
if (!gitInfo.isCleanTag) version += '.dirty'
|
|
|
|
jar {
|
|
manifest {
|
|
attributes (
|
|
'Implementation-Title': project.name,
|
|
'Implementation-Version': version,
|
|
'Implementation-Vendor': 'to2mbn',
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
|
'Automatic-Module-Name': 'org.to2mbn.authlibinjector',
|
|
'Premain-Class': 'org.to2mbn.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
'Agent-Class': 'org.to2mbn.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
'Can-Retransform-Classes': true,
|
|
'Can-Redefine-Classes': true,
|
|
'Git-Commit': gitInfo.gitHashFull,
|
|
'Git-IsClean': gitInfo.isCleanTag
|
|
)
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
from('LICENSE') {
|
|
rename('LICENSE', 'authlib-injector.txt')
|
|
into 'META-INF/licenses'
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
classifier = null
|
|
|
|
exclude 'META-INF/maven/**'
|
|
exclude 'module-info.class'
|
|
|
|
// nanohttpd
|
|
exclude 'LICENSE.txt'
|
|
exclude 'fi/iki/elonen/util/**'
|
|
exclude 'META-INF/nanohttpd/mimetypes.properties'
|
|
|
|
relocate 'org.objectweb.asm', 'org.to2mbn.authlibinjector.internal.org.objectweb.asm'
|
|
relocate 'fi.iki.elonen', 'org.to2mbn.authlibinjector.internal.fi.iki.elonen'
|
|
}
|
|
|
|
defaultTasks 'clean', 'shadowJar'
|