cbeust / kobalt-intellij-plugin

An IntelliJ plug-in for Kobalt
21 stars 7 forks source link

Kobalt tasks showing up multiple times in IDE #71

Closed dittert closed 7 years ago

dittert commented 7 years ago

This bug was filed against 1.0.23.

duplicate tasks

Content of Build.kt:

import com.beust.kobalt.buildScript
import com.beust.kobalt.plugin.application.application
import com.beust.kobalt.plugin.packaging.assemble
import com.beust.kobalt.project

val bs = buildScript {
    repos()
}

val p = project {

    name = "kobalt-example"
    group = "com.example"
    artifactId = name
    version = "0.1"

    sourceDirectories {
        path("src/main/kotlin")
    }

    sourceDirectoriesTest {
        path("src/test/kotlin")
    }

    dependencies {
        compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.1")
    }

    dependenciesTest {
        compile("junit:junit:4.12")
    }

    assemble {
        jar {
        }
    }

    application {
        mainClass = "com.example.MainKt"
    }
}

These duplicates seem to be triggered by project refreshes. It doesn't happen all the time, though. I have seen the following:

It doesn't always stay at two. I have also seen three identical tasks.

dmitry-zhuravlev commented 7 years ago

Can confirm this. Also see this problem. Seems like some regression inside IDEA external API.

cbeust commented 7 years ago

@dmitry-zhuravlev Is the Kobalt server sending you these dependencies duplicated or is it an IDEA regression?

dmitry-zhuravlev commented 7 years ago

@cbeust It seems that Kobalt server for some reason sends duplicate tasks: image

I can filter it within plugin, but I think this should be fixed primarily on Kobalt side.

cbeust commented 7 years ago

Definitely looks like a bug on Kobalt side, will take a look.

-- Cédric

On Wed, Mar 29, 2017 at 5:28 AM, Dmitry Zhuravlev notifications@github.com wrote:

@cbeust https://github.com/cbeust It seems that Kobalt server for some reason sends duplicate tasks: [image: image] https://cloud.githubusercontent.com/assets/6297697/24454311/0e578704-1494-11e7-95de-aacb9213003b.png

I can filter it within plugin, but I think this should be fixed primarily on Kobalt side.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cbeust/kobalt-intellij-plugin/issues/71#issuecomment-290074376, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFoovE4Oa6teMJAutotcJFCmB9JFZ7Lks5rqk5ggaJpZM4MpBgD .

cbeust commented 7 years ago

I just took a look on the server side and I'm not seeing any duplication:

image

How can I reproduce this?

dmitry-zhuravlev commented 7 years ago

You should revert my commit first https://github.com/dmitry-zhuravlev/kobalt-intellij-plugin/commit/81defd2b21bd98fbc0e45a5808a3a9c0b5a80012

cbeust commented 7 years ago

I'm showing the server side.

On Mar 30, 2017 10:28 PM, "Dmitry Zhuravlev" notifications@github.com wrote:

You should revert my commit first dmitry-zhuravlev@81defd2 https://github.com/dmitry-zhuravlev/kobalt-intellij-plugin/commit/81defd2b21bd98fbc0e45a5808a3a9c0b5a80012

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cbeust/kobalt-intellij-plugin/issues/71#issuecomment-290619643, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFoonWaupNwLuZwCZdv8j5n4rfigu1qks5rrI8FgaJpZM4MpBgD .

pabl0rg commented 7 years ago

I also have this problem (kobalt 1.0.41, plugin 1.123, IJ 2016.3)

dmitry-zhuravlev commented 7 years ago

I'm showing the server side.

Very strange... maybe it is some serialization/deserialization issue. Anyway the problem will be solved by using Set instead of List on both sides.

dmitry-zhuravlev commented 7 years ago

Duplicates should be filtered by using Set collection.