Skip to content

Commit

Permalink
Fix compilation of Kotlin Jvm projects
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Aug 12, 2023
1 parent d17f9e6 commit b8ab639
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "dev.arbjerg"
version = "1.0.13"
version = "1.0.14"

repositories {
mavenCentral()
Expand Down
12 changes: 8 additions & 4 deletions src/main/kotlin/LavalinkGradlePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.RelativePath
import org.gradle.api.provider.Provider
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
Expand Down Expand Up @@ -117,17 +118,20 @@ private fun Project.configureTasks(serverDependency: Provider<Dependency>) {
configurations.getByName("runtimeClasspath")
.allDependencies
.filterIsInstance<ProjectDependency>()
.forEach {
val project = it.dependencyProject
.forEach { dependency ->
val project = dependency.dependencyProject
if (project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
dependsOn(project.tasks.named("jvmMainClasses"))
from(project.buildDir.toPath() / "classes" / "kotlin" / "jvm" / "main") {
include("**/*.class")
}
} else {
dependsOn(project.tasks.named("classes"))
from(project.buildDir.toPath() / "classes" / "java" / "main") {
include("**/*.class")
from(project.buildDir.toPath() / "classes") {
include("**/main/**/*.class")
eachFile {
path = path.substringAfter("main/")
}
}
}
}
Expand Down

0 comments on commit b8ab639

Please sign in to comment.