Skip to content

Commit b8ab639

Browse files
committed
Fix compilation of Kotlin Jvm projects
1 parent d17f9e6 commit b8ab639

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "dev.arbjerg"
8-
version = "1.0.13"
8+
version = "1.0.14"
99

1010
repositories {
1111
mavenCentral()

src/main/kotlin/LavalinkGradlePlugin.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.gradle.api.Plugin
55
import org.gradle.api.Project
66
import org.gradle.api.artifacts.Dependency
77
import org.gradle.api.artifacts.ProjectDependency
8+
import org.gradle.api.file.RelativePath
89
import org.gradle.api.provider.Provider
910
import org.gradle.api.publish.PublishingExtension
1011
import org.gradle.api.publish.maven.MavenPublication
@@ -117,17 +118,20 @@ private fun Project.configureTasks(serverDependency: Provider<Dependency>) {
117118
configurations.getByName("runtimeClasspath")
118119
.allDependencies
119120
.filterIsInstance<ProjectDependency>()
120-
.forEach {
121-
val project = it.dependencyProject
121+
.forEach { dependency ->
122+
val project = dependency.dependencyProject
122123
if (project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
123124
dependsOn(project.tasks.named("jvmMainClasses"))
124125
from(project.buildDir.toPath() / "classes" / "kotlin" / "jvm" / "main") {
125126
include("**/*.class")
126127
}
127128
} else {
128129
dependsOn(project.tasks.named("classes"))
129-
from(project.buildDir.toPath() / "classes" / "java" / "main") {
130-
include("**/*.class")
130+
from(project.buildDir.toPath() / "classes") {
131+
include("**/main/**/*.class")
132+
eachFile {
133+
path = path.substringAfter("main/")
134+
}
131135
}
132136
}
133137
}

0 commit comments

Comments
 (0)