-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle.kts
170 lines (141 loc) · 5.41 KB
/
build.gradle.kts
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
/* Imports *******************************************************************/
import java.util.Date
import java.net.URL
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.jvm.tasks.Jar
import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/* ***************************************************************************/
/* Properties ****************************************************************/
val allureVersion: String by project
val detektVersion: String by project
val htmlUnitDriverVersion: String by project
val jvmTargetVersion: String by project
val kotlinStdLib: String by project
val logbackVersion: String by project
val projectDescription: String by project
val projectGroup: String by project
val projectName: String by project
val projectRepository: String by project
val projectVersion: String by project
val seleniumVersion: String by project
val slf4jVersion: String by project
val testNgVersion: String by project
/* ***************************************************************************/
/* Plugins *******************************************************************/
plugins {
kotlin("jvm").version("1.3.50")
id("com.jfrog.bintray").version("1.8.4")
id("io.gitlab.arturbosch.detekt").version("1.0.1")
id("io.qameta.allure").version("2.8.1")
id("maven")
id("maven-publish")
id("org.jetbrains.dokka").version("0.9.18")
}
/* ***************************************************************************/
/* Maven *********************************************************************/
group = projectGroup
version = projectVersion
/* ***************************************************************************/
/* Dependencies **************************************************************/
dependencies {
compile(kotlin(kotlinStdLib))
compile(kotlin("reflect"))
compile("org.slf4j:slf4j-api:$slf4jVersion")
compile("org.seleniumhq.selenium:selenium-api:$seleniumVersion")
compile("org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion")
compile("org.seleniumhq.selenium:selenium-support:$seleniumVersion")
testCompile("org.testng:testng:$testNgVersion")
testCompile("org.seleniumhq.selenium:htmlunit-driver:$htmlUnitDriverVersion")
testRuntime("ch.qos.logback:logback-classic:$logbackVersion")
}
repositories {
jcenter()
mavenCentral()
}
/* ***************************************************************************/
/* Allure's setup **********************************************************/
allure {
autoconfigure = false
version = allureVersion
useTestNG {
version = allureVersion
}
}
/* ***************************************************************************/
/* Detekt's setup ************************************************************/
detekt {
toolVersion = detektVersion
input = files("src/main/kotlin")
filters = ".*/resources/.*"
}
/* ***************************************************************************/
/* Publication setup *********************************************************/
val sourcesJarTask = task<Jar>("sourceJar") {
from(sourceSets["main"].allSource)
classifier = "sources"
}
publishing {
publications {
create<MavenPublication>("JCenterPublication") {
from(components["java"])
artifact(sourcesJarTask)
groupId = projectGroup
artifactId = projectName
version = projectVersion
}
}
}
bintray {
user = System.getenv("JFROG_USER")
key = System.getenv("JFROG_KEY")
setPublications("JCenterPublication")
pkg.apply {
repo = "maven"
name = projectName
desc = projectDescription
vcsUrl = projectRepository
publish = true
setLabels("kotlin", "selenium", "web", "geb", "automation")
setLicenses("Apache-2.0")
publicDownloadNumbers = true
version.apply {
name = projectVersion
desc = projectDescription
released = Date().toString()
}
}
}
/* ***************************************************************************/
/* Test task configuration ***************************************************/
tasks.withType(Test::class.java).all {
ignoreFailures = true
useTestNG() {
suites("src/test/resources/testng.xml")
}
}
/* ***************************************************************************/
/* Dokka configuration *******************************************************/
val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$projectDir/docs/kotlin/api"
}
task("dokkajdoc", DokkaTask::class) {
outputFormat = "javadoc"
outputDirectory = "$projectDir/docs/java/api"
}
tasks.withType(DokkaTask::class.java).all {
samples = listOf("$projectDir/src/test/kotlin")
externalDocumentationLink(delegateClosureOf<ExternalDocumentationLink.Builder> {
url = URL("https://seleniumhq.github.io/selenium/docs/api/java/index.html")
})
}
/* ***************************************************************************/
/* JVM attributes ************************************************************/
tasks.withType(KotlinCompile::class.java).all {
kotlinOptions {
jvmTarget = jvmTargetVersion
}
}
/* ***************************************************************************/