Merge branch '2.6.x' into 2.7.x

Closes gh-29073
pull/29090/head
Scott Frederick 3 years ago
commit a773af0387

@ -18,8 +18,10 @@ package org.springframework.boot.build.test;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.testing.Test;
@ -35,6 +37,8 @@ import org.gradle.plugins.ide.eclipse.model.EclipseModel;
*/
public class SystemTestPlugin implements Plugin<Project> {
private static final Spec<Task> NEVER = (task) -> false;
/**
* Name of the {@code systemTest} task.
*/
@ -78,6 +82,13 @@ public class SystemTestPlugin implements Plugin<Project> {
systemTest.setTestClassesDirs(systemTestSourceSet.getOutput().getClassesDirs());
systemTest.setClasspath(systemTestSourceSet.getRuntimeClasspath());
systemTest.shouldRunAfter(JavaPlugin.TEST_TASK_NAME);
if (isCi()) {
systemTest.getOutputs().upToDateWhen(NEVER);
}
}
private boolean isCi() {
return Boolean.parseBoolean(System.getenv("CI"));
}
}

@ -5,8 +5,8 @@ source $(dirname $0)/common.sh
pushd git-repo > /dev/null
if [[ -d /opt/openjdk-toolchain ]]; then
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 --rerun-tasks systemTest -PtoolchainVersion=${TOOLCHAIN_JAVA_VERSION} -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.paths=/opt/openjdk-toolchain/
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 systemTest -PtoolchainVersion=${TOOLCHAIN_JAVA_VERSION} -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.paths=/opt/openjdk-toolchain/
else
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 --rerun-tasks systemTest
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 systemTest
fi
popd > /dev/null

Loading…
Cancel
Save