-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
202 lines (175 loc) · 5.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
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
194
195
196
197
198
199
200
201
202
buildscript {
dependencyLocking {
lockAllConfigurations()
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.netflix.nebula:nebula-release-plugin:18.0.8'
classpath 'com.netflix.nebula:nebula-publishing-plugin:21.0.0'
classpath 'com.netflix.nebula:nebula-project-plugin:11.0.0'
classpath 'io.spring.nohttp:nohttp-gradle:0.0.11'
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
}
configurations.classpath.resolutionStrategy.cacheDynamicVersionsFor 0, 'minutes'
}
// TODO: remove this hack, see: https://github.com/nebula-plugins/nebula-release-plugin/issues/213
def releaseStage = findProperty('release.stage')
apply plugin: 'com.netflix.nebula.release'
release.defaultVersionStrategy = nebula.plugin.release.git.opinion.Strategies.SNAPSHOT
apply plugin: 'io.github.gradle-nexus.publish-plugin'
allprojects {
group = 'io.micrometer.prometheus'
description = 'RSocket proxy to pull metrics from applications that can only open egress'
ext.'release.stage' = releaseStage ?: 'SNAPSHOT'
afterEvaluate { project -> println "I'm configuring $project.name with version $project.version" }
}
subprojects {
apply plugin: 'signing'
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'io.spring.nohttp'
apply plugin: 'com.netflix.nebula.maven-publish'
apply plugin: 'com.netflix.nebula.maven-manifest'
apply plugin: 'com.netflix.nebula.maven-developer'
apply plugin: 'com.netflix.nebula.javadoc-jar'
apply plugin: 'com.netflix.nebula.source-jar'
apply plugin: 'com.netflix.nebula.maven-apache-license'
apply plugin: 'com.netflix.nebula.publish-verification'
apply plugin: 'com.netflix.nebula.contacts'
apply plugin: 'com.netflix.nebula.info'
apply plugin: 'com.netflix.nebula.project'
dependencies {
checkstyle 'io.spring.javaformat:spring-javaformat-checkstyle:latest.release'
}
compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// ensure Java 17 baseline is enforced when building with higher versions
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) {
options.release = 17
}
}
compileTestJava {
options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// ensure Java 17 baseline is enforced when building with higher versions
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) {
options.release = 17
}
}
jar {
manifest.attributes.put('Automatic-Module-Name', project.name.replace('-', '.'))
metaInf {
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
}
}
normalization {
runtimeClasspath {
metaInf {
[
'Build-Date',
'Built-By',
'Built-OS',
'Build-Host',
'Build-Job',
'Build-Number',
'Build-Id',
'Change',
'Full-Change',
'Branch',
'Module-Origin'
].each {
ignoreAttribute it
ignoreProperty it
}
}
}
}
dependencyLocking {
lockAllConfigurations()
}
tasks.register('resolveAndLockAll') {
description = 'Resolves dependencies of all configurations and writes them into the lock file.'
outputs.upToDateWhen { false }
doFirst {
assert gradle.startParameter.writeDependencyLocks || gradle.startParameter.lockedDependenciesToUpdate : 'Execute resolveAndLockAll --write-locks or --update-locks <dependencies>'
}
doLast {
project.configurations.findAll { it.canBeResolved }*.resolve()
}
}
tasks.register('downloadDependencies') {
outputs.upToDateWhen { false }
doLast {
project.configurations.findAll { it.canBeResolved }*.files
}
}
def check = tasks.findByName('check')
if (check) project.rootProject.tasks.releaseCheck.dependsOn check
contacts {
moniker 'Tommy Ludwig'
github 'shakuzen'
}
}
plugins.withId('maven-publish') {
publishing {
publications {
nebula(MavenPublication) {
// Nebula converts dynamic versions to static ones so it's ok.
suppressAllPomMetadataWarnings()
}
}
repositories {
maven {
name = 'Snapshot'
url = 'https://repo.spring.io/snapshot'
credentials {
username findProperty('SNAPSHOT_REPO_USER')
password findProperty('SNAPSHOT_REPO_PASSWORD')
}
}
maven {
name = 'Milestone'
url = 'https://repo.spring.io/milestone'
credentials {
username findProperty('MILESTONE_REPO_USER')
password findProperty('MILESTONE_REPO_PASSWORD')
}
}
}
}
signing {
required = System.env.CIRCLE_STAGE == 'deploy'
useInMemoryPgpKeys(findProperty('SIGNING_KEY'), findProperty('SIGNING_PASSWORD'))
sign publishing.publications.nebula
}
// Nebula doesn't interface with Gradle's module format so just disable it for now.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
}
}
nexusPublishing {
repositories {
mavenCentral {
nexusUrl.set(uri('https://s01.oss.sonatype.org/service/local/'))
snapshotRepositoryUrl.set(uri('https://repo.spring.io/snapshot/')) // not used but necessary for the plugin
username = findProperty('MAVEN_CENTRAL_USER')
password = findProperty('MAVEN_CENTRAL_PASSWORD')
}
}
}
task deleteLockFiles (type: Delete) {
delete fileTree(dir: '.', include: '**/*.lockfile')
}
wrapper {
gradleVersion = '8.10'
}
defaultTasks 'build'