Add kotlinx-html-js to kotlin/js project in intellij

640 views Asked by At

I need to add kotlinx-html-js library to a kotlin/js project created with Intellij. I've tried to add maven support and in the pom.xml file write the following:

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.cillario</groupId>
    <artifactId>Demo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <repositories>
        <repository>
            <id>jcenter</id>
            <name>jcenter</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-html-js</artifactId>
            <version>${kotlinx.html.version}</version>
        </dependency>
    </dependencies>


</project>

As explained here, but it does not work.

Can somebody help me? Thanks a lot.

1

There are 1 answers

0
s1m0nw1 On BEST ANSWER

As for Gradle, I can share with you the following working project: https://github.com/s1monw1/so_styling_webext/blob/master/build.gradle

The dependecy set looks as follows with 'kotlin-platform-js' plugin applied:

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
    compile 'org.jetbrains.kotlinx:kotlinx-html-js:0.6.8'
}