Switch to Gradle. Use git log --follow for history.

This converts the project into a multi-module Gradle build.

By default, Git does not show history past a rename, so use git log
--follow to see further history.
This commit is contained in:
sk89q
2014-11-14 11:27:39 -08:00
parent 44559cde68
commit 7192780251
714 changed files with 333 additions and 834 deletions

View File

@@ -1,76 +1,42 @@
Compiling
=========
You can (most easily) compile WorldEdit using one of the build scripts.
You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 7 or newer. You only need one version of JDK installed.
* **Maven** is for compiling **API**, **Bukkit**, and **Spout** versions
* **Gradle** is for the **Forge** version
The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with three modules:
WorldEdit is written and targetted for Java 6, but you can use newer
versions of Java to compile WorldEdit, though the compiler will give
you warnings. However, if you plan on compiling for Forge, you have
no choice in the matter and you **must** use Java 7 (make sure that it
is set as your 'default' Java too, if you have multiple versions).
* `worldedit-core` contains WorldEdit
* `worldedit-bukkit` is the Bukkit plugin
* `worldedit-forge` is the Forge mod
The Java Development Kit is required, so install the latest version
either from Oracle's website or, if you're a Linux/BSD user, you
can also try using OpenJDK.
## To compile...
* [Get Oracle JDK 7 and 8](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html)
* [Get Oracle JDK 6](http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html)
### On Windows
Dependencies
------------
1. Shift + right click the folder with WorldEdit's files and click "Open command prompt".
2. `gradlew clean setupDecompWorkspace`
3. `gradlew build`
WorldEdit requires several other dependencies, but thankfully, the build
scripts provided will automatically download these for you. If, for some
reason, compilation fails due to a missing dependency, please notify us.
### On Linux, BSD, or Mac OS X
Maven
-----
1. In your terminal, navigate to the folder with WorldEdit's files (`cd /folder/of/worldedit/files`)
2. `./gradlew clean setupDevWorkspace`
3. `./gradlew build`
**Don't have Maven?** [Download Maven](http://maven.apache.org/download.cgi)
from the Maven website.
## Then you will find...
From WorldEdit's directory, execute the following command to compile a
Bukkit version:
You will find:
mvn clean package
* The core WorldEdit API in **worldedit-core/build/libs**
* WorldEdit for Bukkit in **worldedit-bukkit/build/libs**
* WorldEdit for Forge in **worldedit-forge/build/libs**
Once done, the *target/* folder will contain a .jar file and release .zip
files.
If you want to use WorldEdit, use the `-shadow` version.
### Other Variations
(The -shadow version includes WorldEdit + necessary libraries.)
By default, the *Bukkit* profile is enabled, but you can disable it
and enable other profiles.
## Other commands
* `mvn clean package -P !bukkit` for just the API
* `mvn clean package -P !bukkit -P spout` 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 setupDecompWorkspace
gradle build
Once complete, you will find the release .jar in the folder *build/libs*.
### Other Tasks
* `gradle idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) workspace
* `gradle eclipse` will generate an [Eclipse](https://www.eclipse.org/downloads/) workspace
* `gradlew idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) module for the Forge module.
* `gradlew eclipse` will generate an [Eclipse](https://www.eclipse.org/downloads/) project for the Forge version.
* Use `setupCIWorkspace` instead of `setupDevWorkspace` if you are doing this on a CI server.