-
Notifications
You must be signed in to change notification settings - Fork 58
/
build.gradle.kts
86 lines (68 loc) · 2.11 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
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
group = "io.kotless"
version = "0.2.0"
plugins {
id("io.gitlab.arturbosch.detekt") version ("1.15.0") apply true
kotlin("jvm") version "1.5.31" apply false
`maven-publish`
}
subprojects {
apply {
plugin("kotlin")
plugin("maven-publish")
plugin("io.gitlab.arturbosch.detekt")
}
repositories {
mavenCentral()
gradlePluginPortal()
maven(url = uri("https://packages.jetbrains.team/maven/p/ktls/maven"))
}
val sourceSets = this.extensions.getByName("sourceSets") as SourceSetContainer
task<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets["main"]!!.allSource)
}
publishing {
publications {
this.create("jarPublication", MavenPublication::class.java) {
artifactId = project.name
from (project.components.getByName("java"))
artifact(tasks["sourcesJar"])
}
}
repositories {
maven {
name = "SpacePackages"
url = uri("https://packages.jetbrains.team/maven/p/ktls/maven")
credentials {
username = System.getenv("JB_SPACE_CLIENT_ID")
password = System.getenv("JB_SPACE_CLIENT_SECRET")
}
}
}
}
tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.5"
apiVersion = "1.5"
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=kotlin.Experimental")
}
}
detekt {
parallel = true
config = rootProject.files("detekt.yml")
reports {
xml {
enabled = false
}
html {
enabled = false
}
}
}
afterEvaluate {
System.setProperty("gradle.publish.key", System.getenv("gradle_publish_key") ?: "")
System.setProperty("gradle.publish.secret", System.getenv("gradle_publish_secret") ?: "")
}
}