-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
75 lines (62 loc) · 1.72 KB
/
build.gradle
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
group 'net.ilkinulas'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.4-2'
ext.web_dir = 'web'
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"
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
clean.doFirst() {
delete("${web_dir}")
}
build.doLast() {
configurations.compile.each { File file ->
copy {
includeEmptyDirs = false
from zipTree(file.absolutePath)
into "${projectDir}/${web_dir}/lib"
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
}
}
}
copy {
File artifact = new File("build/libs/${project.name}-${project.version}.jar")
includeEmptyDirs = false
from zipTree(artifact)
into "${web_dir}"
include { fileTreeElement ->
def path = fileTreeElement.path
!(path.startsWith("META-INF/") || path.startsWith("${project.name}"))
}
}
copy {
includeEmptyDirs = false
from new File("build/classes/main")
into "${web_dir}/lib"
}
copy {
includeEmptyDirs = false
from new File("build/classes/test")
into "${web_dir}/lib"
}
copy {
includeEmptyDirs = false
from new File("build/resources/test")
into "${web_dir}"
}
}