Kotlin / kotlinx.html

Kotlin DSL for HTML
Apache License 2.0
1.63k stars 133 forks source link

Can not add this to project #195

Closed shalva97 closed 2 years ago

shalva97 commented 2 years ago

Hi. need help with dependencies... for some reason Gradle can not resolve :web:commonMain: Could not resolve org.jetbrains.kotlinx:kotlinx-html-js:0.7.5.

On the wiki there is a maven { ... } entry, which I have also added, but it just does not resolve. tried with just kotlinx-html and it sort of worked but now there is no import kotlinx.html.dom package.

Also I could not find proper docs about how to structure modules, so maybe thats what is wrong... here is what it looks like: image my idea is to add your dependency to web module.

my build file for web:

plugins {
    kotlin("multiplatform")
}

group = "com.github.shalva97"
version = "0.0.12"

kotlin {
    js {
        browser()
    }
    sourceSets {
        val commonMain by getting
    }
}
repositories {
    mavenCentral()
    maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") }
}

dependencies {
    commonMainImplementation("org.jetbrains.kotlinx:kotlinx-html:0.7.5")

    commonMainImplementation(kotlin("stdlib-js"))
    commonMainImplementation(rootProject)

}
shalva97 commented 2 years ago

fixed it by using kotlin("js") instead of multiplatform