2014-04-06 02:33:05 +00:00
|
|
|
/*
|
|
|
|
* Build script for the Forge version of WorldEdit
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Add ForgeGradle as a dependency for the build script
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url = "http://files.minecraftforge.net/maven" }
|
2014-05-15 18:41:26 +00:00
|
|
|
jcenter()
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
2014-05-15 18:41:26 +00:00
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:0.8'
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'forge'
|
2014-05-15 18:41:26 +00:00
|
|
|
apply plugin: 'shadow'
|
2014-04-06 02:33:05 +00:00
|
|
|
|
|
|
|
group = 'com.sk89q'
|
|
|
|
version = '6.0.0-SNAPSHOT'
|
|
|
|
archivesBaseName = "worldedit-forge"
|
|
|
|
|
|
|
|
description = "An in-game voxel map editor for Minecraft."
|
|
|
|
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
targetCompatibility = 1.6
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url "http://repo.bukkit.org/content/groups/public" }
|
|
|
|
maven { url "http://maven.sk89q.com/repo/" }
|
|
|
|
maven { url "http://repo.maven.apache.org/maven2" }
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile group: 'de.schlichtherle', name: 'truezip', version:'6.8.3'
|
|
|
|
compile group: 'rhino', name: 'js', version:'1.7R2'
|
|
|
|
compile group: 'org.yaml', name: 'snakeyaml', version:'1.9'
|
|
|
|
compile group: 'com.google.guava', name: 'guava', version:'10.0.1'
|
|
|
|
compile group: 'com.sk89q', name: 'jchronic', version:'0.2.4a'
|
|
|
|
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '1.3.9'
|
|
|
|
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
srcDir 'src/main/java'
|
|
|
|
srcDir 'src/legacy/java'
|
|
|
|
srcDir 'src/forge/java'
|
|
|
|
}
|
|
|
|
resources {
|
|
|
|
srcDir 'src/main/resources'
|
|
|
|
srcDir 'src/forge/resources'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
minecraft {
|
|
|
|
version = "1.6.4-9.11.1.964"
|
|
|
|
forgeVersion = "9.11.1.964"
|
2014-04-06 06:27:10 +00:00
|
|
|
|
2014-04-06 22:07:30 +00:00
|
|
|
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"
|
2014-04-06 06:27:10 +00:00
|
|
|
replace "%VERSION%", project.version
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
from (sourceSets.main.resources.srcDirs) {
|
|
|
|
expand 'version': project.version, 'mcVersion': project.minecraft.version,
|
|
|
|
'forgeVersion': project.minecraft.forgeVersion
|
|
|
|
include 'mcmod.info'
|
|
|
|
}
|
|
|
|
|
|
|
|
from (sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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)
|