# Configuration

To apply the plugin, simply add the following to your Gradle build script (build.gradle.kts):

```kotlin
plugins {
    id("com.runemate") version "1.5.2"
}

runemate {
    devMode = true
    autoLogin = true
}
```

{% hint style="warning" %}
Be sure to check that you always have the latest version of the plugin from the [Gradle plugin portal](https://plugins.gradle.org/plugin/com.runemate).
{% endhint %}

The plugin is configured by changing properties in the **runemate** block. The full list of configuration options are below:

### Properties

<table><thead><tr><th width="224">Option</th><th width="271">Description</th><th>Default</th></tr></thead><tbody><tr><td>autoLogin</td><td>Tells the client to attempt automatic login</td><td>false</td></tr><tr><td>devMode</td><td>Tells the client to launch in developer mode</td><td>true</td></tr><tr><td>debug</td><td>Tells the client to enable debug logging</td><td>false</td></tr><tr><td>apiVersion</td><td>Tells Gradle which version of runemate-game-api to fetch from Maven</td><td><p></p><p>+ (latest)</p></td></tr><tr><td>pathfinderVersion</td><td>Tells Gradle which version of runemate-pathfinder-api to fetch from Maven</td><td>+ (latest)</td></tr><tr><td>clientVersion</td><td>Tells Gradle which version of runemate-client to fetch from Maven</td><td>+ (latest)</td></tr><tr><td>botDirectories</td><td>Tells the client which directories to scan for bots</td><td><code>$projectDir/build/libs</code> (project build directory)</td></tr><tr><td>allowExternalDependencies</td><td>Tells Gradle to allow dependency resolution for external dependencies</td><td>false</td></tr><tr><td>excludeFromSubmission</td><td>Tells Gradle to exclude the module this extension is registered to from store submission</td><td>false</td></tr><tr><td>submissionToken</td><td>The token used to authenticate when publishing your products (see Publishing to Store)</td><td>The first non-null value in order: this property value, project property <code>runemateSubmissionToken</code>, system property <code>runemateSubmissionToken</code>, environment variable <code>RUNEMATE_SUBMISSION_TOKEN</code></td></tr></tbody></table>

### Getting the correct RuneMate version

The Gradle plugin will automatically search for the latest runemate-client and runemate-game-api versions, but caching can mean that after an update it could take a long time for Gradle to recognise the new versions. There are two ways to work around this temporarily:

<details>

<summary>#1 Refresh Gradle Dependencies</summary>

* Open the Gradle tool window in IntelliJ IDEA
* Right-click on the project name
* Select "Refresh Gradle Dependencies"

<img src="https://3915496693-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRd9E855ViOcrHgpuE72h%2Fuploads%2F3M3IX7qb8UGx16edBSGC%2FgOuyeGP.png?alt=media&#x26;token=023d9253-3fa5-4905-8126-fe2408b46f45" alt="" data-size="original">

</details>

<details>

<summary>#2 Define the versions manually</summary>

In your Gradle build script (build.gradle.kts), you can declare the RuneMate library versions Gradle will use in the **runemate** configuration block:

```kotlin
runemate {
    // ... other configuration
    apiVersion = "1.2.3"
    clientVersion = "4.3.2.1"
}
```

</details>

### Launching the client

The plugin adds the `runClient` task to your Gradle project, this will launch the client using the configuration as described above. You can run this task using the Gradle tool window in IntelliJ IDEA or by running the following command:

```
./gradlew runClient
```
