mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 20:59:58 +00:00
GP-0: Adding option to disable download progress output in
fetchDependencies.gradle
This commit is contained in:
parent
3c0e877da5
commit
403619065c
@ -51,6 +51,7 @@ ext.DOWNLOADS_DIR = file("${DEPS_DIR}/downloads")
|
|||||||
ext.FID_DIR = file("${DEPS_DIR}/fidb")
|
ext.FID_DIR = file("${DEPS_DIR}/fidb")
|
||||||
ext.FLAT_REPO_DIR = file("${DEPS_DIR}/flatRepo")
|
ext.FLAT_REPO_DIR = file("${DEPS_DIR}/flatRepo")
|
||||||
ext.OFFLINE = System.properties["offline"] != null
|
ext.OFFLINE = System.properties["offline"] != null
|
||||||
|
ext.HIDE_DOWNLOAD_PROGRESS = System.properties["hideDownloadProgress"] != null
|
||||||
ext.createdDirs = [] as Set
|
ext.createdDirs = [] as Set
|
||||||
|
|
||||||
file("${REPO_DIR}/Ghidra/application.properties").withReader { reader ->
|
file("${REPO_DIR}/Ghidra/application.properties").withReader { reader ->
|
||||||
@ -275,17 +276,22 @@ def download(url, file) {
|
|||||||
def dataBuffer = new byte[1024];
|
def dataBuffer = new byte[1024];
|
||||||
int bytesRead;
|
int bytesRead;
|
||||||
int totalRead;
|
int totalRead;
|
||||||
|
if (HIDE_DOWNLOAD_PROGRESS) {
|
||||||
|
print " Downloading..."
|
||||||
|
}
|
||||||
while ((bytesRead = istream.read(dataBuffer, 0, 1024)) != -1) {
|
while ((bytesRead = istream.read(dataBuffer, 0, 1024)) != -1) {
|
||||||
ostream.write(dataBuffer, 0, bytesRead);
|
ostream.write(dataBuffer, 0, bytesRead);
|
||||||
totalRead += bytesRead
|
totalRead += bytesRead
|
||||||
print "\r"
|
if (!HIDE_DOWNLOAD_PROGRESS) {
|
||||||
print " Downloading: " + totalRead + " of " + size
|
print "\r"
|
||||||
if (!size.equals("???")) {
|
print " Downloading: " + totalRead + " of " + size
|
||||||
int pctComplete = (totalRead / size) * 100
|
if (!size.equals("???")) {
|
||||||
print " (" + pctComplete + "%)"
|
int pctComplete = (totalRead / size) * 100
|
||||||
|
print " (" + pctComplete + "%)"
|
||||||
|
}
|
||||||
|
print " " // overwrite gradle timer output
|
||||||
|
System.out.flush()
|
||||||
}
|
}
|
||||||
print " " // overwrite gradle timer output
|
|
||||||
System.out.flush()
|
|
||||||
}
|
}
|
||||||
println()
|
println()
|
||||||
istream.close();
|
istream.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user