Skip to content

Commit

Permalink
Updated Forge compilation to ForgeGradle.
Browse files Browse the repository at this point in the history
  • Loading branch information
sk89q committed Apr 6, 2014
1 parent e0a2873 commit 69797cf
Show file tree
Hide file tree
Showing 11 changed files with 467 additions and 66 deletions.
17 changes: 13 additions & 4 deletions .gitignore
@@ -1,10 +1,19 @@
/.classpath
/.project
/.settings
/target
/bin
/dependency-reduced-pom.xml
/*.iml
/eclipse
/.idea
/*.iml
/*.ipr
/*.iws

/bin
/build
/target
/gradle
/.gradle
/forge-download
/out

/dependency-reduced-pom.xml
*-private.sh
82 changes: 82 additions & 0 deletions COMPILING.md
@@ -0,0 +1,82 @@
Compiling
=========

You can (most easily) compile WorldEdit using one of the build scripts.

* **Maven** is for compiling **API**, **Bukkit**, and **Spout** versions
* **Gradle** is for the **Forge** version

The Java Development Kit is required.

* [Get JDK 7 and 8](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html)
* [Get JDK 6](http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html)

WorldEdit is written and targetted for Java 6, though you can use newer
versions (with warnings). If you plan on compiling for Forge, you **need**
at least Java 7 to be your "default" Java. (You can install several versions
of the JDK.)

Dependencies
------------

Both build scripts will download dependencies automatically. If, for some
reason, compilation fails due to a missing dependency, please notify us.

Folder Structure
----------------

Two source directories are required for compilation:

* The main source files are *src/main/java*
* Files marked for deprecation and future removal are in *src/legacy/java*

Otheriwse, files for each platform are available in different folders:

* The Bukkit implementation is located in *src/bukkit/java*
* The Spout implementation is located in *src/spout/java*
* The Forge implementation is located in *src/forge/java*

Maven
-----

**Don't have Maven?** [Download Maven](http://maven.apache.org/download.cgi)
from the Maven website.

From WorldEdit's directory, execute the following command to compile a
Bukkit version:

mvn clean package

Once done, the *target/* folder will contain a .jar file and release .zip
files.

### Other Variations

* `mvn clean package -P !bukkit` for just the API
* `mvn clean package -P !bukkit -Pspout` for the Spout version

Gradle
------

**Note:** As mentioned previously, you need Java 7 (a recent version) to
execute the following steps successfully. Your `JAVA_HOME` environment
variable needs to be set to the path of JDK 7+.

**Don't have Gradle?** Replace `gradle` with `gradlew` below, which will
automatically download a copy of Gradle for you.

From WorldEdit's directory, clean the cache first with the following
command:

gradle cleancache --refresh-dependencies

Build WorldEdit for Forge with:

gradle build

Once complete, you will find the release .jar in the folder *build/libs*.

### Other Tasks

* `gradle setupDecompWorkspace idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) workspace
* `gradle setupDecompWorkspace eclipse` will generate an [https://www.eclipse.org/downloads/](Eclipse) workspace
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -13,7 +13,7 @@ ask that you make note of the following guidelines.
methods of interfaces (Java 6+).
* **Use only spaces for indentation.** Our indents are 4-spaces long, and tabs
are unacceptable.
* **Wrap code to a 89 column limit.** We do this to make side by side diffs
* **Wrap code to a 120 column limit.** We do this to make side by side diffs
and other such tasks easier. Ignore this guideline if it makes the code
too unreadable.
* **Write complete Javadocs.** Do so only for public methods, and make sure
Expand Down
19 changes: 10 additions & 9 deletions README.md
@@ -1,33 +1,34 @@
![WorldEdit](http://static.sk89q.com/readme/worldedit.png)
=========

WorldEdit is an easy-to-use in-game world editor for Minecraft, supporting both single
player and multiplayer, that lets you:
WorldEdit is an easy-to-use in-game world editor for Minecraft, supporting both
single player and multiplayer, that lets you:

* Change thousands of blocks in an area at once by selecting regions.
* Use over 100 functions to modify the world or remove problems.
* Remove large chunks of land as you wish.
* Sculpt the world and build mountains with brushes.
* Fix annoyances such as broken water, missing snow, raging fires, and more.

WorldEdit is open source and is available under the GNU General Public License v3.
WorldEdit is open source and is available under the GNU Lesser General Public
License v3.

Compiling
---------

The project is written for Java 6 and our build process makes use of [Maven](http://maven.apache.org). Detailed compilation information [can be found on the wiki](http://wiki.sk89q.com/wiki/WorldEdit/Development#Compiling).

Dependencies are automatically handled by Maven.
See [COMPILING.md](COMPILING.md) for a guide on compiling WorldEdit.

Contributing
------------

We happily accept contributions, especially through pull requests on GitHub. Submissions
must be licensed under the GNU Lesser General Public License v3.
We happily accept contributions, especially through pull requests on GitHub.
Submissions must be licensed under the GNU Lesser General Public License v3.

Please read CONTRIBUTING.md for important guidelines to follow.

We recommend following our [mailing list](https://groups.google.com/d/forum/sk-dev-discuss), especially if you have some big ideas that you want to implement.
We recommend following our
[mailing list](https://groups.google.com/d/forum/sk-dev-discuss), especially if
you have some big ideas that you want to implement.

Links
-----
Expand Down
76 changes: 76 additions & 0 deletions build.gradle
@@ -0,0 +1,76 @@
/*
* 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" }
}

dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'forge'

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"
}

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'
}
}

0 comments on commit 69797cf

Please sign in to comment.