-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
109 lines (96 loc) · 2.94 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
plugins {
id("co.uzzu.dotenv.gradle") version "1.2.0"
id("com.gradle.plugin-publish") version "0.18.0"
`java-gradle-plugin`
`maven-publish`
kotlin("jvm") version "1.6.0"
id("com.zoltu.git-versioning") version "3.0.3"
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(gradleApi())
testImplementation(gradleTestKit())
implementation("org.yaml:snakeyaml:1.29")
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
getByName("test").java.srcDirs("src/test/kotlin")
}
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
test {
useJUnitPlatform()
}
}
val versionInfo = ZoltuGitVersioning.versionInfo
val artifactId = "gradle"
group = "nl.recognize.liquibase.validate"
version = "${versionInfo.major}.${versionInfo.minor}.${versionInfo.commitCount}"
gradlePlugin {
plugins {
register("liquibase-validate") {
id = "nl.recognize.liquibase.validate.gradle"
implementationClass = "nl.recognize.liquibase.validate.gradle.LiquibaseValidatePlugin"
}
}
}
pluginBundle {
website = "https://github.com/juulhobert/liquibase-validate"
vcsUrl = "https://github.com/juulhobert/liquibase-validate.git"
description = "A plugin for checking Liquibase changes"
tags = listOf("liquibase", "validation", "check")
(plugins) {
"liquibase-validate" {
displayName = "Gradle Liquibase validate plugin"
version = project.version.toString()
}
}
mavenCoordinates {
groupId = project.group.toString()
artifactId = "gradle"
version = project.version.toString()
}
}
publishing {
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/juulhobert/liquibase-validate")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
mavenLocal()
}
publications {
create("pluginMaven", MavenPublication::class) {
artifactId = "gradle"
}
create<MavenPublication>("default") {
from(components["java"])
}
}
}
}
if (env.PUBLISH_PRODUCTION.isPresent) {
val setPublishingSecrets by tasks.creating {
doLast {
System.setProperty("gradle.publish.key", env.GRADLE_PUBLISH_KEY.value)
System.setProperty("gradle.publish.secret", env.GRADLE_PUBLISH_SECRET.value)
}
}
tasks.getByName("publishPlugins").dependsOn(setPublishingSecrets)
}