Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- group 'com.beareateverything.mama'
- version '1.0-SNAPSHOT'
- buildscript {
- ext.kotlin_version = '1.1.60'
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
- }
- apply plugin: 'java'
- apply plugin: 'kotlin2js'
- sourceCompatibility = 1.8
- repositories {
- mavenCentral()
- }
- dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
- testCompile group: 'junit', name: 'junit', version: '4.12'
- }
- build.doLast {
- configurations.compile.each { File file ->
- copy {
- includeEmptyDirs = false
- from zipTree(file.absolutePath)
- into "$projectDir/public"
- include { fileTreeElement ->
- def path = fileTreeElement.path
- path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
- }
- }
- }
- copy {
- includeEmptyDirs = false
- from new File("index.html")
- into "${projectDir}/public"
- }
- ["js", "css", "images", "fonts"].each { type ->
- copy {
- includeEmptyDirs = false
- from "$type/"
- into "$projectDir/public/$type"
- }
- }
- }
- compileKotlin2Js {
- kotlinOptions.outputFile = "${projectDir}/public/output.js"
- kotlinOptions.moduleKind = "plain"
- kotlinOptions.sourceMap = true
- }
Add Comment
Please, Sign In to add comment