-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
102 lines (90 loc) · 2.33 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
val javaVersion = JavaVersion.VERSION_17
val jvmVersion = JvmTarget.JVM_17
plugins {
alias(libs.plugins.kotlinJvm)
id("com.gradle.plugin-publish") version "1.3.0"
}
group = "de.europace.gradle"
logger.lifecycle("version: $version")
val dependencyVersions = listOf(
libs.annotations,
libs.mockk,
libs.okio,
libs.okioJvm,
libs.opentest4j,
libs.slf4j
)
val dependencyVersionsByGroup = mapOf(
"net.bytebuddy" to libs.versions.byteBuddy.get(),
"org.jetbrains.kotlin" to libs.versions.kotlin.get(),
"org.jetbrains.kotlinx" to libs.versions.kotlinx.get()
)
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks {
withType<Test> {
useJUnitPlatform()
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
jvmTarget.set(jvmVersion)
freeCompilerArgs.set(listOf("-Xjsr305=strict"))
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(gradleApi())
implementation(libs.gradleDocker)
testImplementation(libs.bundles.kotest)
testImplementation(libs.mockk)
}
allprojects {
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force(dependencyVersions)
eachDependency {
val forcedVersion = dependencyVersionsByGroup[requested.group]
if (forcedVersion != null) {
useVersion(forcedVersion)
}
}
cacheDynamicVersionsFor(0, "seconds")
}
}
}
val scmUrl = "github.com/europace/docker-publish-gradle-plugin"
gradlePlugin {
website.set("https://$scmUrl")
vcsUrl.set("https://$scmUrl")
plugins {
create("dockerPublishPlugin") {
id = "de.europace.docker-publish"
displayName = "Docker Publish Plugin"
description = "Adds tasks to create and publish a Docker image to a registry"
implementationClass = "de.europace.gradle.docker.publish.DockerPublishPlugin"
tags.set(listOf("docker", "publish", "publishing"))
}
}
}
publishing {
publications {
register<MavenPublication>("dockerPublishPlugin") {
from(components["java"])
pom {
url.set("https://$scmUrl")
scm {
connection.set("scm:git:$scmUrl")
developerConnection.set("scm:git:ssh://$scmUrl")
url.set("https://$scmUrl")
}
}
}
}
}