I can’t seem to figure out how to avoid unresolved references, I’m trying to make build.gradle.kts add the dependency for mysql connector, to be used in a project with a linux server kotlin native app, js/ios/android client (native kotlin if possible though not sure if its possible). I’m following this tutorial How to Connect to MySQL Database from Kotlin using JDBC?, but anytime I try to import anything at the top of my hello world code I see red everywhere, really could use a hand, what am I missing? I’m starting to think the real problem here is Kotlin Native, but there is a lot new to me here… if kotlin native is the problem, what are my other options for this project? I’m compiling for windows ATM for simplicity, I really dislike JVM… but if that’s the best option to code in Kotlin for a linux server than I guess I need to use that instead, how would I convert this? Really confused.
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("multiplatform") version "1.3.21"
id("io.kotlintest") version "1.0.2"
}
//Defines which public repos are used to download dependencies
repositories {
jcenter()
google()
}
val implementation by configurations
val testImplementation by configurations
val testRuntimeOnly by configurations
dependencies {
//testCompile("io.kotlintest:kotlintest-core:3.0.2")
//testCompile("io.kotlintest:kotlintest-assertions:3.0.2")
//testCompile("io.kotlintest:kotlintest-runner-junit5:3.0.2")
compile(group = "mysql", name = "mysql-connector-java", version = "5.1.6")
}
kotlin {
mingwX64("server") {
binaries {
executable()
}
}
}
tasks.withType<Wrapper> {
gradleVersion = "5.3.1"
distributionType = Wrapper.DistributionType.ALL
}