Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 11:00:04 +01:00
[Forge] Add dependency shading via the gradle shadow plugin.
Dieser Commit ist enthalten in:
Ursprung
38ac5c9ad1
Commit
75b9f3edaa
34
build.gradle
34
build.gradle
@ -7,16 +7,19 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url = "http://files.minecraftforge.net/maven" }
|
maven { url = "http://files.minecraftforge.net/maven" }
|
||||||
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
||||||
|
classpath 'com.github.jengelman.gradle.plugins:shadow:0.8'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
apply plugin: 'shadow'
|
||||||
|
|
||||||
group = 'com.sk89q'
|
group = 'com.sk89q'
|
||||||
version = '6.0.0-SNAPSHOT'
|
version = '6.0.0-SNAPSHOT'
|
||||||
@ -77,3 +80,34 @@ processResources {
|
|||||||
exclude 'mcmod.info'
|
exclude 'mcmod.info'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shade needed runtime dependencies
|
||||||
|
shadow {
|
||||||
|
//artifactAttached false
|
||||||
|
destinationDir "${buildDir}/libs/"
|
||||||
|
artifactSet {
|
||||||
|
include '*:jchronic:jar:'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task deleteOrig(type: Delete) {
|
||||||
|
delete "${project.tasks.jar.getArchivePath().getPath()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
task renameShaded(type: Copy) {
|
||||||
|
from file("${buildDir}/libs")
|
||||||
|
into file("${buildDir}/libs")
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace('-shadow', '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task deleteShaded(type: Delete) {
|
||||||
|
delete "${project.tasks.jar.getArchivePath().getPath().replace('.jar', '-shadow.jar')}"
|
||||||
|
}
|
||||||
|
|
||||||
|
// follow all the steps
|
||||||
|
build.dependsOn(deleteShaded)
|
||||||
|
deleteShaded.dependsOn(renameShaded)
|
||||||
|
renameShaded.dependsOn(deleteOrig)
|
||||||
|
deleteOrig.dependsOn(shadowJar)
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren