forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
146 lines (125 loc) · 4.91 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
import org.apache.tools.ant.filters.ReplaceTokens
import org.elasticsearch.gradle.internal.info.BuildParams
import java.nio.file.Paths
apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.publish'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.yaml-rest-compat-test'
apply plugin: 'elasticsearch.internal-test-artifact'
archivesBaseName = 'x-pack-core'
esplugin {
name 'x-pack-core'
description 'Elasticsearch Expanded Pack Plugin - Core'
classname 'org.elasticsearch.xpack.core.XPackPlugin'
hasNativeController false
requiresKeystore false
extendedPlugins = ['aggregations']
}
tasks.named("dependencyLicenses").configure {
mapping from: /http.*/, to: 'httpclient' // pulled in by rest client
mapping from: /commons-.*/, to: 'commons' // pulled in by rest client
}
dependencies {
compileOnly project(":server")
compileOnly project(":modules:aggregations")
api project(':libs:elasticsearch-grok')
api project(":libs:elasticsearch-ssl-config")
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"
api "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}"
api "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}"
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
// security deps
api 'com.unboundid:unboundid-ldapsdk:6.0.3'
testImplementation "org.elasticsearch:mocksocket:${versions.mocksocket}"
testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}"
testImplementation "org.slf4j:slf4j-api:${versions.slf4j}"
testImplementation project(path: ':modules:reindex')
testImplementation project(path: ':modules:parent-join')
testImplementation project(path: ':modules:lang-mustache')
testImplementation project(path: ':modules:analysis-common')
testImplementation project(":client:rest-high-level")
// Needed for Fips140ProviderVerificationTests
testCompileOnly('org.bouncycastle:bc-fips:1.0.2')
testImplementation(project(':x-pack:license-tools')) {
transitive = false
}
yamlRestTestImplementation project(':x-pack:plugin:core')
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
}
ext.expansions = [
'project.version': version
]
tasks.named("processResources").configure {
from(sourceSets.main.resources.srcDirs) {
// we need to have duplicate strategy here as
// we cannot apply the filter on root level due
// to wrong behaviour with binary files.
duplicatesStrategy = DuplicatesStrategy.INCLUDE
exclude '**/public.key'
inputs.properties(expansions)
filter("tokens" : expansions, ReplaceTokens.class)
}
String licenseKey = providers.systemProperty("license.key").getOrNull()
if (licenseKey != null) {
println "Using provided license key from ${licenseKey}"
} else if (BuildParams.isSnapshotBuild()) {
licenseKey = Paths.get(project.projectDir.path, 'snapshot.key')
} else {
throw new IllegalArgumentException('Property license.key must be set for release build')
}
File licenseKeyFile = rootProject.file(licenseKey)
if (licenseKeyFile.exists() == false) {
throw new IllegalArgumentException('license.key at specified path [' + licenseKey + '] does not exist')
}
from(licenseKeyFile) {
rename { String filename -> 'public.key' }
}
}
tasks.named("forbiddenPatterns").configure {
exclude '**/*.key'
exclude '**/*.p12'
exclude '**/*.der'
exclude '**/*.zip'
}
tasks.named('forbiddenApisMain').configure {
signaturesFiles += files('forbidden/hasher-signatures.txt')
}
// make LicenseSigner available for testing signed licenses
sourceSets.test.resources {
srcDir 'src/main/config'
}
tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
//commons-logging optional dependencies
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',
'org.apache.log.Logger',
//commons-logging provided dependencies
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
'javax.jms.Message'
)
}
restResources {
restApi {
include '*'
}
}
testClusters.configureEach {
testDistribution = 'default'
setting 'xpack.security.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
//disabling ILM history as it disturbs testDSXpackUsage test
setting 'indices.lifecycle.history_index_enabled', 'false'
keystore 'bootstrap.password', 'x-pack-test-password'
user username: "x_pack_rest_user", password: "x-pack-test-password"
}
if (BuildParams.inFipsJvm){
// Test clusters run with security disabled
tasks.named("javaRestTest").configure{enabled = false }
}