/
build.gradle.kts
86 lines (72 loc) · 2.76 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
plugins {
id("shared")
id("java-gradle-plugin")
alias(libs.plugins.buildconfig)
}
gradlePlugin {
plugins {
create("mavenPublishPlugin") {
id = "com.vanniktech.maven.publish"
implementationClass = "com.vanniktech.maven.publish.MavenPublishPlugin"
displayName = "Gradle Maven Publish Plugin"
description = "Gradle plugin that configures publish tasks to automatically upload all of your Java, Kotlin, Gradle, or Android libraries to any Maven instance."
}
create("mavenPublishBasePlugin") {
id = "com.vanniktech.maven.publish.base"
implementationClass = "com.vanniktech.maven.publish.MavenPublishBasePlugin"
displayName = "Gradle Maven Publish Base Plugin"
description = "Gradle plugin that configures publish tasks to automatically upload all of your Java, Kotlin, Gradle, or Android libraries to any Maven instance."
}
}
}
buildConfig {
packageName("com.vanniktech.maven.publish")
buildConfigField("String", "NAME", "\"com.vanniktech.maven.publish\"")
buildConfigField("String", "VERSION", "\"${project.property("VERSION_NAME")}\"")
}
val integrationTestSourceSet = sourceSets.create("integrationTest") {
compileClasspath += sourceSets["main"].output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
val integrationTestImplementation = configurations["integrationTestImplementation"]
.extendsFrom(configurations.testImplementation.get())
dependencies {
api(gradleApi())
api(libs.kotlin.stdlib)
compileOnly(libs.dokka)
compileOnly(libs.kotlin.plugin)
compileOnly(libs.android.plugin)
implementation(projects.nexus)
testImplementation(gradleTestKit())
testImplementation(libs.junit.jupiter)
testImplementation(libs.testParameterInjector)
testImplementation(libs.truth)
testImplementation(libs.truth.java8)
testImplementation(libs.truth.testKit)
testImplementation(libs.maven.model)
}
val integrationTest by tasks.registering(Test::class) {
dependsOn(
tasks.publishToMavenLocal,
projects.nexus.dependencyProject.tasks.publishToMavenLocal
)
mustRunAfter(tasks.test)
description = "Runs the integration tests."
group = "verification"
testClassesDirs = integrationTestSourceSet.output.classesDirs
classpath = integrationTestSourceSet.runtimeClasspath
useJUnitPlatform()
testLogging.showStandardStreams = true
maxHeapSize = "2g"
jvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED")
systemProperty("com.vanniktech.publish.version", project.property("VERSION_NAME").toString())
systemProperty("testConfigMethod", System.getProperty("testConfigMethod"))
beforeTest(
closureOf<TestDescriptor> {
logger.lifecycle("Running test: ${this.className} ${this.displayName}")
}
)
}
tasks.check {
dependsOn(integrationTest)
}