forked from Kotlin/kotlin-jupyter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
179 lines (144 loc) · 5.24 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
168
169
170
171
172
173
174
175
176
177
178
179
import build.CreateResourcesTask
import build.PUBLISHING_GROUP
import build.util.getFlag
import build.util.typedProperty
import org.jetbrains.kotlinx.publisher.apache2
import org.jetbrains.kotlinx.publisher.developer
import org.jetbrains.kotlinx.publisher.githubRepo
plugins {
id("build.plugins.main")
}
val deploy: Configuration by configurations.creating
ktlint {
filter {
exclude("**/org/jetbrains/kotlinx/jupyter/repl.kt")
}
}
dependencies {
// Dependency on module with compiler.
api(projects.sharedCompiler)
// Standard dependencies
implementation(libs.kotlin.dev.reflect)
implementation(libs.jetbrains.annotations)
implementation(libs.coroutines.core)
// Embedded compiler and scripting dependencies
implementation(libs.kotlin.dev.compilerEmbeddable)
implementation(libs.kotlin.dev.scriptingCompilerImplEmbeddable)
implementation(libs.kotlin.dev.scriptingCompilerEmbeddable)
implementation(libs.kotlin.dev.scriptingIdeServices)
implementation(libs.kotlin.dev.scriptingDependenciesMavenAll)
implementation(libs.kotlin.dev.scriptUtil)
implementation(libs.kotlin.dev.scriptingCommon)
// Embedded version of serialization plugin for notebook code
implementation(libs.serialization.dev.embedded)
// Logging
implementation(libs.logging.slf4j.api)
implementation(libs.logging.logback.classic)
// Clikt library for parsing output magics
implementation(libs.clikt)
// Http4k for resolving library descriptors
implementation(libs.bundles.http4k) {
exclude(group = "org.jetbrains.kotlin")
}
// Serialization implementation for kernel code
implementation(libs.serialization.json)
// Test dependencies: kotlin-test and Junit 5
testImplementation(libs.test.junit.params)
testImplementation(libs.test.kotlintest.assertions)
deploy(projects.lib)
deploy(projects.api)
deploy(libs.kotlin.dev.scriptRuntime.get())
}
buildSettings {
withLanguageLevel(rootSettings.kotlinLanguageLevel)
withCompilerArgs {
requiresOptIn()
skipPrereleaseCheck()
samConversionsClass()
}
withTests()
}
// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}
tasks {
register("publishToPluginPortal") {
group = PUBLISHING_GROUP
dependsOn(":kotlin-jupyter-api-gradle-plugin:publishPlugins")
}
test {
val doParallelTesting = getFlag("test.parallel", true)
maxHeapSize = "3072m"
/**
* Set to true to debug classpath/shadowing issues, see testKlaxonClasspathDoesntLeak test
*/
val useShadowedJar = getFlag("test.useShadowed", false)
if (useShadowedJar) {
dependsOn(shadowJar.get())
classpath = files(shadowJar.get()) + classpath
}
systemProperties = mutableMapOf(
"junit.jupiter.displayname.generator.default" to "org.junit.jupiter.api.DisplayNameGenerator\$ReplaceUnderscores",
"junit.jupiter.execution.parallel.enabled" to doParallelTesting.toString() as Any,
"junit.jupiter.execution.parallel.mode.default" to "concurrent",
"junit.jupiter.execution.parallel.mode.classes.default" to "concurrent",
)
}
CreateResourcesTask.register(project, "addLibrariesToResources", processResources) {
addLibrariesFromDir(rootSettings.librariesDir)
}
CreateResourcesTask.register(project, "createTestResources", processTestResources) {
addSingleValueFile("PUBLISHED_JUPYTER_API_VERSION", libs.versions.jupyterApi.get())
}
publishDocs {
docsRepoUrl.set(rootSettings.docsRepo)
branchName.set("master")
username.set("robot")
email.set("robot@jetbrains.com")
}
}
changelog {
githubUser = rootSettings.githubRepoUser
githubRepository = rootSettings.githubRepoName
excludeLabels = listOf("wontfix", "duplicate", "no-changelog", "question")
customTagByIssueNumber = mapOf(
20 to "0.10.0.183",
318 to "0.10.0.183",
)
}
kotlinPublications {
defaultGroup.set("org.jetbrains.kotlinx")
defaultArtifactIdPrefix.set("kotlin-jupyter-")
fairDokkaJars.set(false)
sonatypeSettings(
typedProperty("kds.sonatype.user"),
typedProperty("kds.sonatype.password"),
"kotlin-jupyter project, v. ${project.version}",
)
signingCredentials(
typedProperty("kds.sign.key.id"),
typedProperty("kds.sign.key.private"),
typedProperty("kds.sign.key.passphrase"),
)
pom {
githubRepo("Kotlin", "kotlin-jupyter")
inceptionYear.set("2021")
licenses {
apache2()
}
developers {
developer("nikitinas", "Anatoly Nikitin", "Anatoly.Nikitin@jetbrains.com")
developer("ileasile", "Ilya Muradyan", "Ilya.Muradyan@jetbrains.com")
}
}
localRepositories {
localMavenRepository(rootSettings.artifactsDir.resolve("maven"))
}
publication {
publicationName.set("kernel")
description.set("Kotlin Jupyter kernel published as artifact")
}
}