-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Expand file tree
/
Copy pathbuild.gradle
More file actions
140 lines (125 loc) · 4.72 KB
/
build.gradle
File metadata and controls
140 lines (125 loc) · 4.72 KB
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
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-test-artifact'
apply plugin: 'elasticsearch.dra-artifacts'
esplugin {
name = 'x-pack-ml'
description = 'Elasticsearch Expanded Pack Plugin - Machine Learning'
classname ='org.elasticsearch.xpack.ml.MachineLearning'
hasNativeController =true
extendedPlugins = ['x-pack-autoscaling', 'lang-painless']
}
if (useDra == false) {
repositories {
exclusiveContent {
forRepository {
ivy {
name = "ml-cpp"
url = providers.systemProperty('build.ml_cpp.repo').orElse('https://prelert-artifacts.s3.amazonaws.com').get()
metadataSources {
// no repository metadata, look directly for the artifact
artifact()
}
patternLayout {
artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
}
}
}
filter {
includeGroup 'org.elasticsearch.ml'
}
}
}
}
configurations {
nativeBundle {
resolutionStrategy.cacheChangingModulesFor 2, 'hours'
}
}
esplugin.bundleSpec.from {
configurations.nativeBundle.files.collect { zipTree(it) }
}
// this is required due to https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/472
// those lib files should not be executable in the first place
esplugin.bundleSpec.filesMatching("platform/**/lib/*") { details ->
details.permissions {
unix(0644)
}
}
// We don't ship the individual nativeBundle licenses - instead
// they get combined into the top level NOTICES file we ship
esplugin.bundleSpec.exclude 'platform/licenses/**'
["bundlePlugin", "explodedBundlePlugin"].each { bundleTaskName ->
tasks.named(bundleTaskName).configure {
dependsOn configurations.nativeBundle
}
}
dependencies {
testImplementation project(path: ':x-pack:plugin:inference')
compileOnly project(':modules:lang-painless:spi')
compileOnly project(path: xpackModule('core'))
compileOnly project(path: xpackModule('autoscaling'))
compileOnly project(path: xpackModule('ml-package-loader'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation project(path: xpackModule('ilm'))
testImplementation project(path: xpackModule('shutdown'))
testImplementation project(':modules:data-streams')
testImplementation project(path: xpackModule('monitoring'))
testImplementation project(':modules:ingest-common')
testImplementation project(':modules:reindex')
testImplementation project(':modules:analysis-common')
testImplementation project(':modules:mapper-extras')
testImplementation project(':modules:lang-mustache')
// This should not be here
testImplementation(testArtifact(project(xpackModule('security'))))
testImplementation project(path: xpackModule('wildcard'))
// ml deps
api project(':libs:grok')
api project(':modules:lang-mustache')
api "org.apache.commons:commons-math3:3.6.1"
api "com.ibm.icu:icu4j:${versions.icu4j}"
api "org.apache.lucene:lucene-analysis-icu:${versions.lucene}"
api "org.apache.lucene:lucene-analysis-kuromoji:${versions.lucene}"
implementation 'org.ojalgo:ojalgo:51.2.0'
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:deps@zip") {
changing = true
}
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:nodeps@zip") {
changing = true
}
testImplementation 'org.ini4j:ini4j:0.5.2'
testImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
}
def mlCppVersion(){
return (project.gradle.parent != null && buildParams.snapshotBuild == false) ?
(project.version + "-SNAPSHOT") : project.version;
}
tasks.named('assemble').configure {
dependsOn tasks.named('jar')
}
tasks.register("extractNativeLicenses", Copy) {
dependsOn configurations.nativeBundle
into "${buildDir}/extractedNativeLicenses"
from {
configurations.nativeBundle.files.collect { zipTree(it) }
}
include 'platform/licenses/**'
}
// Add an extra licenses directory to the combined notices
tasks.named('generateNotice').configure {
dependsOn "extractNativeLicenses"
inputs.dir("${project.buildDir}/extractedNativeLicenses/platform/licenses")
.withPropertyName('licensingDir')
.withPathSensitivity(PathSensitivity.RELATIVE)
licenseDirs.add(tasks.named("extractNativeLicenses").map {new File(it.destinationDir, "platform/licenses") })
}
tasks.named("dependencyLicenses").configure {
mapping from: /lucene-.*/, to: 'lucene'
}
addQaCheckDependencies(project)