|
|
@ -45,6 +45,7 @@ class DownloadPrebuiltBinaryFromGitHubAction extends DefaultTask { |
|
|
|
private String workflow |
|
|
|
private String workflow |
|
|
|
private List<String> branches = [] |
|
|
|
private List<String> branches = [] |
|
|
|
private boolean missingLibraryIsFailure |
|
|
|
private boolean missingLibraryIsFailure |
|
|
|
|
|
|
|
private int timeout |
|
|
|
|
|
|
|
|
|
|
|
private String githubAccessToken |
|
|
|
private String githubAccessToken |
|
|
|
private String variant |
|
|
|
private String variant |
|
|
@ -111,6 +112,10 @@ class DownloadPrebuiltBinaryFromGitHubAction extends DefaultTask { |
|
|
|
this.branches = branches |
|
|
|
this.branches = branches |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setTimeout(int timeout) { |
|
|
|
|
|
|
|
this.timeout = timeout |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map getCacheInfo() { |
|
|
|
private Map getCacheInfo() { |
|
|
|
if (cacheInfo == null) { |
|
|
|
if (cacheInfo == null) { |
|
|
|
LOCK.readLock().lock() |
|
|
|
LOCK.readLock().lock() |
|
|
@ -289,6 +294,9 @@ class DownloadPrebuiltBinaryFromGitHubAction extends DefaultTask { |
|
|
|
if (isOffline()) return Optional.empty() |
|
|
|
if (isOffline()) return Optional.empty() |
|
|
|
HttpURLConnection get = new URL(url).openConnection() as HttpURLConnection |
|
|
|
HttpURLConnection get = new URL(url).openConnection() as HttpURLConnection |
|
|
|
get.setRequestMethod("GET") |
|
|
|
get.setRequestMethod("GET") |
|
|
|
|
|
|
|
if (timeout >= 0) { |
|
|
|
|
|
|
|
get.setConnectTimeout(timeout) |
|
|
|
|
|
|
|
} |
|
|
|
githubAccessToken?.with { |
|
|
|
githubAccessToken?.with { |
|
|
|
get.setRequestProperty("Authorization", "token $it") |
|
|
|
get.setRequestProperty("Authorization", "token $it") |
|
|
|
} |
|
|
|
} |
|
|
@ -300,6 +308,7 @@ class DownloadPrebuiltBinaryFromGitHubAction extends DefaultTask { |
|
|
|
log("Could not fetch $url. Response code '$responseCode'.") |
|
|
|
log("Could not fetch $url. Response code '$responseCode'.") |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (IOException ignored) { |
|
|
|
} catch (IOException ignored) { |
|
|
|
|
|
|
|
error(ignored.getMessage()) |
|
|
|
} |
|
|
|
} |
|
|
|
return Optional.empty() |
|
|
|
return Optional.empty() |
|
|
|
} |
|
|
|
} |
|
|
|