forked from Kotlin/dataframe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
172 lines (151 loc) · 5.18 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.tooling.core.closure
import org.jetbrains.kotlinx.publisher.apache2
import org.jetbrains.kotlinx.publisher.developer
import org.jetbrains.kotlinx.publisher.githubRepo
import org.jmailen.gradle.kotlinter.KotlinterExtension
@Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins {
kotlin("jvm") version libs.versions.kotlin
kotlin("libs.publisher") version libs.versions.libsPublisher
kotlin("plugin.serialization") version libs.versions.kotlin
id("org.jetbrains.kotlinx.dataframe") version libs.versions.dataframe apply false
kotlin("jupyter.api") version libs.versions.kotlinJupyter apply false
id("org.jetbrains.dokka") version libs.versions.dokka
id("org.jetbrains.kotlinx.kover") version libs.versions.kover
id("org.jmailen.kotlinter") version libs.versions.ktlint
id("nl.jolanrensen.docProcessor") version libs.versions.docProcessor apply false
id("xyz.ronella.simple-git") version libs.versions.simpleGit apply false
}
val jupyterApiTCRepo: String by project
val projectName: String by project
repositories {
mavenLocal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven(jupyterApiTCRepo)
}
configurations {
testImplementation.get().extendsFrom(compileOnly.get())
}
dependencies {
api(project(":core"))
api(project(":dataframe-arrow"))
api(project(":dataframe-excel"))
api(project(":dataframe-openapi"))
api(project(":dataframe-jdbc"))
}
allprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
// Attempts to configure kotlinter for each sub-project that uses the plugin
afterEvaluate {
try {
kotlinter {
ignoreFailures = false
reporters = arrayOf("checkstyle", "plain")
experimentalRules = true
disabledRules = arrayOf(
"no-wildcard-imports",
"experimental:spacing-between-declarations-with-annotations",
"experimental:enum-entry-name-case",
"experimental:argument-list-wrapping",
"experimental:annotation",
"max-line-length",
"filename",
"comment-spacing",
"curly-spacing",
"experimental:annotation-spacing",
"no-unused-imports", // broken
)
}
} catch (_: UnknownDomainObjectException) {
logger.warn("Could not set kotlinter config on :${this.name}")
}
}
}
koverMerged {
enable()
filters {
projects {
excludes += listOf(
":examples:idea-examples:youtube",
":examples:idea-examples:titanic",
":examples:idea-examples:movies",
":examples:idea-examples",
":examples",
":plugins",
":plugins:dataframe-gradle-plugin",
":plugins:symbol-processor",
":plugins:dataframe-gradle-plugin",
)
}
}
}
group = "org.jetbrains.kotlinx"
fun detectVersion(): String {
val buildNumber = rootProject.findProperty("build.number") as String?
val versionProp = property("version") as String
return if (hasProperty("release")) {
versionProp
} else if (buildNumber != null) {
if (rootProject.findProperty("build.number.detection") == "true") {
"$versionProp-dev-$buildNumber"
} else {
error("use build.number + build.number.detection = true or release build")
}
} else {
"$versionProp-dev"
}
}
val detectVersionForTC by tasks.registering {
doLast {
println("##teamcity[buildNumber '$version']")
}
}
version = detectVersion()
println("Current DataFrame version: $version")
subprojects {
this.version = rootProject.version
}
kotlinPublications {
fairDokkaJars.set(false)
sonatypeSettings(
project.findProperty("kds.sonatype.user") as String?,
project.findProperty("kds.sonatype.password") as String?,
"dataframe project, v. ${project.version}"
)
signingCredentials(
project.findProperty("kds.sign.key.id") as String?,
project.findProperty("kds.sign.key.private") as String?,
project.findProperty("kds.sign.key.passphrase") as String?
)
pom {
githubRepo("Kotlin", "dataframe")
inceptionYear.set("2021")
licenses {
apache2()
}
developers {
developer("nikitinas", "Anatoly Nikitin", "[email protected]")
}
}
publication {
publicationName.set("api")
artifactId.set(projectName)
description.set("Data processing in Kotlin")
packageName.set(artifactId)
}
localRepositories {
maven {
url = project.file(layout.buildDirectory.dir("maven")).toURI()
}
}
}