Fix Gradle wrapper usage on Windows when building BWC (elastic/x-pack-elasticsearch#3509)
Relates elastic/x-pack-elasticsearch#3502
Original commit: elastic/x-pack-elasticsearch@63447693f70ae439c49c2c967220cc40696799be
@@ -186,7 +186,12 @@ subprojects {
task buildBwcVersion(type: Exec) {
dependsOn checkoutXPackBwcBranch, checkoutElasticsearchBwcBranch, writeElasticsearchBuildMetadata, writeXPackBuildMetadata
workingDir = xpackCheckoutDir
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+ executable 'cmd'
+ args '/C', 'call', new File(xpackCheckoutDir, 'gradlew').toString()
+ } else {
executable = new File(xpackCheckoutDir, 'gradlew').toString()
+ }
final ArrayList<String> commandLineArgs = [":x-pack-elasticsearch:plugin:assemble"]
final LogLevel logLevel = gradle.startParameter.logLevel
if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) {
@@ -199,7 +204,7 @@ subprojects {
} else if (showStacktraceName.equals("ALWAYS_FULL")) {
commandLineArgs << "--full-stacktrace"
}
- args = commandLineArgs
+ args commandLineArgs
}
artifacts {
