Fixes up the "forbidden" warnings that you get when you import Elasticsearch using "import gradle projects". With this, and the manual step of switching circular project definitions to warnings this gets most thing *compiling*.
This commit is contained in:
parent
a70016a6d6
commit
c2a2fcb5a1
18
build.gradle
18
build.gradle
|
@ -17,15 +17,16 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
import com.avast.gradle.dockercompose.tasks.ComposePull
|
||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||
import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
import org.elasticsearch.gradle.BuildPlugin
|
||||
import org.elasticsearch.gradle.BwcVersions
|
||||
import org.elasticsearch.gradle.Version
|
||||
import org.elasticsearch.gradle.VersionProperties
|
||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
||||
import org.gradle.plugins.ide.eclipse.model.AccessRule
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
import org.gradle.util.DistributionLocator
|
||||
import org.gradle.util.GradleVersion
|
||||
|
@ -379,6 +380,21 @@ allprojects {
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Allow accessing com/sun/net/httpserver in projects that have
|
||||
* configured forbidden apis to allow it.
|
||||
*/
|
||||
plugins.withType(ForbiddenApisPlugin) {
|
||||
eclipse.classpath.file.whenMerged { classpath ->
|
||||
if (false == forbiddenApisTest.bundledSignatures.contains('jdk-non-portable')) {
|
||||
classpath.entries
|
||||
.findAll { it.kind == "con" && it.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER") }
|
||||
.each {
|
||||
it.accessRules.add(new AccessRule("accessible", "com/sun/net/httpserver/*"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File licenseHeaderFile
|
||||
String prefix = ':x-pack'
|
||||
|
|
|
@ -34,16 +34,3 @@ forbiddenApisTest {
|
|||
forbiddenPatterns {
|
||||
exclude '**/*.keystore'
|
||||
}
|
||||
|
||||
// Allow for com.sun.net.httpserver.* usage for testing
|
||||
eclipse {
|
||||
classpath.file {
|
||||
whenMerged { cp ->
|
||||
def con = entries.find { e ->
|
||||
e.kind == "con" && e.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER")
|
||||
}
|
||||
con.accessRules.add(new org.gradle.plugins.ide.eclipse.model.AccessRule(
|
||||
"accessible", "com/sun/net/httpserver/*"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue