-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
125 lines (105 loc) · 4.25 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
buildscript {
repositories {
mavenCentral()
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:2.0.0"
}
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
group = "org.grails"
version project.projectVersion
ext {
groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion
isCiBuild = System.getenv().get("TRAVIS") == 'true' || (System.getenv().get("CI") as Boolean)
commonBuild = 'https://github.com/raw/grails/grails-common-build/v2.0.3'
}
apply plugin:'idea'
subprojects {
version project.projectVersion
ext {
userOrg = "grails"
isGrailsPlugin = name.startsWith('grails-plugin')
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion
}
if (isGrailsPlugin) {
group "org.grails.plugins"
} else {
group "org.grails"
}
repositories {
mavenLocal()
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.11
targetCompatibility=1.11
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == "org.spockframework") {
details.useVersion(spockVersion)
} else if (details.requested.group == "org.junit.jupiter") {
details.useVersion(junitJupiterVersion)
} else if (details.requested.group == "org.junit.platform") {
details.useVersion(junitPlatformVerison)
}
}
}
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:${junitJupiterVersion}"
testImplementation "org.junit.platform:junit-platform-runner:${junitPlatformVerison}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
if (isCiBuild) {
maxParallelForks = 2
} else {
maxParallelForks = 4
}
}
}
apply from: "${commonBuild}/common-docs.gradle"
apply from: "${commonBuild}/common-publishing.gradle"
tasks.named('publishGuide') {
// Override value defined in grails/grails-common-build/common-docs.gradle
it.properties['commandLineRef'] = "https://docs.grails.org/$grailsVersion/ref/Command%20Line"
it.properties['controllersRef'] = "https://docs.grails.org/$grailsVersion/ref/Controllers"
it.properties['grailsapi'] = "https://docs.grails.org/$grailsVersion/api/"
it.properties['grailsdocs'] = "https://docs.grails.org/$grailsVersion/"
it.properties['groovyapi'] = "https://docs.groovy-lang.org/$groovyVersion/html/gapi/"
it.properties['groovyjdk'] = "https://docs.groovy-lang.org/$groovyVersion/html/groovy-jdk/"
it.properties['javase'] = 'https://docs.oracle.com/en/java/javase/11/docs/api/'
}
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-+]*/
}
}