forked from IBM/cics-bundle-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (98 loc) · 3.08 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
/*
* #%L
* CICS Bundle Gradle Plugin
* %%
* Copyright (C) 2019 IBM Corp.
* %%
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
* #L%
*/
plugins {
id("groovy")
id("java-gradle-plugin")
id("maven-publish")
id("com.gradle.plugin-publish") version "0.20.0"
id("signing")
`kotlin-dsl`
}
group = "com.ibm.cics"
version = "1.0.4-SNAPSHOT"
val isReleaseVersion by extra(!version.toString().endsWith("SNAPSHOT"))
gradlePlugin {
plugins {
register("com.ibm.cics.bundle") {
id = "com.ibm.cics.bundle"
displayName = "CICS Bundle Gradle Plugin"
description = "A Gradle plugin to build CICS bundles, including external dependencies."
implementationClass = "com.ibm.cics.cbgp.BundlePlugin"
}
}
}
pluginBundle {
website = "https://github.com/IBM/cics-bundle-gradle"
vcsUrl = "https://github.com/IBM/cics-bundle-gradle"
tags = listOf("cics", "cicsts", "cicsbundle", "cics-bundle")
}
val ossrhUser: String? by project
val ossrhPassword: String? by project
signing {
setRequired { !gradle.taskGraph.hasTask(":publishToMavenLocal") }
val signingKeyId: String? by project
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}
publishing {
repositories {
if (isReleaseVersion) {
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = ossrhUser
password = ossrhPassword
}
}
} else {
maven {
name = "SonatypeSnapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
credentials {
username = ossrhUser
password = ossrhPassword
}
}
}
}
}
repositories {
maven {
name = "SonatypeSnapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
mavenCentral()
}
defaultTasks("build")
dependencies {
implementation("com.ibm.cics:cics-bundle-common:1.0.4")
testImplementation("junit:junit:4.13.2")
testImplementation("com.github.tomakehurst:wiremock-jre8:2.32.0")
testImplementation(enforcedPlatform("org.spockframework:spock-bom:2.0-groovy-3.0"))
testImplementation("org.spockframework:spock-junit4")
testImplementation("org.spockframework:spock-core")
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
tasks.register("publishAll") {
group = "publishing"
if (isReleaseVersion) {
dependsOn("publishPlugins") // Publish to Gradle Plugin Portal if a release
}
dependsOn("publish") // Publish to Sonatype Snapshots or Central Staging, defined in 'publishing' extension
}