Skip to content
Merged
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
29 changes: 23 additions & 6 deletions distribution/bwc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,34 @@ if (project.hasProperty('bwcVersion')) {
File bwcDeb = file("${checkoutDir}/distribution/deb/build/distributions/elasticsearch-${bwcVersion}.deb")
File bwcRpm = file("${checkoutDir}/distribution/rpm/build/distributions/elasticsearch-${bwcVersion}.rpm")
File bwcZip = file("${checkoutDir}/distribution/zip/build/distributions/elasticsearch-${bwcVersion}.zip")
task buildBwcVersion(type: GradleBuild) {
task buildBwcVersion(type: Exec) {
dependsOn checkoutBwcBranch, writeBuildMetadata
dir = checkoutDir
tasks = [':distribution:deb:assemble', ':distribution:rpm:assemble', ':distribution:zip:assemble']
startParameter.systemPropertiesArgs = ['build.snapshot': System.getProperty("build.snapshot") ?: "true"]
workingDir = checkoutDir
executable = new File(checkoutDir, 'gradlew').toString()
final ArrayList<String> commandLineArgs = [
":distribution:deb:assemble",
":distribution:rpm:assemble",
":distribution:zip:assemble",
"-Dbuild.snapshot=${System.getProperty('build.snapshot') ?: 'true'}"]
final LogLevel logLevel = gradle.startParameter.logLevel
if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) {
commandLineArgs << "--${logLevel.name().toLowerCase(Locale.ENGLISH)}"
}
final String showStacktraceName = gradle.startParameter.showStacktrace.name()
assert ["INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL"].contains(showStacktraceName)
if (showStacktraceName.equals("ALWAYS")) {
commandLineArgs << "--stacktrace"
} else if (showStacktraceName.equals("ALWAYS_FULL")) {
commandLineArgs << "--full-stacktrace"
}
args = commandLineArgs
doLast {
List missing = [bwcDeb, bwcRpm, bwcZip].grep { file ->
false == file.exists() }
false == file.exists()
}
if (false == missing.empty) {
throw new InvalidUserDataException(
"Building bwc version didn't generate expected files ${missing}")
"Building bwc version didn't generate expected files ${missing}")
}
}
}
Expand Down