forked from Kotlin/binary-compatibility-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
126 lines (108 loc) · 3.8 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
import com.gradle.publish.*
import kotlinx.validation.build.*
import org.jetbrains.kotlin.gradle.tasks.*
plugins {
kotlin("jvm")
`java-gradle-plugin`
id("com.gradle.plugin-publish") apply false
`signing`
`maven-publish`
}
repositories {
mavenCentral()
jcenter()
gradlePluginPortal()
}
sourceSets {
test {
java.srcDir("src/test/kotlin")
}
}
sourceSets {
create("functionalTest") {
withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet::class) {
}
resources {
srcDir(file("src/functionalTest/resources"))
}
compileClasspath += sourceSets.main.get().output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
}
tasks.register<Test>("functionalTest") {
testClassesDirs = sourceSets["functionalTest"].output.classesDirs
classpath = sourceSets["functionalTest"].runtimeClasspath
}
tasks.check { dependsOn(tasks["functionalTest"]) }
dependencies {
implementation(gradleApi())
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0")
implementation("org.ow2.asm:asm:6.0")
implementation("org.ow2.asm:asm-tree:6.0")
implementation("com.googlecode.java-diff-utils:diffutils:1.3.0")
compileOnly("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.3.61")
testImplementation(kotlin("test-junit"))
"functionalTestImplementation"("org.assertj:assertj-core:3.18.1")
"functionalTestImplementation"(gradleTestKit())
"functionalTestImplementation"(kotlin("test-junit"))
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.apply {
languageVersion = "1.3"
jvmTarget = "1.8"
allWarningsAsErrors = true
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks {
test {
systemProperty("overwrite.output", System.getProperty("overwrite.output", "false"))
systemProperty("testCasesClassesDirs", sourceSets.test.get().output.classesDirs.asPath)
jvmArgs("-ea")
}
}
properties["DeployVersion"]?.let { version = it }
val bintrayUpload = project.getSensitiveProperty("libs.bintray.upload") != null
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
mavenCentralMetadata()
mavenCentralArtifacts(project, project.sourceSets.main.get().allSource)
}
if (bintrayUpload) {
bintrayRepositoryPublishing(project, user = "kotlin", repo = "kotlinx", name = "binary-compatibility-validator")
} else {
mavenRepositoryPublishing(project)
}
mavenCentralMetadata()
}
if (!bintrayUpload) {
publications.withType(MavenPublication::class).all {
signPublicationIfKeyPresent(this)
}
}
}
apply(plugin = "org.gradle.java-gradle-plugin")
apply(plugin = "com.gradle.plugin-publish")
extensions.getByType(PluginBundleExtension::class).apply {
website = "https://github.com/Kotlin/binary-compatibility-validator"
vcsUrl = "https://github.com/Kotlin/binary-compatibility-validator"
tags = listOf("kotlin", "api-management", "binary-compatibility")
}
gradlePlugin {
testSourceSets(sourceSets["functionalTest"])
plugins {
create("binary-compatibility-validator") {
id = "org.jetbrains.kotlinx.binary-compatibility-validator"
implementationClass = "kotlinx.validation.BinaryCompatibilityValidatorPlugin"
displayName = "Binary compatibility validator"
description = "Produces binary API dumps and compares them in order to verify that binary API is preserved"
}
}
}