-
Notifications
You must be signed in to change notification settings - Fork 25.1k
/
Copy pathbuild.gradle
109 lines (93 loc) · 3.79 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
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import org.elasticsearch.gradle.internal.info.BuildParams;
apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.publish'
dependencies {
api project(":client:rest")
api project(':modules:transport-netty4')
api project(':libs:ssl-config')
api project(":server")
api project(":libs:cli")
api "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
api "junit:junit:${versions.junit}"
api "org.hamcrest:hamcrest:${versions.hamcrest}"
api "org.apache.lucene:lucene-test-framework:${versions.lucene}"
api "org.apache.lucene:lucene-codecs:${versions.lucene}"
api "commons-logging:commons-logging:${versions.commonslogging}"
api "commons-codec:commons-codec:${versions.commonscodec}"
// mockito
api 'org.mockito:mockito-core:5.15.2'
api 'org.mockito:mockito-subclass:5.15.2'
api 'net.bytebuddy:byte-buddy:1.15.11'
api 'org.objenesis:objenesis:3.3'
api "org.elasticsearch:mocksocket:${versions.mocksocket}"
testImplementation project(':x-pack:plugin:mapper-unsigned-long')
testImplementation project(":modules:mapper-extras")
}
sourceSets {
integTest {
compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"]
runtimeClasspath += output + compileClasspath
}
}
// the main files are actually test files, so use the appropriate forbidden api sigs
tasks.named('forbiddenApisMain').configure {
replaceSignatureFiles 'jdk-signatures', 'es-all-signatures', 'es-test-signatures'
}
// TODO: should we have licenses for our test deps?
tasks.named("dependencyLicenses").configure { enabled = false }
tasks.named("dependenciesInfo").configure { enabled = false }
tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
// classes are missing
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',
'org.apache.log.Logger',
'org.apache.log4j.Level',
'org.apache.log4j.Logger',
'org.apache.log4j.Priority',
// mockito
'net.bytebuddy.agent.Installer',
'net.bytebuddy.agent.ByteBuddyAgent',
'org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher',
'org.opentest4j.AssertionFailedError',
// not using JNA
'com.sun.jna.FunctionMapper',
'com.sun.jna.JNIEnv',
'com.sun.jna.Library',
'com.sun.jna.Native',
'com.sun.jna.NativeLibrary',
'com.sun.jna.Platform'
)
ignoreViolations(
'org.objenesis.instantiator.sun.UnsafeFactoryInstantiator',
'org.objenesis.instantiator.util.UnsafeUtils'
)
}
tasks.named("test").configure {
systemProperty 'tests.gradle_index_compat_versions', buildParams.bwcVersions.indexCompatible.join(',')
systemProperty 'tests.gradle_wire_compat_versions', buildParams.bwcVersions.wireCompatible.join(',')
}
tasks.register("integTest", Test) {
testClassesDirs = sourceSets.integTest.output.classesDirs
classpath = sourceSets.integTest.runtimeClasspath
}
tasks.named('check').configure {
dependsOn 'integTest'
}
tasks.register("verifyVersions") {
dependsOn "test"
}
tasks.named('splitPackagesAudit').configure {
// for now we always run tests with the classpath, so we are ok with split packages for tests
enabled = false
}