-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
149 lines (119 loc) · 4.18 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/java_library_plugin.html
*/
plugins {
id 'java-library'
id 'maven'
id 'jacoco'
id 'eclipse'
id 'idea'
}
group 'io.github.mrs'
version '1.0-SNAPSHOT'
repositories {
jcenter()
mavenCentral()
maven { url = 'https://jitpack.io' }
}
ext {
logging_log4j_version='2.12.1'
selenium_version='3.141.59'
junit_version='5.8.0-M1'
assertj_core_version='3.19.0'
commons_io_version='2.7'
commons_lang_version='3.11'
javafaker_version='1.0.2'
webdrivermanager_version='4.2.0'
gson_version='2.8.6'
selenide_version='5.14.1'
httpclient_version='4.5.12'
screenshotDirectory="${buildDir}/screenshots"
browser='chrome'
headless=false
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
compile "org.assertj:assertj-core:${assertj_core_version}"
compile "com.github.javafaker:javafaker:${javafaker_version}"
compile "org.junit.jupiter:junit-jupiter-api:${junit_version}"
compile "org.junit.jupiter:junit-jupiter-engine:${junit_version}"
compile "org.junit.jupiter:junit-jupiter-params:${junit_version}"
// https://mvnrepository.com/artifact/org.easetech/easytest-core
compile "org.easetech:easytest-core:1.4.0"
compile "org.seleniumhq.selenium:selenium-java:${selenium_version}"
compile "io.github.bonigarcia:webdrivermanager:${webdrivermanager_version}"
compile "com.codeborne:selenide:${selenide_version}"
compile "org.apache.logging.log4j:log4j-core:${logging_log4j_version}"
compile "org.apache.logging.log4j:log4j-slf4j-impl:${logging_log4j_version}"
compile "commons-io:commons-io:${commons_io_version}"
compile "org.apache.commons:commons-lang3:${commons_lang_version}"
compile "com.google.code.gson:gson:${gson_version}"
compile "org.apache.httpcomponents:httpclient:${httpclient_version}"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
test {
dependsOn cleanTest
useJUnitPlatform() {
// https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/testng/TestNGOptions.html
environment 'FUNCTIONAL_ENV', System.getProperty('functional.env', 'uscald')
systemProperty 'browser', System.getProperty('browser', "${browser}")
systemProperty 'headless', System.getProperty('headless', "${headless}")
systemProperty 'screenshotDirectory', System.getProperty('screenshotDirectory', "${screenshotDirectory}")
systemProperty 'baseurl', System.getProperty('baseurl', 'https://www.google.com')
//display the following test events
testLogging {
showStandardStreams true
events "PASSED", "FAILED", "SKIPPED"
}
}
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
jacoco {
toolVersion "0.8.5"
reportsDir file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
xml.destination file("${buildDir}/reports/jacoco/coverage.xml")
html.destination file("${buildDir}/reports/jacoco/html")
}
}
// found here: http://jdpgrailsdev.github.io/blog/2014/10/28/gradle_resolve_all_dependencies.html
task resolveDependencies {
doLast {
project.rootProject.allprojects.each { subProject ->
subProject.buildscript.configurations.each { configuration ->
resolveConfiguration(configuration)
}
subProject.configurations.each { configuration ->
resolveConfiguration(configuration)
}
}
}
}
void resolveConfiguration(configuration) {
if (isResolveableConfiguration(configuration)) {
configuration.resolve()
}
}
boolean isResolveableConfiguration(configuration) {
def nonResolveableConfigurations = ['apiElements', 'implementation',
'runtimeElements', 'runtimeOnly',
'testImplementation', 'testRuntimeOnly',
'generatedImplementation', 'generatedRuntimeOnly']
if (nonResolveableConfigurations.contains(configuration.getName())) {
return false
}
return true
}