tools: Fix path to dependencies
This commit is contained in:
@@ -31,8 +31,8 @@ class DependencyDownloader(dependenciesRoot: File, val properties: Properties, v
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processDependency(path: String) {
|
private fun processDependency(dependency: String) {
|
||||||
val depDir = File(path)
|
val depDir = File(dependenciesRoot, dependency)
|
||||||
val depName = depDir.name
|
val depName = depDir.name
|
||||||
val inListFile = listFile.containsLine(depName)
|
val inListFile = listFile.containsLine(depName)
|
||||||
if (inListFile && depDir.exists()) {
|
if (inListFile && depDir.exists()) {
|
||||||
@@ -43,7 +43,6 @@ class DependencyDownloader(dependenciesRoot: File, val properties: Properties, v
|
|||||||
isInfoShown = true
|
isInfoShown = true
|
||||||
}
|
}
|
||||||
val downloaded = download(depName)
|
val downloaded = download(depName)
|
||||||
println("Extract dependency: $downloaded -> $depDir")
|
|
||||||
extract(downloaded)
|
extract(downloaded)
|
||||||
if (!inListFile) {
|
if (!inListFile) {
|
||||||
listFile.appendText("$depName\n")
|
listFile.appendText("$depName\n")
|
||||||
@@ -51,6 +50,7 @@ class DependencyDownloader(dependenciesRoot: File, val properties: Properties, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun extract(tarGz: File) {
|
private fun extract(tarGz: File) {
|
||||||
|
println("Extract dependency: ${tarGz.canonicalPath}")
|
||||||
val tarProcess = ProcessBuilder().apply {
|
val tarProcess = ProcessBuilder().apply {
|
||||||
command("tar", "-xzf", "${tarGz.canonicalPath}")
|
command("tar", "-xzf", "${tarGz.canonicalPath}")
|
||||||
directory(tarGz.parentFile)
|
directory(tarGz.parentFile)
|
||||||
@@ -109,7 +109,6 @@ class DependencyDownloader(dependenciesRoot: File, val properties: Properties, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Improve console logging
|
// TODO: Improve console logging
|
||||||
var msgLen = 0
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
Thread.sleep(1000) // We can use condition variable here.
|
Thread.sleep(1000) // We can use condition variable here.
|
||||||
updateProgressMsg(url.toString(), currentBytes, totalBytes)
|
updateProgressMsg(url.toString(), currentBytes, totalBytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user