Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run build-tools test with Gradle jdk #49459

Merged
merged 4 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import org.gradle.internal.jvm.Jvm
import org.gradle.util.GradleVersion

plugins {
Expand Down Expand Up @@ -223,8 +224,13 @@ if (project != rootProject) {
}
check.dependsOn(integTest)

// for now we hardcode the tests for our build to use the gradle jvm.
tasks.withType(Test).configureEach {
it.executable = Jvm.current().getJavaExecutable()
}

/*
* We alread configure publication and we don't need or want this one that
* We already configure publication and we don't need or want this one that
* comes from the java-gradle-plugin.
*/
afterEvaluate {
Expand Down
4 changes: 2 additions & 2 deletions gradle/runtime-jdk-provision.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jdks {
}
}

allprojects {
configure(allprojects - project(':build-tools')) {
project.tasks.withType(Test).configureEach { Test test ->
if (BuildParams.getIsRuntimeJavaHomeSet()) {
test.executable = "${BuildParams.runtimeJavaHome}/bin/java"
Expand All @@ -21,4 +21,4 @@ allprojects {
test.executable = rootProject.jdks.provisioned_runtime.getBinJavaPath()
}
}
}
}