Skip to content

Instantly share code, notes, and snippets.

@rodesousa
Created October 13, 2017 10:03
Show Gist options
  • Select an option

  • Save rodesousa/155679664e7adb66f0b2ee69315b2606 to your computer and use it in GitHub Desktop.

Select an option

Save rodesousa/155679664e7adb66f0b2ee69315b2606 to your computer and use it in GitHub Desktop.
group 'fr.baruch'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.3'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin2js'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
}
compileKotlin2Js {
kotlinOptions.outputFile = "${projectDir}/web/output.js"
kotlinOptions.sourceMap = true
}
build.doLast {
configurations.compile.each { File file ->
copy {
includeEmptyDirs = false
from zipTree(file.absolutePath)
into "${projectDir}/web"
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment