Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle plugin. Don't add objectbox-kotlin dependency if it's already added #693

Closed
Zellius opened this issue Apr 17, 2019 · 2 comments

Comments

@Zellius
Copy link

commented Apr 17, 2019

Issue Basics

  • ObjectBox version: 2.3.4
  • Reproducibility: always

Reproducing the bug

Description

ObjectBox Gradle plugin keeps adding the api "io.objectbox:objectbox-kotlin" dependency even if I already added it as implementation dependency. The plugin should ignore it at this case like it does with other ObjecBox dependencies.

api - API dependencies for 'main' sources. (n)
+--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21 (n)
+--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0 (n)
+--- androidx.core:core-ktx:1.0.1 (n)
--- io.objectbox:objectbox-kotlin:2.3.4 (n)

Code

plugins {
    id("com.android.library")
    kotlin("android")
    kotlin("kapt")
}

dependencies {
    api(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
    api(kotlin("stdlib-jdk8", KotlinCompilerVersion.VERSION))

    implementation("io.objectbox:objectbox-android:2.3.4")
    implementation("io.objectbox:objectbox-kotlin:2.3.4")
    kapt("io.objectbox:objectbox-processor:2.3.4")
}

apply {
    plugin("io.objectbox")
}

I use kotlin-dsl. But I don't think that it's related to the issue.

I manually remove all ObjectBox' api dependencies by placing this code above the plugin.

configurations.getByName("api").dependencies.also { deps ->
    deps.matching {
        it.group == "io.objectbox"
    }.whenObjectAdded {
        deps.remove(this)
    }
}
@greenrobot-team greenrobot-team self-assigned this Apr 29, 2019
@greenrobot-team greenrobot-team added this to the 2.4.0 milestone Apr 29, 2019
@greenrobot-team

This comment has been minimized.

Copy link
Collaborator

commented Apr 29, 2019

Thanks, this should be fixed with the next update! -Uwe

@greenrobot

This comment has been minimized.

Copy link
Member

commented Oct 3, 2019

This is also part of the just released version '2.4.0-RC' - would be great if you could give it a try and report back. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.