-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
build.gradle.kts
167 lines (156 loc) · 7.83 KB
/
build.gradle.kts
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
plugins {
val kotlinVersion: String by System.getProperties()
kotlin("plugin.serialization") version kotlinVersion
kotlin("js")
id("maven-publish")
id("signing")
id("de.marcphilipp.nexus-publish")
id("org.jetbrains.dokka")
}
allprojects {
repositories()
version = project.properties["versionNumber"]!!
if (hasProperty("SNAPSHOT")) {
version = "$version-SNAPSHOT"
}
}
// Versions
val kotlinVersion: String by System.getProperties()
val serializationVersion: String by project
val coroutinesVersion: String by project
val snabbdomKotlinVersion: String by project
// Custom Properties
val webDir = file("src/main/web")
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
lockFileDirectory = project.rootDir.resolve(".kotlin-js-store")
}
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().apply {
versions.webpackDevServer.version = "4.7.3"
versions.webpack.version = "5.66.0"
versions.webpackCli.version = "4.9.1"
versions.karma.version = "6.3.11"
}
}
kotlin {
kotlinJsTargets()
}
dependencies {
api(project(":kvision-modules:kvision-common-types"))
api("org.jetbrains.kotlinx:kotlinx-serialization-json-js:$serializationVersion")
// for local development
// implementation(npm("kvision-assets", "http://localhost:8001/kvision-assets-5.0.0.tgz"))
implementation(npm("kvision-assets", "^5.0.8"))
implementation(npm("css-loader", "^6.5.1"))
implementation(npm("style-loader", "^3.3.1"))
implementation(npm("imports-loader", "^3.1.1"))
implementation(npm("fecha", "^4.2.1"))
implementation(npm("snabbdom", "^3.2.0"))
implementation(npm("@rjaros/snabbdom-virtualize", "^1.0.0-beta.5"))
implementation(npm("split.js", "^1.6.5"))
implementation(npm("@rjaros/gettext.js", "^1.1.3"))
implementation(npm("gettext-extract", "^2.0.1"))
testImplementation(kotlin("test-js"))
testImplementation(project(":kvision-modules:kvision-testutils"))
}
val sourcesJar by tasks.registering(Jar::class) {
dependsOn("irGenerateExternalsIntegrated")
archiveClassifier.set("sources")
from(kotlin.sourceSets.main.get().kotlin)
}
val javadocJar by tasks.registering(Jar::class) {
dependsOn("dokkaHtml")
archiveClassifier.set("javadoc")
from("$buildDir/dokka/html")
}
publishing {
publications {
create<MavenPublication>("kotlin") {
from(components["kotlin"])
artifact(tasks["sourcesJar"])
if (!hasProperty("SNAPSHOT")) artifact(tasks["javadocJar"])
pom {
defaultPom()
}
}
}
}
setupSigning()
setupPublication()
tasks.dokkaHtml.configure {
dokkaSourceSets {
named("main") {
suppress.set(true)
}
register("kvision") {
includes.from("Module.md")
displayName.set("js")
platform.set(org.jetbrains.dokka.Platform.js)
includeNonPublic.set(false)
skipDeprecated.set(false)
reportUndocumented.set(false)
sourceRoots.from(file("src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-css/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-datetime/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-dialog/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-icons/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-select/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-select-remote/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-spinner/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-typeahead/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-bootstrap-upload/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-chart/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-common-remote/src/jsMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-common-types/src/jsMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-cordova/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-datacontainer/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-electron/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-fontawesome/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-handlebars/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-i18n/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-jquery/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-maps/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-moment/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-onsenui/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-pace/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-react/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-redux/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-rest/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-richtext/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-routing-navigo-ng/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-server-ktor/src/jsMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-simple-select-remote/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-state/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-state-flow/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-tabulator/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-tabulator-remote/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-testutils/src/main/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-toast/src/main/kotlin"))
}
register("kvision-common") {
includes.from("Module.md")
displayName.set("common")
platform.set(org.jetbrains.dokka.Platform.common)
includeNonPublic.set(false)
skipDeprecated.set(false)
reportUndocumented.set(false)
sourceRoots.from(file("kvision-modules/kvision-common-annotations/src/commonMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-common-remote/src/commonMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-common-types/src/commonMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-server-ktor/src/commonMain/kotlin"))
}
register("kvision-jvm") {
includes.from("Module.md")
displayName.set("jvm")
platform.set(org.jetbrains.dokka.Platform.jvm)
includeNonPublic.set(false)
skipDeprecated.set(false)
reportUndocumented.set(false)
sourceRoots.from(file("kvision-modules/kvision-common-remote/src/jvmMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-common-types/src/jvmMain/kotlin"))
sourceRoots.from(file("kvision-modules/kvision-server-ktor/src/jvmMain/kotlin"))
}
}
}