-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
130 lines (107 loc) · 3.71 KB
/
build.gradle
File metadata and controls
130 lines (107 loc) · 3.71 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
buildscript {
ext.kotlin_version = '1.2.70'
ext.serialization_version = '0.6.2'
repositories {
maven {url "https://dl.bintray.com/kotlin/kotlin-eap" }
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.31"
}
}
group 'com.ps.scroller-demo'
version '1.0-SNAPSHOT'
// DEAD CODE ELIMINATION
//use plugin when building production, otherwise it slows down compiler watch
apply plugin: "kotlin-dce-js"
apply plugin: "kotlin-platform-js"
apply plugin: 'org.jetbrains.kotlin.frontend'
repositories {
maven { url "http://dl.bintray.com/kotlin/kotlin-dev" }
maven { url "https://kotlin.bintray.com/kotlin-js-wrappers" }
maven { url "https://kotlin.bintray.com/kotlinx" }
// maven { url "http://dl.bintray.com/kotlinx/kotlinx" }
jcenter()
}
dependencies {
// compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core-js:0.22.5'
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
compile 'org.jetbrains.kotlinx:kotlinx-html:0.6.8'
// compile 'org.jetbrains:kotlin-extensions:1.0.0-pre.19-kotlin-1.2.30'
compile 'org.jetbrains:kotlin-react:16.5.0-pre.54-kotlin-1.2.70'
compile 'org.jetbrains:kotlin-react-dom:16.5.0-pre.54-kotlin-1.2.70'
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
testCompile group: 'junit', name: 'junit', version: '4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
kotlinFrontend {
downloadNodeJsVersion = "9.10.1"
npm {
dependency("react")
dependency("react-dom")
dependency("react-transition-group")
// sass dependencies
dependency("mini-css-extract-plugin")
dependency("sass-loader")
dependency("node-sass")
dependency("css-loader")
dependency("svg-url-loader")
dependency("style-loader") // production dependency
dependency("uglifyjs-webpack-plugin")
dependency("optimize-css-assets-webpack-plugin")
//devDependency "karma" // development dependency
}
sourceMaps = true
webpackBundle {
bundleName = "main"
sourceMapEnabled = true
contentPath = file('src/main/web')
// publicPath = "/" // web prefix
// host = "localhost" // dev server host
port = 8003
// proxyUrl = ""// | "http://...." URL to be proxied, useful to proxy backend webserver
// stats = "errors-only" // log level
}
define "PRODUCTION", true
// karma {
// port = 9876
// runnerPort = 9100
// reporters = listOf("progress")
// frameworks = listOf("qunit") // 1
// preprocessors = listOf("...")
// }
}
// configure kotlin compiler
compileKotlin2Js {
kotlinOptions.metaInfo = true
kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js"
kotlinOptions.sourceMap = true
kotlinOptions.sourceMapEmbedSources = "always"
kotlinOptions.moduleKind = 'commonjs'
kotlinOptions.main = "call"
}
//compileTestKotlin2Js {
// kotlinOptions.metaInfo = true
// kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js"
// kotlinOptions.sourceMap = true
// kotlinOptions.moduleKind = 'commonjs'
//// kotlinOptions.moduleName = project.name + "-test"
// kotlinOptions.main = "call"
//}
//sourceSets {
// main {
// kotlin.srcDirs += "src"
// resources.srcDirs += "resources"
// output.resourcesDir = "build/js/resources"
// }
// test {
// kotlin.srcDirs += "test"
// resources.srcDirs += "testResources"
// }
//}
kotlin {
experimental {
coroutines 'enable'
}
}