# Advanced Builds

Using a multi-project build can be very useful for separating code destined for the store from code that you're still working on, or sharing a repository with other developers. The Gradle plugin provides some tools to support this configuration.

Each module with source code or resources needs to have the Gradle plugin applied. You can apply the plugin to all subprojects using the `subprojects` or the `allprojects` block:

```kts
subprojects {
    apply<JavaPlugin>()
    apply<RuneMatePlugin>()
}
```

#### Launching RuneMate

The `runClient` task is added to all projects with the plugin applied. If you run this task from the Gradle tool window in IDEA (or by failing to specify the project in the command line) then a client will be launched for every project. To change this behaviour, you can disable the task in each of your subprojects:

```kts
subprojects {
    tasks.runClient {
        enabled = false
    }
}
```

#### Bundling Modules

The client may fail to find manifests, bot classes or resources. You can assist it by building a JAR that contains all of your source code, manifests and resources by adding the following task to your root Gradle buildscript:

```kts
val uberJar by tasks.registering(Jar::class) {
    group = "runemate"
    dependsOn(subprojects.map { it.tasks.assemble })
    archiveBaseName.set("runemate-bots")
    subprojects.forEach {
        from(it.sourceSets.main.get().output)
        from(it.layout.buildDirectory.dir("runemate/sources/.runemate"))
    }
}

tasks.runClient {
    dependsOn(uberJar)
}
```

#### Excluding Modules

Individual modules can be excluded from the bot store submission using the `excludeFromSubmission` element of the **runemate** configuration block:

```kts
runemate {
    // ... other configuration
    excludeFromSubmission = true
}
```

This is useful when you want to separate code that you're currently working on from code that you are ready to publish to the store.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://runemate.gitbook.io/runemate-documentation/getting-started/gradle-plugin/advanced-builds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
