Skip to content

Commit 5fb055a

Browse files
committed
Improved kmp dependency resolution solution that works without any hazzle
1 parent 79cbf3a commit 5fb055a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

shared/src/main/resources/projectClassPathFinder.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ allprojects { project ->
6262

6363
// handle kotlin multiplatform style dependencies if any
6464
def kotlinExtension = project.extensions.findByName("kotlin")
65-
if(kotlinExtension) {
65+
if(kotlinExtension && kotlinExtension.hasProperty("targets")) {
6666
def kotlinSourceSets = kotlinExtension.sourceSets
6767

6868
// Print the list of all dependencies jar files.
69-
kotlinSourceSets.forEach {
70-
// fetch the jar files from the current source set config (identified by their displayname, e.g, backendMain)
71-
def dependencyLocations = configurations["${it.displayName}ImplementationDependenciesMetadata"].files
72-
73-
dependencyLocations.each {
69+
kotlinExtension.targets.names.each {
70+
def classpath = configurations["${it}CompileClasspath"]
71+
classpath.files.each {
7472
System.out.println "kotlin-lsp-gradle $it"
7573
}
7674
}

0 commit comments

Comments
 (0)