2014-04-06 10:33:05 +08:00
|
|
|
/*
|
|
|
|
* Build script for the Forge version of WorldEdit
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Add ForgeGradle as a dependency for the build script
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2014-10-13 03:27:51 +08:00
|
|
|
maven {
|
|
|
|
name = "forge"
|
|
|
|
url = "http://files.minecraftforge.net/maven"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "sonatype"
|
|
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
|
|
}
|
2014-05-16 02:41:26 +08:00
|
|
|
jcenter()
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2014-10-13 03:27:51 +08:00
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1'
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'forge'
|
2014-10-13 03:27:51 +08:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2014-04-06 10:33:05 +08:00
|
|
|
|
|
|
|
group = 'com.sk89q'
|
2014-07-19 05:09:33 +08:00
|
|
|
version = '6.0.0-SNAPSHOT' + System.getProperty("worldedit.build.suffix", "")
|
2014-04-06 10:33:05 +08:00
|
|
|
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'
|
2014-06-28 07:03:29 +08:00
|
|
|
compile group: 'com.thoughtworks.paranamer', name: 'paranamer', version: '2.6'
|
2014-07-13 09:38:30 +08:00
|
|
|
compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
|
2014-07-28 17:35:30 +08:00
|
|
|
compile group: 'com.sk89q.lib', name: 'jlibnoise', version: '1.0.0'
|
2014-07-24 07:20:43 +08:00
|
|
|
//compile group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3'
|
2014-04-06 10:33:05 +08:00
|
|
|
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 {
|
2014-10-13 03:27:51 +08:00
|
|
|
ext.forgeVersion = "10.13.1.1225"
|
|
|
|
version = "1.7.10-$forgeVersion"
|
2014-04-06 14:27:10 +08:00
|
|
|
|
2014-04-07 06:07:30 +08:00
|
|
|
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"
|
2014-04-06 14:27:10 +08:00
|
|
|
replace "%VERSION%", project.version
|
2014-04-06 10:33:05 +08: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-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// shade needed runtime dependencies
|
2014-10-13 03:27:51 +08:00
|
|
|
shadowJar {
|
|
|
|
classifier 'shadow'
|
|
|
|
dependencies {
|
|
|
|
include(dependency('com.sk89q:jchronic:0.2.4a'))
|
|
|
|
include(dependency('com.thoughtworks.paranamer:paranamer:2.6'))
|
|
|
|
include(dependency('com.sk89q.lib:jlibnoise:1.0.0'))
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
2014-10-13 03:27:51 +08:00
|
|
|
exclude 'GradleStart**'
|
|
|
|
exclude '.cache'
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
2014-10-13 03:27:51 +08:00
|
|
|
// ensure reobf happens
|
|
|
|
reobf.reobf(shadowJar) { spec ->
|
|
|
|
spec.classpath = sourceSets.main.compileClasspath;
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
2014-10-13 03:27:51 +08:00
|
|
|
task deleteOrig(type: Delete) {
|
|
|
|
delete project.tasks.jar.archivePath.getPath()
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task deleteShaded(type: Delete) {
|
2014-10-13 03:27:51 +08:00
|
|
|
delete project.tasks.shadowJar.archivePath.getPath()
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
2014-10-13 03:27:51 +08:00
|
|
|
shadowJar.dependsOn(deleteShaded)
|
|
|
|
build.dependsOn(shadowJar)
|