forked from grails/grails-gsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
129 lines (109 loc) · 4.54 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
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.grails:grails-docs:${project.ext.properties.grailsDocsVersion ?: grailsVersion}"
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
classpath "com.github.ben-manes:gradle-versions-plugin:0.39.0"
classpath "se.patrikerdes:gradle-use-latest-versions-plugin:0.2.17"
}
}
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
version project.projectVersion
ext {
commonBuild = 'https://raw.githubusercontent.com/grails/grails-common-build/master'
}
apply plugin:'idea'
subprojects {
apply plugin: 'se.patrikerdes.use-latest-versions'
apply plugin: com.github.benmanes.gradle.versions.VersionsPlugin
version project.projectVersion
ext {
userOrg = "grails"
isGrailsPlugin = name.startsWith('grails-plugin')
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
}
if (isGrailsPlugin) {
group "org.grails.plugins"
} else {
group "org.grails"
}
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
if (it.name.startsWith("examples")) {
apply plugin: "org.grails.grails-web"
} else if (isGrailsPlugin) {
apply plugin: "org.grails.grails-plugin"
} else {
apply from: "${commonBuild}/common-project.gradle"
dependencies {
documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
}
}
apply plugin:'idea'
apply plugin: 'java-library'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if( details.requested.group == 'org.grails' &&
details.requested.name in ['grails-datastore-core',
'grails-datastore-async',
'grails-datastore-gorm',
'grails-datastore-gorm-async',
'grails-datastore-gorm-rx',
'grails-datastore-gorm-support',
'grails-datastore-gorm-tck',
'grails-datastore-gorm-test',
'grails-datastore-gorm-validation',
'grails-datastore-web']
) {
details.useVersion(datastoreVersion)
} else if (details.requested.group == "org.springframework") {
details.useVersion(springVersion)
} else if (details.requested.group == "org.springframework.boot") {
details.useVersion(springBootVersion)
} else if (details.requested.group == "org.spockframework") {
details.useVersion(spockVersion)
}
}
}
dependencies {
compileOnly "javax.servlet:javax.servlet-api:$servletApiVersion"
testImplementation "javax.servlet:javax.servlet-api:$servletApiVersion"
testImplementation "org.codehaus.groovy:groovy-test-junit5:${groovyVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
testImplementation "org.junit.platform:junit-platform-runner:1.8.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.1"
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
}
tasks.named("dependencyUpdates").configure {com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask task->
// disallow release candidates as upgradable versions from stable versions
task.rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
useLatestVersions {
updateRootProperties = true
}
}
apply from: "${commonBuild}/common-docs.gradle"
apply from: "${commonBuild}/common-publishing.gradle"
boolean isNonStable(String version) {
version ==~ /(?i).+(-|\.?)(b|M|RC|Dev)\d?.*/ ||
['alpha', 'beta', 'milestone', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier ->
version ==~ /(?i).*[.-]$qualifier[.\d-+]*/
}
}