forked from allegro/axion-release-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
193 lines (172 loc) · 5.79 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
plugins {
`kotlin-dsl`
groovy
`maven-publish`
signing
jacoco
id("pl.allegro.tech.build.axion-release") version "1.15.0"
id("com.github.kt3k.coveralls") version "2.12.2"
id("com.gradle.plugin-publish") version "1.2.0"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("com.coditory.integration-test") version "1.4.5"
id("com.adarshr.test-logger") version "3.0.0"
}
scmVersion {
versionCreator("versionWithBranch")
}
group = "pl.allegro.tech.build"
version = scmVersion.version
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
repositories {
mavenCentral()
maven {
name = "ajoberstar-backup"
url = uri("https://ajoberstar.org/bintray-backup/")
}
}
/**
* no source dirs for the java compiler
* compile everything in src/ with groovy
*/
sourceSets {
main {
java { setSrcDirs(emptyList<String>()) }
withConvention(GroovySourceSet::class) {
groovy.setSrcDirs(listOf("src/main/java", "src/main/groovy"))
}
}
}
val jgitVersion = "6.5.0.202303070854-r"
val jschVersion = "0.1.55"
val jschAgentVersion = "0.0.9"
dependencies {
api(localGroovy())
runtimeOnly("org.eclipse.jgit:org.eclipse.jgit.ssh.apache:$jgitVersion")
runtimeOnly("org.eclipse.jgit:org.eclipse.jgit.ui:$jgitVersion")
runtimeOnly("org.eclipse.jgit:org.eclipse.jgit.gpg.bc:$jgitVersion")
implementation("org.eclipse.jgit:org.eclipse.jgit:$jgitVersion")
implementation("org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:$jgitVersion")
implementation("com.jcraft:jsch:$jschVersion")
implementation("com.jcraft:jsch.agentproxy.core:$jschAgentVersion")
implementation("com.jcraft:jsch.agentproxy.jsch:$jschAgentVersion")
implementation("com.jcraft:jsch.agentproxy.sshagent:$jschAgentVersion")
implementation("com.jcraft:jsch.agentproxy.pageant:$jschAgentVersion")
implementation("com.jcraft:jsch.agentproxy.usocket-jna:$jschAgentVersion")
implementation("com.jcraft:jsch.agentproxy.usocket-nc:$jschAgentVersion")
implementation("com.github.zafarkhaja:java-semver:0.9.0")
testImplementation("org.ajoberstar.grgit:grgit-core:4.1.0") {
exclude("org.eclipse.jgit", "org.eclipse.jgit.ui")
exclude("org.eclipse.jgit", "org.eclipse.jgit")
}
testImplementation("org.testcontainers:spock:1.17.6")
testImplementation("org.spockframework:spock-core:2.2-groovy-2.5")
testImplementation("cglib:cglib-nodep:3.3.0")
testImplementation("org.objenesis:objenesis:3.3")
testImplementation("org.apache.sshd:sshd-core:2.9.2")
testImplementation("org.apache.sshd:sshd-git:2.10.0")
testImplementation(gradleTestKit())
}
tasks {
withType<Test>().configureEach {
useJUnitPlatform()
}
named("check") {
dependsOn(named("test"))
dependsOn(named("integrationTest"))
}
/**
* set kotlin to depend on groovy
*/
named<AbstractCompile>("compileKotlin") {
classpath += files(sourceSets.main.get().withConvention(GroovySourceSet::class) { groovy }.classesDirectory)
}
/**
* set groovy to not depend on Kotlin
*/
named<AbstractCompile>("compileGroovy") {
classpath = sourceSets.main.get().compileClasspath
}
jacocoTestReport {
reports {
xml.required.set(true)
}
}
}
jacoco {
toolVersion = "0.8.2"
}
gradlePlugin {
testSourceSets(sourceSets.integration.get())
plugins {
create("release") {
id = "pl.allegro.tech.build.axion-release"
displayName = "axion-release-plugin"
implementationClass = "pl.allegro.tech.build.axion.release.ReleasePlugin"
}
}
}
pluginBundle {
website = "https://github.com/allegro/axion-release-plugin"
vcsUrl = "https://github.com/allegro/axion-release-plugin"
description = "Release and version management plugin."
tags = listOf("release", "version")
}
publishing {
afterEvaluate {
publications {
withType<MavenPublication> {
pom {
name.set(project.name)
description.set("Gradle release and version management plugin")
url.set("https://github.com/allegro/axion-release-plugin")
inceptionYear.set("2014")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("adamdubiel")
name.set("Adam Dubiel")
}
developer {
id.set("bgalek")
name.set("Bartosz Gałek")
}
}
scm {
url.set("https://github.com/allegro/axion-release-plugin")
connection.set("scm:[email protected]:allegro/axion-release-plugin.git")
developerConnection.set("scm:[email protected]:allegro/axion-release-plugin.git")
}
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}
if (System.getenv("GPG_KEY_ID") != null) {
signing {
useInMemoryPgpKeys(
System.getenv("GPG_KEY_ID"),
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_KEY_PASSWORD")
)
sign(publishing.publications)
}
}