-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
136 lines (118 loc) · 4.65 KB
/
build.gradle
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
/*
* Copyright 2019 Wooga GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
id 'nebula.release' version '17.2.2'
id 'jacoco'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id 'net.wooga.snyk' version '0.13.0'
id "net.wooga.snyk-wdk-java" version "0.7.0"
id "net.wooga.cve-dependency-resolution" version "0.5.0"
}
group "com.wooga.github"
List<String> cliTasks = project.rootProject.gradle.startParameter.taskNames
if (cliTasks.contains("rc")) {
cliTasks.remove("rc")
cliTasks.add("candidate")
project.rootProject.gradle.startParameter.setTaskNames(cliTasks)
}
test {
useJUnitPlatform()
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.13'
api 'org.kohsuke:github-api:1.302'
implementation 'org.apache.commons:commons-io:[1,2)'
testImplementation 'org.ajoberstar.grgit:grgit-core:4.1.1'
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
testImplementation 'org.spockframework:spock-junit4:2.3-groovy-3.0'
testImplementation 'com.wooga.spock.extensions:spock-github-extension:0.1.2'
testImplementation 'com.github.stefanbirkner:system-rules:[1.18,2)'
testImplementation 'net.bytebuddy:byte-buddy:[1.9,2)'
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
publishing {
publications {
main(MavenPublication) {
from(components["java"])
pom {
name = 'Github changelog lib'
description = 'A groovy library with utility classes to fetch and generate changelogs directly from github'
url = 'https://github.com/wooga/github-changelog-lib'
artifactId = project.name
inceptionYear = "2019"
scm {
connection = 'scm:git:https://github.com/wooga/github-changelog-lib.git'
developerConnection = 'scm:git:https://github.com/wooga/github-changelog-lib.git'
url = 'https://github.com/wooga/github-changelog-lib.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'manfred.endres'
name = 'Manfred Endres'
email = '[email protected]'
}
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
password = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
}
}
}
signing {
def signingKeyId = project.hasProperty("signingKeyId") ? project.property('signingKeyId') : System.getenv('OSSRH_SIGNING_KEY_ID')
def signingKey = project.hasProperty("signingKey") ? project.property('signingKey') : System.getenv('OSSRH_SIGNING_KEY')
def signingPassword = project.hasProperty('signingPassphrase') ? project.property('signingPassphrase') : System.getenv("OSSRH_SIGNING_PASSPHRASE")
useInMemoryPgpKeys(signingKeyId.toString(), signingKey.toString(), signingPassword.toString())
sign publishing.publications.main
}
postRelease.dependsOn(tasks.publish)
afterEvaluate {
tasks."final".dependsOn(tasks.publishToSonatype, tasks.closeAndReleaseSonatypeStagingRepository)
tasks."candidate".dependsOn(tasks.publishToSonatype, tasks.closeAndReleaseSonatypeStagingRepository)
tasks.publishToSonatype.mustRunAfter(tasks.postRelease)
tasks.closeSonatypeStagingRepository.mustRunAfter(tasks.publishToSonatype)
tasks.publish.mustRunAfter(tasks.release)
}