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

Could not find com.squareup.sqldelight:sqljs-driver:1.3.0. #1667

Closed
iChintanSoni opened this issue Apr 28, 2020 · 7 comments · Fixed by #2189
Closed

Could not find com.squareup.sqldelight:sqljs-driver:1.3.0. #1667

iChintanSoni opened this issue Apr 28, 2020 · 7 comments · Fixed by #2189

Comments

@iChintanSoni
Copy link

I am creating kotlin multiplatform library. I will be providing support for JVM and JS. But I am not able to include sqljs-driver. Please check my build.gradle:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:3.6.0"
        classpath "com.squareup.sqldelight:gradle-plugin:1.3.0"
    }
}

plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.72'
    id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.72'
}

repositories {
    mavenCentral()
    maven { url "https://dl.bintray.com/kotlin/ktor" }
    maven { url "https://dl.bintray.com/kotlin/kotlinx" }
}
group 'com.sample'
version '0.0.5'

apply plugin: 'com.squareup.sqldelight'
apply plugin: 'maven-publish'

sqldelight {
    MyDatabase {
        packageName = "com.sample"
    }
}

kotlin {

    def ktor_version = "1.3.2"
    def coroutine_version = "1.3.5"

    jvm()
    js {
//        browser {
//        }
        nodejs {
        }
    }

    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
                implementation("io.ktor:ktor-client-core:$ktor_version")
                implementation("io.ktor:ktor-client-json:$ktor_version")
                implementation("io.ktor:ktor-client-logging:$ktor_version")
                implementation("io.ktor:ktor-client-serialization:$ktor_version")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutine_version")

                // Coroutines for Database
                implementation("com.squareup.sqldelight:coroutines-extensions:1.3.0")
            }
        }
        commonTest {
            dependencies {
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutine_version")
            }
        }
        jvmMain {
            dependencies {
                implementation kotlin('stdlib-jdk8')
                implementation("io.ktor:ktor-client-okhttp:$ktor_version")
                implementation("io.ktor:ktor-client-json-jvm:$ktor_version")
                implementation("io.ktor:ktor-client-serialization-jvm:$ktor_version")
                implementation("io.ktor:ktor-client-logging-jvm:$ktor_version")

                // Database
                implementation("com.squareup.sqldelight:sqlite-driver:1.3.0")
            }
        }
        jvmTest {
            dependencies {
                implementation kotlin('test')
                implementation kotlin('test-junit')
            }
        }
        jsMain {
            dependencies {
                implementation kotlin('stdlib-js')
                implementation("io.ktor:ktor-client-js:$ktor_version")
                implementation("io.ktor:ktor-client-json-js:$ktor_version")
                implementation("io.ktor:ktor-client-serialization-js:$ktor_version")
                implementation("io.ktor:ktor-client-logging-js:$ktor_version")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutine_version")

                // Need below dependencies to make api calls work
                implementation(npm("text-encoding", "0.7.0"))
                implementation(npm("abort-controller", "3.0.0"))
                implementation(npm("node-fetch", "2.6.0"))

                // Database
                implementation("com.squareup.sqldelight:sqljs-driver:1.3.0")
                implementation("com.squareup.sqldelight:runtime-js:1.3.0")

                // Required to support browser
//                implementation(npm("bufferutil", "4.0.1"))
//                implementation(npm("utf-8-validate", "5.0.2"))
//                implementation(npm("node-gyp-build", "4.2.2"))
            }
        }
        jsTest {
            dependencies {
                implementation kotlin('test-js')
            }
        }
    }
}

But I am getting below error:

Could not find com.squareup.sqldelight:sqljs-driver:1.3.0.
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Don't we have sqljs driver already written? Like I am just trying to install the way mentioned in readme.md

Any help would be appreaciated! Thanks.

@JakeWharton
Copy link
Collaborator

It is not published due to limitations in our publishing infrastructure.

@thadcodes
Copy link

So it the solution to publish in your local maven repo? I assume this has a planned fix?

@JakeWharton
Copy link
Collaborator

Right now no one is working on it

@joreilly
Copy link

Are there any particular build instructions needed to build this locally?

@joreilly
Copy link

joreilly commented May 23, 2020

so, I guess not too surprisingly, it looks like following is what's needed ./gradlew :drivers:sqljs-driver:assemble. After running that I see following

./drivers/sqljs-driver/build/libs/sqljs-driver-1.4.0-SNAPSHOT.jar

Have pulled that in to project here but struggling a bit with using initSqlDriver promise to line up with general expect/actual approach being used to provide driver.

@dellisd
Copy link
Collaborator

dellisd commented Oct 26, 2020

Publishing js artifacts should be possible with the next version of the gradle-maven-publish-plugin (vanniktech/gradle-maven-publish-plugin/pull/168).

I'll open a PR here to enable that once that version is available.

@AlecKazakova
Copy link
Collaborator

AlecKazakova commented Oct 26, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

6 participants