Skip to content

FilePeek not working in MPP scenario #9

@bkahlert

Description

@bkahlert

Hey Christoph, first of all. Compliments! Your tiny little helper is amazing. Thanks to it I managed to implement some kind of JUnit-Strikt crossover where all descriptors / test names are optional:
image

Here's the problem: It doesn't work with Kotlin's MPP file layout but just be easily fixed as the code simply missed the right directory by level: namely jvm.
In my setting (Kotlin 1.4.21 and Gradle 6.8) FilePeek starts to look at

  • com.bkahlert/koodies/build/classes/kotlin/jvm/test
    FilePeek finds build/classes/kotlin so it attempts to replace build/classes/kotlin/test with relative source root candidates... which is doomed to fail because of the target dir level (jvm, js, etc).
    Consequently the replace does not take place and FilePeek continues to look in the unchanged com.bkahlert/koodies/build/classes/kotlin/jvm/test.

There is nothing that can be done on the configuration side by what I can see. Providing source roots does not help because the when block

 val buildDir = when {
            classFilePath.contains("${FS}out${FS}") -> "out${FS}test${FS}classes" // running inside IDEA
            classFilePath.contains("build${FS}classes${FS}java") -> "build${FS}classes${FS}java${FS}test" // gradle 4.x java source
            classFilePath.contains("build${FS}classes${FS}kotlin") -> "build${FS}classes${FS}kotlin${FS}test" // gradle 4.x kotlin sources
            classFilePath.contains("target${FS}classes") -> "target${FS}classes" // maven
            else -> "build${FS}classes${FS}test" // older gradle
        }

does to finish with a valid search pattern for the replacement.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions