Kotlin for Forge

Kotlin for Forge

73M Downloads

KotlinForForge disables minecraftLibrary configuration

switefaster opened this issue ยท 4 comments

commented

The minecraftLibrary dependency configuration and kff-3.7.1.gradle both employ lazyToken to append files to runs' classpath. However, lazyToken takes only one supplier. Thus in practice, one will always take over another's result(in my case, my dependencies are overwritten by kotlin runtimes in the classpath file). Is there any way to solve this?

commented

I don't have a great solution for you, but this works for me:
image

commented

I get the following in my runClient_minecraftClasspath.txt
image

commented

Use File.pathSeparator instead of semicolons though, since semicolons work only for Windows systems

commented

Thanks for your solution! Additionally, following code automates the process

minecraft.runs.all {
    String previous = lazyTokens['minecraft_classpath'].get()
    lazyToken('minecraft_classpath') {
        configurations.minecraftLibrary.copyRecursive().resolve().collect {
            it.absolutePath
        }.join(File.pathSeparator) + File.pathSeparator + previous
    }
}

But we need to patch kff-3.7.1.gradle somehow to make it work

repositories {
    // THIS LINE ADDED
    mavenCentral()
    maven {
        name = 'Kotlin for Forge'
        url = 'https://thedarkcolour.github.io/KotlinForForge/'
    }
}