File tree 2 files changed +17
-14
lines changed
x-pack/plugin/sql/sql-client
2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 17
17
* under the License.
18
18
*/
19
19
20
-
21
20
import com.avast.gradle.dockercompose.tasks.ComposePull
22
21
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
22
+ import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin
23
23
import org.apache.tools.ant.taskdefs.condition.Os
24
24
import org.elasticsearch.gradle.BuildPlugin
25
25
import org.elasticsearch.gradle.BwcVersions
26
26
import org.elasticsearch.gradle.Version
27
27
import org.elasticsearch.gradle.VersionProperties
28
28
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
29
+ import org.gradle.plugins.ide.eclipse.model.AccessRule
29
30
import org.gradle.plugins.ide.eclipse.model.SourceFolder
30
31
import org.gradle.util.DistributionLocator
31
32
import org.gradle.util.GradleVersion
@@ -378,6 +379,21 @@ allprojects {
378
379
}
379
380
}
380
381
}
382
+ /*
383
+ * Allow accessing com/sun/net/httpserver in projects that have
384
+ * configured forbidden apis to allow it.
385
+ */
386
+ plugins. withType(ForbiddenApisPlugin ) {
387
+ eclipse. classpath. file. whenMerged { classpath ->
388
+ if (false == forbiddenApisTest. bundledSignatures. contains(' jdk-non-portable' )) {
389
+ classpath. entries
390
+ .findAll { it. kind == " con" && it. toString(). contains(" org.eclipse.jdt.launching.JRE_CONTAINER" ) }
391
+ .each {
392
+ it. accessRules. add(new AccessRule (" accessible" , " com/sun/net/httpserver/*" ))
393
+ }
394
+ }
395
+ }
396
+ }
381
397
382
398
File licenseHeaderFile
383
399
String prefix = ' :x-pack'
Original file line number Diff line number Diff line change @@ -34,16 +34,3 @@ forbiddenApisTest {
34
34
forbiddenPatterns {
35
35
exclude ' **/*.keystore'
36
36
}
37
-
38
- // Allow for com.sun.net.httpserver.* usage for testing
39
- eclipse {
40
- classpath. file {
41
- whenMerged { cp ->
42
- def con = entries. find { e ->
43
- e. kind == " con" && e. toString(). contains(" org.eclipse.jdt.launching.JRE_CONTAINER" )
44
- }
45
- con. accessRules. add(new org.gradle.plugins.ide.eclipse.model.AccessRule (
46
- " accessible" , " com/sun/net/httpserver/*" ))
47
- }
48
- }
49
- }
You can’t perform that action at this time.
0 commit comments