Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Tutorial Development: Project Setup

Status
Not open for further replies.
  • Thread Author

Development: Project Setup​

See the bottom of the post for a quick guide.

Requirements:​

- An IDE (we recommend IntelliJ IDEA)
- A basic understanding of Java (free courses available at sites like w3schools and Codeacademy)

Project Setup:​

Open IntelliJ and start a new project:

hQrbtnN.png


Currently, we require you to use Gradle as your build system as we provide a plugin that configures your environment for you and allows you to publish your work to the Bot Store.

Set up the project as below:

- Name: The name of your project, I recommend using the lowercase version of your name appended with "-bots", eg. "party-bots"
- Location: Where your project will be located on your machine
- Create Git Repository: Off (we do recommend using a version control system to manage your code but we won't discuss that in this guide)
- Build System: Gradle (you can read more about Gradle on their website)
- JDK: The Java Development Kit version. (see more information below)
- Gradle DSL: Gradle supports two different languages for configuration. We recommend using Kotlin.
- Add sample code: Off
- Gradle distribution: Wrapper
- Gradle version: I am using 8.7 at the time of writing this article
- Group ID: Similar to Java's package convention, Gradle uses the "reverse DNS". It doesn't really matter but we recommend "com.runemate.username"
- Artifact ID: Same as project name

QBkMc7a.png


RuneMate runs on Java 17, so you should use a Java 17 JDK (I use temurin). You can have IntelliJ download one for you in the same menu:

RgSBgMK.png


404dk3U.png


When you create this project, give Gradle some time to finish configuring your environment.

Take note of the following two buttons:
- Left side: Project Browser, shows all of the files in your project.
- Right side: Gradle tool window, easy access to Gradle tasks etc.

kVdCTb0.png


Gradle Configuration​

You can see full documentation for the RuneMate Gradle Plugin on GitLab, but here's a TL;DR:
- Adds the client and API libraries to your project.
- You can use the runClient task from the Gradle tool window to launch the RuneMate client.
- You can use the submitForReview task to submit your bots to the bot store.

Replace the contents of build.gradle.kts to match the following the press the Reload All Gradle Projects button in the Gradle tool window:



You're now ready to get started writing bots for RuneMate!

You can view some sample projects here.

Quick guide:​

A sample project can be found on GitLab.
1. Open IntelliJ and select "New Project".
2. Configure a new Gradle project with the Kotlin DSL, and name it in accordance with the Gradle naming recommendations.
3. Update your build.gradle.kts to match this snippet.
4. Refresh your Gradle project and away you go!
 
Last edited:
Status
Not open for further replies.
Top