Only shade the Mixin lib itself not all of its dependencies
This commit is contained in:
19
build.gradle
19
build.gradle
@@ -26,6 +26,7 @@ archivesBaseName = "replaymod"
|
|||||||
ext {
|
ext {
|
||||||
mixinSrg = new File(project.buildDir, 'tmp/mixins/mixins.srg')
|
mixinSrg = new File(project.buildDir, 'tmp/mixins/mixins.srg')
|
||||||
mixinRefMap = new File(project.buildDir, 'tmp/mixins/mixins.replaymod.refmap.json')
|
mixinRefMap = new File(project.buildDir, 'tmp/mixins/mixins.replaymod.refmap.json')
|
||||||
|
libFiles = fileTree(dir: 'libs', includes: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
@@ -47,16 +48,12 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
|
||||||
shade
|
|
||||||
compile.extendsFrom shade
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'org.projectlombok:lombok:1.16.4'
|
compile 'org.projectlombok:lombok:1.16.4'
|
||||||
|
|
||||||
shade 'org.spongepowered:mixin:0.4.3'
|
compile 'org.spongepowered:mixin:0.4.3'
|
||||||
shade fileTree(dir: 'libs', includes: ['*.jar'])
|
compile libFiles
|
||||||
|
|
||||||
// you may put jars on which you depend on in ./libs
|
// you may put jars on which you depend on in ./libs
|
||||||
// or you may define them like so..
|
// or you may define them like so..
|
||||||
//compile "some.group:artifact:version:classifier"
|
//compile "some.group:artifact:version:classifier"
|
||||||
@@ -73,15 +70,17 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
dependsOn configurations.shade
|
dependsOn configurations.compile
|
||||||
|
|
||||||
from project.mixinRefMap
|
from project.mixinRefMap
|
||||||
|
|
||||||
|
def shade = {libFiles + files(configurations.compile.find { it.name.startsWith("mixin-") })}
|
||||||
|
|
||||||
def noticeDir = file("$buildDir/NOTICE")
|
def noticeDir = file("$buildDir/NOTICE")
|
||||||
doFirst {
|
doFirst {
|
||||||
noticeDir.deleteDir()
|
noticeDir.deleteDir()
|
||||||
noticeDir.mkdirs()
|
noticeDir.mkdirs()
|
||||||
configurations.shade.collect { it.isDirectory() ? fileTree(it) : zipTree(it) }.each {
|
shade().collect { it.isDirectory() ? fileTree(it) : zipTree(it) }.each {
|
||||||
it.matching { include '**/NOTICE*' }.each {
|
it.matching { include '**/NOTICE*' }.each {
|
||||||
new File(noticeDir, 'NOTICE.txt') << it.getText('UTF-8') + '\n'
|
new File(noticeDir, 'NOTICE.txt') << it.getText('UTF-8') + '\n'
|
||||||
}
|
}
|
||||||
@@ -108,7 +107,7 @@ jar {
|
|||||||
}
|
}
|
||||||
from langDir
|
from langDir
|
||||||
|
|
||||||
from (configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }) {
|
from ({shade().collect { it.isDirectory() ? it : zipTree(it) }}) {
|
||||||
exclude '**/NOTICE*'
|
exclude '**/NOTICE*'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user