forked from LabKey/testAutomation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
189 lines (173 loc) · 8.33 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
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'org.labkey.testRunner'
apply plugin: 'maven-publish'
import org.labkey.gradle.util.BuildUtils
import org.labkey.gradle.util.PomFileHelper
project.group = "org.labkey.api"
def apiArtifactName = "labkey-api-selenium"
project.configurations {
aspectj
}
project.dependencies {
api("junit:junit:${junitVersion}")
api("org.seleniumhq.selenium:selenium-api:${seleniumVersion}")
implementation("commons-io:commons-io:${commonsIoVersion}")
implementation("com.fasterxml.jackson.core:jackson-annotations:${jacksonAnnotationsVersion}")
implementation("org.bouncycastle:bcprov-jdk15on:${bouncycastleVersion}")
//api "org.seleniumhq.selenium:selenium-server:${seleniumVersion}"
implementation("org.seleniumhq.selenium:selenium-firefox-driver:${seleniumVersion}")
api("org.seleniumhq.selenium:selenium-support:${seleniumVersion}")
implementation("org.seleniumhq.selenium:selenium-remote-driver:${seleniumVersion}")
implementation("org.seleniumhq.selenium:selenium-chrome-driver:${seleniumVersion}")
implementation("org.seleniumhq.selenium:jetty-repacked:${jettyRepackagedVersion}")
api("org.apache.httpcomponents:httpcore:${httpcoreVersion}")
implementation("com.google.guava:guava:${guavaVersion}")
api("org.apache.httpcomponents:httpclient:${httpclientVersion}")
api("org.hamcrest:hamcrest-core:${hamcrestCoreVersion}")
implementation("org.apache.commons:commons-text:${commonsTextVersion}")
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
implementation("org.apache.httpcomponents:httpmime:${httpmimeVersion}")
implementation("org.apache.commons:commons-collections4:${commonsCollections4Version}")
implementation("net.sf.opencsv:opencsv:${opencsvVersion}")
implementation("javax.servlet:javax.servlet-api:${servletApiVersion}") // originally 3.1.0
aspectj "org.aspectj:aspectjtools:${aspectjVersion}"
implementation "org.slf4j:slf4j-log4j12:${slf4jLog4j12Version}" // Suppresses unwanted logging from remoteapi and webdriver
api "com.github.lookfirst:sardine:${project.lookfirstSardineVersion}"
api "com.googlecode.json-simple:json-simple:${jsonSimpleVersion}"
//implementation "javax.xml.bind:jaxb-api:${jaxbVersion}"
implementation "com.sun.xml.bind:jaxb-impl:${jaxbVersion}"
implementation "com.sun.xml.bind:jaxb-core:${jaxbVersion}"
api "commons-beanutils:commons-beanutils:${commonsBeanutilsVersion}"
implementation "org.apache.tika:tika-core:${tikaVersion}"
implementation "org.apache.commons:commons-compress:${commonsCompressVersion}"
api "org.apache.commons:commons-lang3:${commonsLang3Version}"
implementation "org.apache.commons:commons-math3:${commonsMath3Version}" // used by test classes in targetedms
implementation "org.apache.pdfbox:pdfbox:${pdfboxVersion}"
api "org.apache.poi:poi:${poiVersion}"
implementation "org.apache.poi:poi-ooxml:${poiVersion}"
implementation "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
implementation "org.bouncycastle:bcpg-jdk15on:${bouncycastleVersion}"
implementation "org.jetbrains:annotations:${annotationsVersion}"
implementation "org.mock-server:mockserver-netty:${mockserverNettyVersion}" // used by test classes in accounts
runtimeOnly "org.aspectj:aspectjrt:${aspectjVersion}"
api "org.aspectj:aspectjtools:${aspectjVersion}"
implementation "org.reflections:reflections:${reflectionsVersion}"
uiTestRuntimeOnly "org.aspectj:aspectjrt:${aspectjVersion}"
if (project.hasProperty("teamcity") || project.findProject(BuildUtils.getApiProjectPath(project.gradle)) == null)
{
// LabKey XML schemas are used to decode exported folder XMLs and test case XMLs
// Don't include local version so that running tests doesn't require building API module
implementation("org.labkey.api:api:${labkeySchemasTestVersion}") { transitive = false }
}
else
{
// Use local version outside of TeamCity so as to not confuse IntelliJ
BuildUtils.addLabKeyDependency(
project: project,
config: "implementation",
depProjectPath: BuildUtils.getApiProjectPath(project.gradle),
depProjectConfig: 'apiJarFile',
transitive: false
)
}
// Issue 36184: Tests can't find selenium-ie-driver library when running on Windows on TeamCity
// Workaround to ensure that the class-loader finds InternetExplorerDriver
implementation "org.seleniumhq.selenium:selenium-ie-driver:${seleniumVersion}"
}
BuildUtils.addLabKeyDependency(
project: project,
config: 'api',
depProjectPath: BuildUtils.getRemoteApiProjectPath(gradle),
depProjectConfig: 'runtimeElements',
depVersion: project.labkeyClientApiVersion)
if (project.findProject(":remoteapi:labkey-api-jdbc") != null)
{
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":remoteapi:labkey-api-jdbc")
}
if (project.hasProperty("teamcity"))
{
apply plugin: 'org.labkey.teamCity'
}
// If this configuration for the default jar file is included when synching with IntelliJ
// the classes in other modules that reference classes here will not resolve properly.
if (!BuildUtils.isIntellij()) {
// the jar file that contains just the classes from this project, not all other
// projects with src/test directories
project.sourceSets {
main {
java {
srcDirs = ["src"]
exclude "test/tests/**"
}
}
}
project.tasks.jar {
Jar jar ->
jar.archiveBaseName.set(apiArtifactName)
jar.setGroup('org.labkey.api')
}
}
if (project.hasProperty('doPublishing'))
{
project.afterEvaluate {
PomFileHelper pomUtil = new PomFileHelper(project)
project.publishing {
publications {
libs(MavenPublication) {
groupId = project.group
artifactId = apiArtifactName
artifact project.tasks.jar
pom {
name = "LabKey Test Automation Classes"
description = "Library of classes and utilities for Selenium testing of LabKey Server components"
url = PomFileHelper.LABKEY_ORG_URL
developers PomFileHelper.getLabKeyTeamDevelopers()
licenses PomFileHelper.getApacheLicense()
organization PomFileHelper.getLabKeyOrganization()
scm {
connection = 'scm:git:https://github.com/LabKey/testAutomation'
developerConnection = 'scm:git:https://github.com/LabKey/testAutomation'
url = 'https://github.com/LabKey/testAutomation'
}
withXml {
pomUtil.getDependencyClosure(asNode(), false)
}
}
}
}
if (project.hasProperty('doPublishing'))
{
apply plugin: 'com.jfrog.artifactory'
artifactory {
contextUrl = "${artifactory_contextUrl}"
//The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = BuildUtils.getRepositoryKey(project)
if (project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password'))
{
username = artifactory_user
password = artifactory_password
}
maven = true
}
defaults
{
publishPom = true
publishIvy = false
}
}
}
project.artifactoryPublish {
publications('libs')
}
}
}
project.model {
tasks.publishLibsPublicationToMavenLocal {
enabled = false
}
}
}
}