cbeust / kobalt

A Kotlin-based build system for the JVM.
Apache License 2.0
433 stars 60 forks source link

Error when following contributing instructions. #399

Closed kyonifer closed 7 years ago

kyonifer commented 7 years ago

When following the instructions here I end up with the error:

*****
***** ERROR Couldn't compile file: import com.beust.kobalt.*
/tmp/3234575069172904606.kt:1:12 Unresolved reference: beust
*****
com.beust.kobalt.KobaltException: Couldn't compile file: import com.beust.kobalt.*
/tmp/3234575069172904606.kt:1:12 Unresolved reference: beust
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler$compilerAction$1$invokeCompilerDirectly$collector$1.report(KotlinCompiler.kt:209)
    at org.jetbrains.kotlin.cli.common.messages.GroupingMessageCollector.flush(GroupingMessageCollector.java:72)
    at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:221)
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler$compilerAction$1$invokeCompilerDirectly$result$duration$1.invoke(KotlinCompiler.kt:227)
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler$compilerAction$1$invokeCompilerDirectly$result$duration$1.invoke(KotlinCompiler.kt:40)
    at com.beust.kobalt.misc.BenchmarksKt.benchmarkMillis(Benchmarks.kt:5)
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler$compilerAction$1.invokeCompilerDirectly(KotlinCompiler.kt:226)
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler$compilerAction$1.compile(KotlinCompiler.kt:93)
    at com.beust.kobalt.internal.JvmCompiler.doCompile(JvmCompiler.kt:37)
    at com.beust.kobalt.plugin.kotlin.KotlinCompiler.compile(KotlinCompiler.kt:392)
    at com.beust.kobalt.plugin.kotlin.KConfiguration.compile(KotlinCompiler.kt:418)
    at com.beust.kobalt.plugin.kotlin.KConfiguration.compile$default(KotlinCompiler.kt:415)
    at com.beust.kobalt.app.BuildFileCompiler.maybeCompileBuildFile(BuildFileCompiler.kt:165)
    at com.beust.kobalt.app.BuildFiles.parseBuildScriptInfos(BuildFiles.kt:200)
    at com.beust.kobalt.app.BuildFiles.parseBuildFiles(BuildFiles.kt:57)
    at com.beust.kobalt.app.BuildFileCompiler.findProjects(BuildFileCompiler.kt:99)
    at com.beust.kobalt.app.BuildFileCompiler.compileBuildFiles(BuildFileCompiler.kt:73)
    at com.beust.kobalt.app.BuildFileCompiler.compileBuildFiles$default(BuildFileCompiler.kt:47)
    at com.beust.kobalt.app.ProjectFinder.initForBuildFile(ProjectFinder.kt:20)
    at com.beust.kobalt.Options.run(Options.kt:49)
    at com.beust.kobalt.Main.runWithArgs(Main.kt:128)
    at com.beust.kobalt.Main.run(Main.kt:109)
    at com.beust.kobalt.Main$Companion.launchMain(Main.kt:63)
    at com.beust.kobalt.Main$Companion.mainNoExit(Main.kt:42)
    at com.beust.kobalt.MainKt.main(Main.kt:20)
Couldn't compile file: import com.beust.kobalt.*
/tmp/3234575069172904606.kt:1:12 Unresolved reference: beust

Steps to reproduce: 1) Clone a fresh copy of kobalt to projects/kobalt 2) Make a empty folder called projects/something 3) Initialize a new project in the empty folder: cd projects/something && ../kobalt/kobaltw -i kotlin && ./kobaltw --update 4) open projects/kobalt in intellij, and follow the instructions on the aforementioned page. In particular, make a new run configuration, populate it with com.beust.kobalt.MainKt and assemble --log 2. For the working dir, set it to projects/something. 5) Trying to run the new configuration, and I hit the above error.

edit: Also change the version in resources/kobalt.properties to something like 9.0.58, as instructed. Without that step it doesnt happen.

cbeust commented 7 years ago

What's missing in the doc (which I'm updating) is adding the Kobalt dependency to your build file:

    dependencies {
        compile("com.beust:kobalt:")
    }