forked from chiquitinxx/grooscript-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
70 lines (59 loc) · 2.65 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
plugins {
id "com.wiredforcode.spawn" version "0.8.2"
}
apply plugin: 'idea'
ext.compatibilityVersion = 1.7
task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}
idea.project {
jdkName = '1.8'
languageLevel = compatibilityVersion
}
task createTestApp(type: CreateGrailsApp, dependsOn: [':gradle-plugin:install', ':grails-core:install']) {
sources = 'test-app-sources'
app = 'test-app'
options = {
addGrailsProjectDependency('grails-plugin')
comment('testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver')
comment('testRuntime "net.sourceforge.htmlunit:htmlunit')
comment('apply plugin:"war"')
addDependency('testCompile', 'org.seleniumhq.selenium:selenium-support:3.0.1')
addDependency('testCompile', 'org.seleniumhq.selenium:selenium-chrome-driver:3.0.1')
addDependency('testCompile', 'io.github.bonigarcia:webdrivermanager:1.5.0')
addDependency('testCompile', 'org.gebish:geb-spock:1.1.1')
addBuildscriptDependency('classpath', "org.grooscript:gradle-plugin:" +
project.findProject(':gradle-plugin').version)
applyPlugin('org.grooscript.conversion')
}
}
task createWebsocketsTestApp(type: CreateGrailsApp) {
sources = 'websockets-test-app-sources'
app = 'websockets-test-app'
options = {
addGrailsProjectDependency('grails-plugin')
comment('testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver')
comment('testRuntime "net.sourceforge.htmlunit:htmlunit')
comment('apply plugin:"war"')
addDependency('compile', 'org.grails.plugins:grails-spring-websocket:2.3.0')
addDependency('testCompile', 'org.seleniumhq.selenium:selenium-support:3.0.1')
addDependency('testCompile', 'org.seleniumhq.selenium:selenium-chrome-driver:3.0.1')
addDependency('testCompile', 'io.github.bonigarcia:webdrivermanager:1.5.0')
addDependency('testCompile', 'org.gebish:geb-spock:1.1.1')
}
}
import com.wiredforcode.gradle.spawn.*
task startTestAppJar(type: SpawnProcessTask, dependsOn: ':test-app:build') {
command "java -jar ${project.findProject(':test-app').projectDir}/build/libs/test-app-0.1.jar"
ready 'Grails application running at http://localhost:8080 in environment: production'
}
task stopTestAppJar(type: KillProcessTask)
task checkComponentInJar(dependsOn: 'startTestAppJar') {
finalizedBy 'stopTestAppJar'
doLast {
String urlText = 'http://localhost:8080/tagComponent'.toURL().text
if (!urlText.contains('<my-message></my-message>')) {
throw new GradleException('Error checking components in Jar.')
}
}
}