Skip to main content

Manage Custom SourceSets

This example project configuration shows how to add and publish a custom source set.

build.gradle
tableau {
mod {
// Mod information
modid = 'modid' // Use your own modid here.
group = 'com.example' // Use your own group here.
minecraftVersion = '1.21.3' // Or any other minecraft version.
publisher = 'SomePublisher' // Use your own name here.
url = 'https://github.com/someorg/modid' // Use your own URL here.
}

sourceSets {
api {
isPartOfPrimaryJar = true
isPublished = true

java {
srcDirs = ["src/api/java_extra"]
}

resources {
srcDirs = ["src/api/resources_extra"]
}

dependencies {
implementation 'com.google.guava:guava:30.1-jre'
}
}
}
}

This will configure an api source set with custom source directories and dependencies. This source set will be included in the primary jar file and published as a seperate jar as well.

note

You can find a full example of this project configuration in the Custom SourceSets Example on GitHub.