Skip to content

Commit

Permalink
Fix compilation of KMP
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Aug 12, 2023
1 parent c91123f commit d17f9e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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.12"
version = "1.0.13"

repositories {
mavenCentral()
Expand Down
17 changes: 12 additions & 5 deletions src/main/kotlin/LavalinkGradlePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
import kotlin.io.path.div

private const val lavalinkExtensionName = "lavalinkPlugin"

Expand Down Expand Up @@ -117,12 +118,18 @@ private fun Project.configureTasks(serverDependency: Provider<Dependency>) {
.allDependencies
.filterIsInstance<ProjectDependency>()
.forEach {
val classes = it.dependencyProject.tasks.named("classes")
.map { classes ->
classes.taskDependencies.getDependencies(classes)
val project = it.dependencyProject
if (project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
dependsOn(project.tasks.named("jvmMainClasses"))
from(project.buildDir.toPath() / "classes" / "kotlin" / "jvm" / "main") {
include("**/*.class")
}

from(classes)
} else {
dependsOn(project.tasks.named("classes"))
from(project.buildDir.toPath() / "classes" / "java" / "main") {
include("**/*.class")
}
}
}
}

Expand Down

0 comments on commit d17f9e6

Please sign in to comment.