-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle.kts
86 lines (72 loc) · 2.03 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
/*
* Copyright 2016-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
plugins {
kotlin("jvm")
`java-gradle-plugin`
`maven-publish`
signing
id("org.jetbrains.kotlinx.binary-compatibility-validator")
id("me.champeau.jmh") version "0.6.7"
id("org.jetbrains.kotlinx.kover") version "0.6.0"
}
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}
dependencies {
implementation("com.google.protobuf:protobuf-java:2.6.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlin:kotlin-metadata-jvm:2.0.20")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("junit:junit:4.13.1")
jmh("org.jetbrains.kotlin:kotlin-reflect:1.7.10")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.compileKotlin {
compilerOptions {
freeCompilerArgs.addAll(listOf("-no-reflect"))
}
}
kotlin {
explicitApi()
jvmToolchain(8)
}
kover {
verify {
rule {
bound {
minValue = 75
}
}
}
}
val deployVersion = properties.get("DeployVersion")?.toString() ?: version.toString()
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
groupId = "org.jetbrains.kotlinx"
artifactId = "kotlinx.reflect.lite"
version = deployVersion
configureMavenCentralMetadata()
mavenCentralArtifacts(project, project.sourceSets.main.get().allSource)
}
version = deployVersion
mavenRepositoryPublishing(project)
configureMavenCentralMetadata()
}
publications.withType(MavenPublication::class).all {
signPublicationIfKeyPresent(this)
}
establishSignDependencies()
}
fun Project.establishSignDependencies() {
tasks.withType<AbstractPublishToMaven>().configureEach {
dependsOn(tasks.withType<Sign>())
}
}