2017-08-12 16:42:31 +02:00
|
|
|
plugins {
|
2021-08-20 22:16:33 +02:00
|
|
|
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
2020-04-28 18:25:34 +02:00
|
|
|
id 'com.palantir.git-version' version '0.12.3'
|
2017-08-12 16:42:31 +02:00
|
|
|
id 'java'
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-08-20 22:16:33 +02:00
|
|
|
implementation 'org.ow2.asm:asm:9.2'
|
2021-02-16 11:54:52 +01:00
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2017-08-12 16:42:31 +02:00
|
|
|
}
|
|
|
|
|
2018-04-04 13:42:09 +02:00
|
|
|
sourceCompatibility = 8
|
|
|
|
|
2018-06-29 13:47:36 +02:00
|
|
|
def buildNumber = System.getenv('AI_BUILD_NUMBER')
|
2017-12-02 11:15:54 +01:00
|
|
|
def gitInfo = versionDetails()
|
2020-06-20 15:47:06 +02:00
|
|
|
version = System.getenv('AI_VERSION_NUMBER') ?: 'snapshot';
|
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,
|
2020-08-14 14:51:39 +02:00
|
|
|
'Implementation-Version': project.version,
|
2018-06-30 17:10:55 +02:00
|
|
|
'Implementation-Vendor': 'yushijinhun',
|
2017-12-02 11:15:54 +01:00
|
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
2018-07-08 07:17:36 +02:00
|
|
|
'Automatic-Module-Name': 'moe.yushi.authlibinjector',
|
2020-08-22 10:26:22 +02:00
|
|
|
'Premain-Class': 'moe.yushi.authlibinjector.Premain',
|
|
|
|
'Agent-Class': 'moe.yushi.authlibinjector.Premain',
|
2018-02-17 14:39:33 +01:00
|
|
|
'Can-Retransform-Classes': true,
|
2018-04-04 13:42:09 +02:00
|
|
|
'Can-Redefine-Classes': true,
|
|
|
|
'Git-Commit': gitInfo.gitHashFull,
|
2018-06-28 08:03:50 +02:00
|
|
|
'Git-IsClean': gitInfo.isCleanTag,
|
|
|
|
'Build-Number': buildNumber?:'-1'
|
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
|
|
|
|
2018-07-08 07:17:36 +02:00
|
|
|
relocate 'org.objectweb.asm', 'moe.yushi.authlibinjector.internal.org.objectweb.asm'
|
2017-08-13 11:43:13 +02:00
|
|
|
}
|
2017-12-02 11:15:54 +01:00
|
|
|
|
|
|
|
defaultTasks 'clean', 'shadowJar'
|