Skip to content

Commit

Permalink
Deal with fallout from merging elastic#41989
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed May 21, 2019
1 parent 3907284 commit 69952e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 34 deletions.
22 changes: 0 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -619,25 +619,3 @@ allprojects {
}
}
}

// wait until global info is populated because we don't know if we are running in a fips jvm until execution time
globalInfo.ready {
subprojects {
// Common config when running with a FIPS-140 runtime JVM
if (project.ext.has("inFipsJvm") && project.ext.inFipsJvm) {
tasks.withType(Test) {
systemProperty 'javax.net.ssl.trustStorePassword', 'password'
systemProperty 'javax.net.ssl.keyStorePassword', 'password'
}
project.pluginManager.withPlugin("elasticsearch.testclusters") {
project.testClusters.all {
systemProperty 'javax.net.ssl.trustStorePassword', 'password'
systemProperty 'javax.net.ssl.keyStorePassword', 'password'
}
}
}
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import org.apache.commons.io.IOUtils
import org.apache.tools.ant.taskdefs.condition.Os
import org.eclipse.jgit.lib.Constants
import org.eclipse.jgit.lib.RepositoryBuilder
import org.elasticsearch.gradle.info.GlobalBuildInfoPlugin
import org.elasticsearch.gradle.info.GlobalInfoExtension
import org.elasticsearch.gradle.info.JavaHome
import org.elasticsearch.gradle.precommit.DependencyLicensesTask
import org.elasticsearch.gradle.precommit.PrecommitTasks
import org.elasticsearch.gradle.test.ErrorReportingTestListener
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.gradle.api.Action
import org.gradle.api.GradleException
import org.gradle.api.InvalidUserDataException
import org.gradle.api.JavaVersion
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
Expand Down Expand Up @@ -137,20 +139,31 @@ class BuildPlugin implements Plugin<Project> {
configureDependenciesInfo(project)

// Common config when running with a FIPS-140 runtime JVM
// Need to do it here to support external plugins
if (project.ext.inFipsJvm) {
project.tasks.withType(Test) {
systemProperty 'javax.net.ssl.trustStorePassword', 'password'
systemProperty 'javax.net.ssl.keyStorePassword', 'password'
}
project.pluginManager.withPlugin("elasticsearch.testclusters") {
project.testClusters.all {
systemProperty 'javax.net.ssl.trustStorePassword', 'password'
systemProperty 'javax.net.ssl.keyStorePassword', 'password'
// Need to do it here to support external plugins
if (project == project.rootProject) {
GlobalInfoExtension globalInfo = project.extensions.getByType(GlobalInfoExtension)

// wait until global info is populated because we don't know if we are running in a fips jvm until execution time
globalInfo.ready {
project.subprojects { Project subproject ->
ExtraPropertiesExtension ext = subproject.extensions.getByType(ExtraPropertiesExtension)
// Common config when running with a FIPS-140 runtime JVM
if (ext.has('inFipsJvm') && ext.get('inFipsJvm')) {
subproject.tasks.withType(Test) { Test task ->
task.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
task.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
}
project.pluginManager.withPlugin("elasticsearch.testclusters") {
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = subproject.extensions.getByName('testClusters') as NamedDomainObjectContainer<ElasticsearchCluster>
testClusters.all { ElasticsearchCluster cluster ->
cluster.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
cluster.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
}
}
}
}
}
}

}

static void requireDocker(final Task task) {
Expand Down

0 comments on commit 69952e2

Please sign in to comment.