Skip to content

Commit 8fc1253

Browse files
rmuirdweiss
andauthored
build: configure 3 retries for all gradle Download tasks (#14653)
* build: configure 3 retries for all gradle Download tasks The default value of retries is 0. Set it to 3, to improve reliability of downloads during builds. Closes #14652 * Configure all Download tasks at once. * Remove copy/pasted comment. --------- Co-authored-by: Dawid Weiss <[email protected]>
1 parent 009cf7d commit 8fc1253

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ apply from: file('gradle/documentation/markdown.gradle')
200200
apply from: file('gradle/documentation/render-javadoc.gradle')
201201
apply from: file('gradle/documentation/check-broken-links.gradle')
202202

203+
apply from: file('gradle/hacks/downloader-retries.gradle')
203204
apply from: file('gradle/hacks/gradle-archives.gradle')
204205
apply from: file('gradle/hacks/wipe-temp.gradle')
205206
apply from: file('gradle/hacks/hashmapAssertions.gradle')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
allprojects {project ->
19+
// Limit configuration to just those projects that actually have the plugin enabled.
20+
plugins.matching { Plugin plugin ->
21+
return plugin.class.name == "de.undercouch.gradle.tasks.download.DownloadTaskPlugin"
22+
}.configureEach {
23+
project.tasks.withType(Download).configureEach {
24+
it.retries 3
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)