Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Compiling using gradle

Michael Zangl edited this page Aug 28, 2016 · 6 revisions

Check out the repository

git clone https://github.com/jsettlers/settlers-remake.git

Download and set up Android SDK

  • Download the Android SDK
  • Create a new file called local.properties:
sdk.dir=<path to where you put your android sdk>

Run

./gradlew run

You can also use runMapCreator to start the map creator.

In this configuration, all maps including the test maps are available to be played.

Run on your Android device:

./gradlew runAndroid

Build the release

./gradlew :assembleDist

You will find the zip files in /build/distributions

The maps in the maps/release directory are packed into the release ZIP and the Android APK package.

Using IntelliJ / Android studio

You should first follow the above steps until you can run the application.

You need to download IntelliJ IDEA or Android Studio 2.0.

Start it. When prompted about the project directory, point it to where you cloned our repository to.

You should follow our guide to set up code formatting.

Limitations / Problems

While many of our projects are compatible to Java 1.7 (thanks to Android) the tests all allow for Java 1.8 to be used. IntelliJ does not support different source compatibilities for tests and java files. Simply ignore the compatibility errors for now.

Eclipse

Download the latest eclipse for Java release.

Start eclipse. You can chose any workspace you want but I suggest you use the root directory of our git.

We recommend installing a GIT-Plugin, Checkstyle and Findbugs.

Go to File->Import.... Select Gradle Project.

Click Next until you are asked for the Project root directory. Enter the git root there.

Click Next. If JDK 1.8 is not your default JDK, you can set the Java home directory.

You can now Finish the import.

Known problems

The source version is not imported correctly by eclipse. Buildship (the Eclipse Gradle plugin) does not support this.

We do not support compiling Android using eclipse, but feel free to try ;-).