-
Notifications
You must be signed in to change notification settings - Fork 42
/
build.gradle
120 lines (111 loc) · 4.53 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
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
plugins {
id 'groovy'
id 'io.github.gradle-nexus.publish-plugin'
id 'org.asciidoctor.jvm.convert'
}
group = 'org.grails'
version = projectVersion
ext.set('grailsVersion', libs.versions.grails.asProvider().get())
ext.set('isSnapshot', version.endsWith('-SNAPSHOT'))
ext.set('isReleaseVersion', !isSnapshot)
allprojects {
ext.set('signing.keyId', findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY'))
ext.set('signing.password', findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE'))
ext.set('signing.secretKeyRingFile', findProperty('signing.secretKeyRingFile') ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg")
ext.set('pomInfo', {
delegate.url 'https://views.grails.org/latest/'
delegate.licenses {
delegate.license {
delegate.name 'The Apache Software License, Version 2.0'
delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
delegate.scm {
delegate.url 'https://github.com/grails/grails-views/'
delegate.connection 'scm:git:git://github.com/grails/grails-views'
delegate.developerConnection 'scm:git:ssh://github.com:grails/grails-views'
}
delegate.developers {
delegate.developer {
delegate.id 'graemerocher'
delegate.name 'Graeme Rocher'
delegate.email '[email protected]'
}
delegate.developer {
delegate.id 'puneetbehl'
delegate.name 'Puneet Behl'
delegate.email '[email protected]'
}
}
})
version = rootProject.version
repositories {
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) {
maven {
name = 'JFrog Groovy snapshot repo'
url = 'https://groovy.jfrog.io/artifactory/libs-snapshot-local'
}
}
if (System.getenv("GITHUB_MAVEN_PASSWORD") && !grailsVersion.endsWith('-SNAPSHOT')) {
System.out.println("Adding Grails Core Repo")
maven {
url = 'https://maven.pkg.github.com/grails/grails-core'
credentials {
username = 'DOES_NOT_MATTER'
password = System.getenv("GITHUB_MAVEN_PASSWORD")
}
}
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging { events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' }
}
tasks.withType(Jar).configureEach {
manifest.attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
'Implementation-Title': project.findProperty('projectDesc') ?: 'Grails Views',
'Implementation-Version': project.version,
'Implementation-Vendor': 'grails.org'
)
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}
}
if (isReleaseVersion) {
nexusPublishing {
String ossUser = findProperty('sonatypeOssUsername')
String ossPass = findProperty('sonatypeOssPassword')
String ossStagingProfileId = findProperty('sonatypeOssStagingProfileId')
String ossRepo = findProperty('sonatypeOssRepo') ?: 'https://s01.oss.sonatype.org/service/local/'
repositories {
sonatype {
nexusUrl = uri(ossRepo)
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
}
// Do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter = tasks.withType(Sign)
}
subprojects {
apply plugin: 'groovy'
dependencies {
implementation platform(libs.grails.bom), {
exclude group: 'org.grails.plugins', module: 'views-gradle'
exclude group: 'org.grails.plugins', module: 'views-json'
exclude group: 'org.grails', module: 'views-core'
exclude group: 'org.grails', module: 'views-json-testing-support'
}
}
}