Guest User

Untitled

a guest
Nov 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. group 'com.beareateverything.mama'
  2. version '1.0-SNAPSHOT'
  3.  
  4. buildscript {
  5. ext.kotlin_version = '1.1.60'
  6.  
  7. repositories {
  8. mavenCentral()
  9. }
  10. dependencies {
  11. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  12. }
  13. }
  14.  
  15. apply plugin: 'java'
  16. apply plugin: 'kotlin2js'
  17.  
  18. sourceCompatibility = 1.8
  19.  
  20. repositories {
  21. mavenCentral()
  22. }
  23.  
  24. dependencies {
  25. compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
  26. testCompile group: 'junit', name: 'junit', version: '4.12'
  27. }
  28.  
  29. build.doLast {
  30. configurations.compile.each { File file ->
  31. copy {
  32. includeEmptyDirs = false
  33.  
  34. from zipTree(file.absolutePath)
  35. into "$projectDir/public"
  36. include { fileTreeElement ->
  37. def path = fileTreeElement.path
  38. path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
  39. }
  40. }
  41. }
  42.  
  43. copy {
  44. includeEmptyDirs = false
  45. from new File("index.html")
  46. into "${projectDir}/public"
  47. }
  48.  
  49. ["js", "css", "images", "fonts"].each { type ->
  50. copy {
  51. includeEmptyDirs = false
  52. from "$type/"
  53. into "$projectDir/public/$type"
  54. }
  55. }
  56. }
  57.  
  58. compileKotlin2Js {
  59. kotlinOptions.outputFile = "${projectDir}/public/output.js"
  60. kotlinOptions.moduleKind = "plain"
  61. kotlinOptions.sourceMap = true
  62. }
Add Comment
Please, Sign In to add comment