Created
October 13, 2017 10:03
-
-
Save rodesousa/155679664e7adb66f0b2ee69315b2606 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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