/
build.gradle
136 lines (113 loc) · 4.39 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
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
131
132
133
134
135
136
allprojects {
group = 'io.data2viz'
}
buildscript {
repositories {
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.kordamp.gradle:stats-gradle-plugin:$stats_version"
}
}
// Report Kotlin compiler version when building project
println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION")
// --------------- Configure sub-projects with Kotlin sources ---------------
def sourceless = ['site']
static def moduleOf(project) {
def projectName = project.name
if (projectName.startsWith("d2v-")) {
return projectName.substring(4, projectName.lastIndexOf('-'))
}
else
return ""
}
static def platformOf(project) {
if (project.name.endsWith("-common")) return "common"
if (project.name.endsWith("-js")) return "js"
return "jvm"
}
static def platformLib(base, platform) {
if (platform == "jvm") return base
return "$base-$platform"
}
configure(subprojects.findAll { !sourceless.contains(it.name) }) {
def platform = platformOf(it)
apply plugin: "kotlin-platform-$platform"
repositories {
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
maven { url 'http://dl.bintray.com/data2viz/geojson-kotlin' }
}
apply plugin: 'com.jfrog.bintray'
// apply plugin: 'org.jetbrains.dokka'
// dokka {
// outputFormat = 'html'
// outputDirectory = "$buildDir/javadoc"
// }
if (project.name.endsWith('-common')) {
apply plugin: 'kotlin-platform-common'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
testCompile project(":d2v-tests-common")
}
}
if (project.name.endsWith('-js')) {
apply plugin: 'kotlin-platform-js'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
testCompile project(":d2v-tests-common")
testCompile project(":d2v-tests-js")
}
compileKotlin2Js {
kotlinOptions {
metaInfo = true
sourceMap = true
sourceMapEmbedSources = "always"
moduleKind = 'umd'
main = "call"
}
}
compileTestKotlin2Js { kotlinOptions.moduleKind = 'umd' }
}
if (project.name.endsWith('-jvm')) {
apply plugin: 'kotlin-platform-jvm'
dependencies {
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "org.testfx:testfx-core:$textfx_version"
testCompile "org.testfx:testfx-junit:$textfx_version"
testCompile project(":d2v-tests-common")
testCompile project(":d2v-tests-jvm")
testCompile 'junit:junit:4.12'
}
//for tornadoFx
compileKotlin { kotlinOptions.jvmTarget = 1.8 }
compileTestKotlin { kotlinOptions.jvmTarget = 1.8 }
test {
jvmArgs "-noverify"
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
}
}
// --------------- Configure sub-projects that are published ---------------
configure(subprojects.findAll { it.name.startsWith('d2v-') }) {
apply plugin: 'org.kordamp.gradle.stats'
apply from: rootProject.file('gradle/publish-bintray.gradle')
}
apply plugin: 'base'
task aggregateStatsReport(type: org.kordamp.gradle.stats.AggregateStatsReportTask) {}