mirror of
https://github.com/yushijinhun/authlib-injector.git
synced 2024-11-15 06:11:09 +01:00
58 lines
1.4 KiB
Groovy
58 lines
1.4 KiB
Groovy
plugins {
|
|
id 'com.github.johnrengelman.shadow' version '4.0.0'
|
|
id 'com.palantir.git-version' version '0.11.0'
|
|
id 'java'
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
compile 'org.ow2.asm:asm:7.0'
|
|
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': 'yushijinhun',
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
|
'Automatic-Module-Name': 'moe.yushi.authlibinjector',
|
|
'Premain-Class': 'moe.yushi.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
'Agent-Class': 'moe.yushi.authlibinjector.javaagent.AuthlibInjectorPremain',
|
|
'Can-Retransform-Classes': true,
|
|
'Can-Redefine-Classes': true,
|
|
'Git-Commit': gitInfo.gitHashFull,
|
|
'Git-IsClean': gitInfo.isCleanTag,
|
|
'Build-Number': buildNumber?:'-1'
|
|
)
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
from('LICENSE') {
|
|
rename('LICENSE', 'authlib-injector.txt')
|
|
into 'META-INF/licenses'
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
classifier = null
|
|
|
|
exclude 'META-INF/maven/**'
|
|
exclude 'module-info.class'
|
|
|
|
relocate 'org.objectweb.asm', 'moe.yushi.authlibinjector.internal.org.objectweb.asm'
|
|
}
|
|
|
|
defaultTasks 'clean', 'shadowJar'
|