-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
53 lines (45 loc) · 1.09 KB
/
Copy pathbuild.gradle
File metadata and controls
53 lines (45 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
buildscript {
ext {
kotlinVersion = "1.1.3-2"
kodeinVersion = "4.1.0"
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
group = "me.ccampo"
version = "0.1.0"
apply plugin: "kotlin2js"
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion"
//compile "com.github.salomonbrys.kodein:kodein-js:$kodeinVersion"
}
compileKotlin2Js {
kotlinOptions.metaInfo = true
kotlinOptions.outputFile = "$project.buildDir.path/web/lib/nbody.js"
kotlinOptions.sourceMap = true
kotlinOptions.main = "call"
}
build.doLast {
configurations.compile.each { File file ->
copy {
includeEmptyDirs = false
from zipTree(file.absolutePath)
into "${project.buildDir}/web/lib"
include { fileTreeElement ->
final path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
}
}
}
copy {
from "src/main/webapp"
into "${project.buildDir}/web"
}
}