-
Notifications
You must be signed in to change notification settings - Fork 116
/
build.gradle
123 lines (99 loc) · 3.94 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
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "io.github.gradle-nexus:publish-plugin:$gradlePublishPlugin"
classpath 'com.adarshr:gradle-test-logger-plugin:4.0.0'
classpath 'io.spring.gradle:dependency-management-plugin'
}
}
plugins {
id 'idea'
id 'io.github.gradle-nexus.publish-plugin' version "$gradlePublishPlugin"
id "com.github.ben-manes.versions" version "0.51.0"
}
allprojects {
apply plugin:"idea"
}
def pluginProjects = ['spring-security-rest', 'spring-security-rest-memcached', 'spring-security-rest-redis', 'spring-security-rest-grailscache', 'spring-security-rest-gorm']
def profileProjects = ['spring-security-rest-testapp-profile']
def publishedProjects = pluginProjects + profileProjects
version projectVersion
group "org.grails.plugins"
ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT'))
ext.set('isReleaseVersion', !isSnapshot)
if (isReleaseVersion) {
nexusPublishing {
String nexusUser = findProperty('sonatypeUsername')
String nexusPass = findProperty('sonatypePassword')
String nexusStagingProfileId = findProperty('sonatypeStagingProfileId')
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
username = nexusUser
password = nexusPass
stagingProfileId = nexusStagingProfileId
}
}
}
}
subprojects { Project project ->
group "org.grails.plugins"
version projectVersion
ext.set('grailsVersion', project.grailsVersion)
ext.set('isProfile', project.name.endsWith('-profile'))
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
if (project.name != "spring-security-rest-docs" &&
project.name != "spring-security-rest-testapp-profile" &&
!project.name.startsWith("build") ) {
apply plugin: "org.grails.grails-plugin"
}
tasks.withType(Test) {
useJUnitPlatform()
}
if (project.name in pluginProjects) {
sourceCompatibility = targetCompatibility = JavaVersion.toVersion(17)
apply plugin: "java-library"
dependencies {
console "org.grails:grails-console"
api "org.springframework.boot:spring-boot-starter-logging"
api "org.springframework.boot:spring-boot-autoconfigure"
api "org.grails:grails-core"
api "org.grails.plugins:spring-security-core:$springSecurityCoreVersion"
api "org.grails:grails-plugin-services"
api "org.grails:grails-plugin-domain-class"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
testImplementation('com.athaydes:spock-reports:2.5.1-groovy-4.0') {
transitive = false
}
}
apply plugin: 'com.adarshr.test-logger'
testlogger {
showFullStackTraces true
showStandardStreams true
showPassedStandardStreams false
showSkippedStandardStreams false
showFailedStandardStreams true
}
}
if (project.name in profileProjects) {
apply plugin: "org.grails.grails-profile"
apply plugin: "io.spring.dependency-management"
}
if (project.name in publishedProjects) {
apply from: rootProject.file("gradle/publishing.gradle")
}
}
apply from: rootProject.file("gradle/docs.gradle")
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}