forked from apache/groovy-geb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geb.gradle
197 lines (157 loc) · 5.47 KB
/
geb.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
194
195
196
apply plugin: 'base'
apply plugin: 'idea'
apply from: "gradle/idea.gradle"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-clover-plugin:0.6.1'
}
}
if (project.hasProperty("ci")) {
allprojects {
plugins.withType(ReportingBasePlugin) {
reporting.baseDir = rootProject.file("$rootProject.buildDir/reports/$project.name")
}
}
}
allprojects { project ->
version = '0.9.3-SNAPSHOT'
group = 'org.gebish'
ext {
isSnapshot = version.endsWith("-SNAPSHOT")
seleniumVersion = "2.26.0"
groovyVersion = "1.8.9"
spockVersion = "0.7-groovy-1.8"
usingSauce =
spockDependency = dependencies.create("org.spockframework:spock-core:$spockVersion") {
exclude module: "groovy-all"
}
seleniumDependency = "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
seleniumSupportDependency = "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
firefoxDriverDependency = "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
htmlUnitDriverDependency = "org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion"
jettyDependency = "org.mortbay.jetty:jetty:6.1.21"
groovyDependency = "org.codehaus.groovy:groovy-all:$groovyVersion"
repositories {
mavenCentral()
mavenRepo name: "java.net", url: "http://download.java.net/maven/2"
}
groovyModules = [
":module:geb-core", ":module:geb-core-tests", ":internal:test-support",
":module:geb-spock", ":module:geb-junit3", ":module:geb-junit4",
":module:geb-easyb", ":module:geb-testng", ":module:geb-implicit-assertions",
":module:geb-ast", ":module:geb-waiting", ":integration:geb-gradle", ":doc:site"
]
publishedModules = [
":module:geb-core", ":module:geb-implicit-assertions", ":module:geb-ast", ":module:geb-waiting",
":module:geb-spock", ":module:geb-junit3", ":module:geb-junit4", ":module:geb-easyb",
":module:geb-testng", ":doc:manual", ":integration:geb-gradle"
]
publishedGroovyModules = groovyModules.findAll { it in publishedModules }
apiGroovyModules = publishedGroovyModules - ":module:geb-implicit-assertions"
grailsPluginModule = ":integration:geb-grails"
}
}
subprojects {
if (path in groovyModules) {
apply plugin: "groovy"
apply plugin: 'idea'
if (path != ":test-support") {
// apply from: "file:${rootDir}/clover.gradle"
}
dependencies {
groovy groovyDependency
}
sourceCompatibility = 1.5
targetCompatibility = 1.5
tasks.withType(Test) {
reports.junitXml.destination = reporting.file("test-results/$name")
reports.html.destination = reporting.file("test-reports/$name")
binResultsDir = file("$buildDir/test-results-bin/$name")
ext.driver = project.properties["driver"] ?: "htmlunit"
systemProperty 'geb.dev.driver', driver
systemProperty 'geb.build.reportsDir', reporting.file("geb-reports/$name")
}
}
if (path in publishedGroovyModules) {
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier 'javadoc'
from groovydoc
}
artifacts {
archives javadocJar, sourcesJar
}
}
tasks.withType(Groovydoc) {
exclude "**/internal/**"
link "http://download.oracle.com/javase/6/docs/api/",
"java.net",
"java.util",
"java.lang",
"java.io"
link "http://selenium.googlecode.com/svn/trunk/docs/api/java/",
"org.openqa.selenium"
link "http://groovy.codehaus.org/api/",
"groovy.lang"
link "http://www.gebish.org/manual/$version/api/geb-core",
"geb"
def docName = project.name == "manual" ? "Geb" : project.name
docTitle = "Groovy API Documentation for $docName $version"
footer = "<p style='text-align: center'>Groovy API Documentation for $docName $version - Licensed under the Apache License, Version 2.0 - <a href='http://www.gebish.org'>http://www.gebish.org</a></p>"
windowTitle = "Groovy API for $docName $version"
}
if (path in publishedModules) {
apply plugin: "base"
apply plugin: "maven"
apply plugin: "signing"
signing {
sign configurations.archives
required { !isSnapshot && gradle.taskGraph.hasTask(uploadArchives) }
}
apply from: "$rootDir/gradle/pom.gradle"
if (path == ":doc:manual") {
task("install", type: Upload, dependsOn: configurations.archives.allArtifacts.buildDependencies) {
configuration = configurations.archives
description = "Does a maven install of the archives artifacts into the local .m2 cache."
repositories {
mavenInstaller name: "mavenInstaller"
}
}
}
uploadArchives { task ->
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
uniqueVersion = false
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(task)) {
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeOssUsername, password: sonatypeOssPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeOssUsername, password: sonatypeOssPassword)
}
}
}
}
}
}
}
task release {
dependsOn ':integration:geb-grails:publish',
{ allprojects.findAll { it.path in publishedModules }*.uploadArchives },
':doc:site:publish'
}
if (hasProperty('enableClover')) {
configure(subprojects.findAll { it.parent == project(':module') } + rootProject) {
apply from: rootProject.file("gradle/clover.gradle")
}
}
task wrapper(type: Wrapper) {
gradleVersion "1.7"
}