Skip to content

Commit

Permalink
chore: add some comments and explanations to the root build files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantheleach authored and oddlama committed Feb 4, 2022
1 parent efcbff2 commit 6cfe2fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ java {
sourceCompatibility = JavaVersion.VERSION_17
}

// Common settings to all subprojects.
subprojects {
apply(plugin = "java-library")
apply(plugin = "java")
Expand Down Expand Up @@ -39,6 +40,7 @@ subprojects {
}
}

// All Paper Plugins + Annotations.
configure(subprojects.filter {
!listOf("vane-waterfall").contains(it.name)
}) {
Expand All @@ -55,6 +57,7 @@ configure(subprojects.filter {
}
}

// All Projects except waterfall and annotations.
configure(subprojects.filter {
!listOf("vane-annotations", "vane-waterfall").contains(it.name)
}) {
Expand Down Expand Up @@ -83,22 +86,32 @@ configure(subprojects.filter {
}

rootProject.tasks.runMojangMappedServer {
// the input to reobf, is the mojmapped jars.
pluginJars(tasks.named<io.papermc.paperweight.tasks.RemapJar>("reobfJar").flatMap { it.inputJar })
}

rootProject.tasks.runServer {
// the output is the obfuscated jars.
pluginJars(tasks.named<io.papermc.paperweight.tasks.RemapJar>("reobfJar").flatMap { it.outputJar })
}
}

// All paper plugins except core.
configure(subprojects.filter {
!listOf("vane-annotations", "vane-core", "vane-waterfall").contains(it.name)
}) {
dependencies {
// https://imperceptiblethoughts.com/shadow/multi-project/#depending-on-the-shadow-jar-from-another-project
// In a multi-project build there may be one project that applies Shadow and another that requires the shadowed
// JAR as a dependency. In this case, use Gradle's normal dependency declaration mechanism to depend on the
// shadow configuration of the shadowed project.
implementation(project(path = ":vane-core", configuration = "shadow"))
// But also depend on core itself.
implementation(project(path = ":vane-core"))
}
}

// All plugins with map integration
configure(subprojects.filter {
listOf("vane-bedtime", "vane-portals", "vane-regions").contains(it.name)
}) {
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pluginManagement {

rootProject.name = "vane"

// https://docs.gradle.org/current/dsl/org.gradle.api.initialization.Settings.html
// Adds the given projects to the build. Each path in the supplied list is treated as the path of a project to add to
// the build. Note that these path are not file paths, but instead specify the location of the new project in the
// project hierarchy. As such, the supplied paths must use the ':' character as separator (and NOT '/').
include(":vane-admin")
include(":vane-annotations")
include(":vane-bedtime")
Expand Down

0 comments on commit 6cfe2fb

Please sign in to comment.