Skip to content

Commit

Permalink
Tweak build to collect all jars into build/libs
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Jul 9, 2021
1 parent f752edb commit 8dac164
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 18 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
java
base
kotlin("jvm") version "1.5.10" apply false

id("architectury-plugin") version "3.2-SNAPSHOT"
Expand All @@ -20,11 +20,25 @@ group = "io.github.juuxel"
version = "${project.property("mod-version")}+${project.property("minecraft-version")}"
base.archivesBaseName = "Adorn"

tasks {
val collectJars by registering(Copy::class) {
val tasks = subprojects.map { it.tasks.named("remapJar") }
dependsOn(tasks)

from(tasks)
into(buildDir.resolve("libs"))
}

assemble {
dependsOn(collectJars)
}
}

subprojects {
apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")

java {
extensions.configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
}
Expand All @@ -43,8 +57,9 @@ subprojects {
kotlinOptions.jvmTarget = "15"
}

jar {
"jar"(Jar::class) {
from(rootProject.file("LICENSE"))
archiveClassifier.set("dev-slim")
}
}
}
6 changes: 6 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ kotlinter {
disabledRules = arrayOf("parameter-list-wrapping")
}

tasks {
remapJar {
archiveClassifier.set("common")
}
}

// PLEASE REMOVE AFTEREVALUATE FROM LOOM
afterEvaluate {
tasks {
Expand Down

0 comments on commit 8dac164

Please sign in to comment.