kobalt-intellij-plugin
kobalt-intellij-plugin copied to clipboard
Project is detached when there is a syntax error in the dependencies.
I just started playing around with kobalt
and discovered some wonky behavior when adding a dependency. For example, this is valid gradle
:
compile("org.springframework.boot:spring-boot-starter-actuator")
but it won't work with kobalt because it needs to end with either the version number or :
:
compile("org.springframework.boot:spring-boot-starter-actuator:")
Also, for me, single quotes didn't work:
compile('org.springframework.boot:spring-boot-starter-actuator:')
Everytime I made a mistake like this, a pop-up appeared saying that the modules had been detached and if I wanted to remove them. Most of the time, because I clicked on OK
because I was mostly on a rush trying to focus on figuring out what was wrong with theBuild.kt
file. This would put the project in a wonky state and the project outline would disappear.
Also, I didn't realize that repos
took a vararg, so I had something like this:
repos(xxx)
repos(yyy)
And when resolving dependencies it was always trying to use the latest repo defined. It would probably be helpful if an error was displayed informing the user of the error and how to fix it. It took me a while to figure out how to fix it.
I'll let @dmitry-zhuravlev comment on the general issue you saw but FYI, single quotes are not valid string delimiters in Kotlin, so it's expected that your build file would fail to compile if you used those.
This is a screenshot of the pop up.
Also appears after the computer hibernates and I resume working.
@dmitry-zhuravlev Can you help @uris77 ?
Hm... Usually when Build.kt
file not valid (Kotlin syntax error or dependency not found) the Kobalt server send such errors to plugin.
I tried to reproduce the mentioned problem with compile("org.springframework.boot:spring-boot-starter-actuator")
and before detach I see the following error in Messages tab:
Also appears after the computer hibernates and I resume working.
Its weird. Maybe it is not related to IDEA and Kobalt... @uris77 Maybe you have some hardware problems?
I need to replace my battery, for what its worth, I don't have this issue with gradle.
Roberto, can you upload your project to GitHub or attach it to this issue?
On Jul 13, 2017 6:42 AM, "Roberto Guerra" [email protected] wrote:
I need to replace my battery, for what its worth, I don't have this issue with gradle.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cbeust/kobalt-intellij-plugin/issues/82#issuecomment-315081350, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFoopbAraJ2nIGvHmhBvi_NYCpZ-nOpks5sNh7UgaJpZM4OUwMG .
Sure, I'll just remove some sensitive details and upload it. Thank you for your patience.
Here is the sample project https://github.com/uris77/hubspot-kobalt
@uris77 Thank you for providing the sample project. Tried to import it with Kobalt 1.0.87 and Kobalt IDEA plugin 1.128 and see no errors so far. Maybe you can provide some idea.log (Help--> Show Log in explorer) with exceptions?
I have the same problem...
I want to put external library cn.nukkit
in dependency...
Build.kt
import com.beust.kobalt.*
import com.beust.kobalt.api.*
import com.beust.kobalt.plugin.packaging.assemble
val bs = buildScript {
repos("https://repo.nukkitx.com/main/")
plugins("cn.nukkit:nukkit:1.0-SNAPSHOT")
buildFileClasspath("cn.nukkit:nukkit:1.0-SNAPSHOT")
}
val p = project {
name = "TestPlugin"
group = "tokyo.pmmp.test"
artifactId = name
version = "0.0.1"
directory = "TestPlugin"
dependencies {
compile("cn.nukkit:nukkit:1.0-SNAPSHOT")
compile("org.jetbrains.kotlin:kotlin-stdlib:1.2.21")
}
dependenciesTest {
compile("org.testng:testng:6.9.9")
}
sourceDirectories {
path("src/main/kotlin")
path("src/main/java")
}
sourceDirectoriesTest {
path("src/main/kotlin")
path("src/main/java")
}
assemble {
jar {
}
}
}