-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
147 lines (127 loc) · 5.01 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
137
138
139
140
141
142
143
144
145
146
147
/*
* Copyright 2021 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 '15.2.0'
id 'jacoco'
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
id 'net.wooga.snyk' version '0.12.0'
id "net.wooga.snyk-wdk-java" version "0.6.0"
id "net.wooga.cve-dependency-resolution" version "0.3.0"
}
group 'com.wooga.gradle'
description = 'A library to provide reusable components and utilities for testing our gradle projects.'
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
dependencies {
implementation localGroovy()
implementation gradleApi()
implementation 'com.wooga.gradle:gradle-commons:[1,2)'
implementation 'com.google.guava:guava:30.0-jre'
implementation 'com.github.stefanbirkner:system-rules:[1.18,2)'
api 'org.spockframework:spock-core:2.3-groovy-3.0'
api 'org.spockframework:spock-junit4:2.3-groovy-3.0'
// TODO: Figure out how to use the same ones as others?
api 'com.netflix.nebula:nebula-test:[10,11)'
api 'org.apache.commons:commons-math3:3.6.1'
api 'commons-io:commons-io:2.12.0'
}
// TODO: Remove in the future when nebule-release is removed
List<String> cliTasks = project.rootProject.gradle.startParameter.taskNames
if (cliTasks.contains("rc")) {
cliTasks.remove("rc")
cliTasks.add("candidate")
project.rootProject.gradle.startParameter.setTaskNames(cliTasks)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
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')
}
}
}
publishing {
publications {
it.create("main", MavenPublication) {MavenPublication publication ->
from(components["java"])
pom {
name = 'Wooga Gradle Commons Test'
description = 'A library for providing APIs for the testing of Gradle plugins.'
url = 'https://github.com/wooga/gradle-commons-test'
artifactId = project.name
inceptionYear = "2021"
scm {
connection = 'scm:git:https://github.com/wooga/gradle-commons-test.git'
developerConnection = 'scm:git:https://github.com/wooga/gradle-commons-test.git'
url = 'https://github.com/wooga/gradle-commons-test.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 = 'manfred.endres@wooga.net'
}
developer {
id = 'christian.sagel'
name = 'Christian Sagel'
email = 'christian.sagel@wooga.net'
}
}
}
}
}
}
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)
}