-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle
194 lines (166 loc) · 6.48 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
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
classpath "org.grails:grails-docs:${project.ext.properties.grailsDocsVersion ?: grailsVersion}"
}
}
version project.projectVersion
group "org.grails.plugins"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: "com.github.erdi.webdriver-binaries"
apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.internal.grails-plugin-publish"
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
configurations {
documentation.extendsFrom(compileClasspath)
}
configurations {
all {
resolutionStrategy.eachDependency { DependencyResolveDetails details->
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion(seleniumVersion)
}
}
}
}
dependencies {
api "org.springframework.boot:spring-boot-starter-logging"
api "org.springframework.boot:spring-boot-autoconfigure"
api "org.grails:grails-core"
api "org.springframework.boot:spring-boot-starter-actuator"
api "org.springframework.boot:spring-boot-starter-tomcat"
api "org.grails:grails-web-boot"
api "org.grails:grails-logging"
api "org.grails:grails-plugin-rest"
api "org.grails:grails-plugin-databinding"
api "org.grails:grails-plugin-i18n"
api "org.grails:grails-plugin-services"
api "org.grails:grails-plugin-url-mappings"
api "org.grails:grails-plugin-interceptors"
api "org.grails.plugins:async"
api "org.grails.plugins:scaffolding"
api "org.codehaus.gpars:gpars:1.2.1"
api "org.grails.plugins:gsp"
runtimeOnly "org.grails.plugins:async"
console "org.grails:grails-console"
profile "org.grails.profiles:web-plugin"
compileOnly "org.grails:grails-plugin-services"
compileOnly "org.grails:grails-plugin-domain-class"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation("org.grails.plugins:geb") {
exclude group: 'org.gebish', module: 'geb-spock'
}
testImplementation "org.gebish:geb-spock:$gebVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
api "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2"
}
apply from: rootProject.file('gradle/testVerbose.gradle')
webdriverBinaries {
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env', 'chromeHeadless')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}
task publishGuide(type: grails.doc.gradle.PublishGuide) {
group = 'documentation'
description = 'Generate Guide'
targetDir = project.file("${buildDir}/docs")
sourceRepo = "https://github.com/${githubSlug}/edit/${githubBranch}/src/main/docs"
sourceDir = new File(projectDir, "src/main/docs")
propertiesFiles = [ new File(rootProject.projectDir, "gradle.properties") ]
asciidoc = true
properties = [
'safe':'UNSAFE',
'version': project.version,
'subtitle': project.projectDesc,
'api': '../api',
'sourceDir':rootProject.projectDir.absolutePath,
'sourcedir':rootProject.projectDir.absolutePath,
'javaee': 'https://docs.oracle.com/javaee/7/api/',
'javase': 'https://docs.oracle.com/javase/7/docs/api/',
'groovyapi': 'https://docs.groovy-lang.org/latest/html/gapi/',
'grailsapi': 'https://docs.grails.org/latest/api/',
'gormapi': 'https://gorm.grails.org/latest/api/',
'springapi': 'https://docs.spring.io/spring/docs/current/javadoc-api/'
]
doLast {
ant.move(file:"${project.buildDir}/docs/guide/single.html",
tofile:"${project.buildDir}/docs/guide/index.html", overwrite:true)
new File(project.buildDir, "docs/index.html").text = '''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:https://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; url=guide/index.html" />
</head>
</body>
</html>
'''
}
}
task docs(dependsOn:[groovydoc, publishGuide]) {
group = 'documentation'
}
bootRun {
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
// enable if you wish to package this plugin as a standalone application
bootJar.enabled = false
grailsPublish {
userOrg = 'grails'
githubSlug = 'grails/grails-cache'
license {
name = 'Apache-2.0'
}
title = project.title
desc = project.projectDesc
developers = [jeffbrown: "Jeff Scott Brown", "puneetbehl": "Puneet Behl"]
}
integrationTest {
testLogging {
exceptionFormat = 'full'
}
}
// exclude demo code from jar artifact
jar {
includeEmptyDirs = false
exclude 'com/demo/**'
}
tasks.named("build") {
finalizedBy("docs")
}