anvilauth-injector/build.gradle

66 lines
1.7 KiB
Groovy
Raw Normal View History

2017-08-12 16:42:31 +02:00
plugins {
2018-06-28 08:11:50 +02:00
id 'com.github.johnrengelman.shadow' version '2.0.4'
id 'com.palantir.git-version' version '0.11.0'
2017-08-12 16:42:31 +02:00
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
2018-06-28 08:11:50 +02:00
compile 'org.ow2.asm:asm:6.2'
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
2018-06-29 13:47:36 +02:00
def buildNumber = System.getenv('AI_BUILD_NUMBER')
def gitInfo = versionDetails()
2018-06-29 13:47:36 +02:00
version = '1.1.' + (buildNumber?:'0-SNAPSHOT') + '-' + gitInfo.gitHashFull[0..6]
if (!gitInfo.isCleanTag) version += '.dirty'
2017-08-12 16:42:31 +02:00
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"),
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,
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
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'
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
}
defaultTasks 'clean', 'shadowJar'