Resolve BWC dependencies too when resolving deps
This will allow those to be cached too leading to faster builds and
fewer opportunity for network failures
@@ -134,7 +134,8 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
artifactFiles.add(file("${checkoutDir}/${baseDir}/${project}/build/distributions/elasticsearch-${bwcVersion}-SNAPSHOT.${project}"))
}
- task buildBwcVersion(type: Exec) {
+ Closure createRunBwcGradleTask = { name, extraConfig ->
+ task "$name"(type: Exec) {
dependsOn checkoutBwcBranch, writeBuildMetadata
workingDir = checkoutDir
doFirst {
@@ -169,9 +170,7 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
if (gradle.startParameter.isOffline()) {
args "--offline"
}
- for (String dir : projectDirs) {
- args ":${dir.replace('/', ':')}:assemble"
- }
+
args "-Dbuild.snapshot=true"
final LogLevel logLevel = gradle.startParameter.logLevel
if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) {
@@ -186,16 +185,28 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
}
standardOutput = new IndentingOutputStream(System.out, bwcVersion)
errorOutput = new IndentingOutputStream(System.err, bwcVersion)
+ configure extraConfig
+ }
+ }
+
+ createRunBwcGradleTask("buildBwcVersion") {
+ for (String dir : projectDirs) {
+ args ":${dir.replace('/', ':')}:assemble"
+ }
doLast {
List missing = artifactFiles.grep { file ->
false == file.exists()
}
if (false == missing.empty) {
- throw new InvalidUserDataException(
- "Building ${bwcVersion} didn't generate expected files ${missing}")
+ throw new InvalidUserDataException("Building ${bwcVersion} didn't generate expected files ${missing}")
+ }
}
}
+
+ createRunBwcGradleTask("resolveAllBwcDependencies") {
+ args 'resolveAllDependencies'
}
+ resolveAllDependencies.dependsOn resolveAllBwcDependencies
artifacts {
for (File artifactFile : artifactFiles) {
