File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,24 @@ subprojects {
217
217
}
218
218
check. dependsOn checkNotice
219
219
220
+ if (project. name == ' zip' || project. name == ' tar' ) {
221
+ task checkMlCppNotice {
222
+ dependsOn buildDist, checkExtraction
223
+ onlyIf toolExists
224
+ doLast {
225
+ // this is just a small sample from the C++ notices, the idea being that if we've added these lines we've probably added all the required lines
226
+ final List<String > expectedLines = Arrays . asList(" Apache log4cxx" , " Boost Software License - Version 1.0 - August 17th, 2003" )
227
+ final Path noticePath = archiveExtractionDir. toPath(). resolve(" elasticsearch-${ VersionProperties.elasticsearch} /modules/x-pack/x-pack-ml/NOTICE.txt" )
228
+ final List<String > actualLines = Files . readAllLines(noticePath)
229
+ for (final String expectedLine : expectedLines) {
230
+ if (actualLines. contains(expectedLine) == false ) {
231
+ throw new GradleException (" expected [${ noticePath} ] to contain [${ expectedLine} ] but it did not" )
232
+ }
233
+ }
234
+ }
235
+ }
236
+ check. dependsOn checkMlCppNotice
237
+ }
220
238
}
221
239
222
240
/* ****************************************************************************
Original file line number Diff line number Diff line change @@ -64,6 +64,23 @@ artifacts {
64
64
testArtifacts testJar
65
65
}
66
66
67
+ task extractNativeLicenses (type : Copy ) {
68
+ dependsOn configurations. nativeBundle
69
+ into " ${ buildDir} "
70
+ from {
71
+ project. zipTree(configurations. nativeBundle. singleFile)
72
+ }
73
+ include ' platform/licenses/**'
74
+ }
75
+ project. afterEvaluate {
76
+ // Add an extra licenses directory to the combined notices
77
+ project. tasks. findByName(' generateNotice' ). dependsOn extractNativeLicenses
78
+ project. tasks. findByName(' generateNotice' ). licensesDir new File (" ${ project.buildDir} /platform/licenses" )
79
+ project. tasks. findByName(' generateNotice' ). outputs. upToDateWhen {
80
+ extractNativeLicenses. state. upToDate
81
+ }
82
+ }
83
+
67
84
run {
68
85
plugin xpackModule(' core' )
69
86
}
@@ -85,7 +102,7 @@ task internalClusterTest(type: RandomizedTestingTask,
85
102
include ' **/*IT.class'
86
103
systemProperty ' es.set.netty.runtime.available.processors' , ' false'
87
104
}
88
- check. dependsOn internalClusterTest
105
+ check. dependsOn internalClusterTest
89
106
internalClusterTest. mustRunAfter test
90
107
91
108
// also add an "alias" task to make typing on the command line easier
You can’t perform that action at this time.
0 commit comments