Skip to content

Commit

Permalink
#318 Call Gradle on windows with cmd processor
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman authored and Gerd Aschemann (EXT) committed Nov 19, 2024
1 parent a4a639e commit 3017b30
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ version = htmlSanityCheckVersion
final String INTEGRATION_TEST_DIRECTORY_COMMON = "common"
final String INTEGRATION_TEST_DIRECTORY_COMMON_BUILD = "common/${BUILD_DIRECTORY}"

final static String gradleCall() {
return System.getProperty("os.name") ==~ /Windows.*/
? "..\\..\\gradlew.bat"
: "../../gradlew"
}

tasks.register("cleanIntegrationTestCommon", Delete) {
group("Build")
description("Deletes the common data for integration tests")
Expand All @@ -33,7 +27,11 @@ tasks.register("integrationTestPrepare") {
doLast {
def result = exec {
workingDir INTEGRATION_TEST_DIRECTORY_COMMON
commandLine (gradleCall(), "clean", "buildReadmeAll")
if (System.getProperty("os.name") ==~ /Windows.*/) {
commandLine('cmd', '/c', '..\\..\\gradlew.bat', "clean", "buildReadmeAll")
} else {
commandLine("../../gradlew", "clean", "buildReadmeAll")
}
}
logger.debug "Script output: $result"
}
Expand Down Expand Up @@ -69,7 +67,11 @@ tasks.register("integrationTestGradlePlugin") {
doLast {
def result = exec {
workingDir INTEGRATION_TEST_DIRECTORY_GRADLE_PLUGIN
commandLine (gradleCall(), "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}")
if (System.getProperty("os.name") ==~ /Windows.*/) {
commandLine('cmd', '/c', '..\\..\\gradlew.bat', "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}")
} else {
commandLine("../../gradlew", "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}")
}
}
logger.debug "Script output: $result"
assert testIndex.exists()
Expand Down

0 comments on commit 3017b30

Please sign in to comment.