[gradle][dependencies] don't try to deal with unstable dependencies in tools just in :dependencies:update task
This commit is contained in:
committed by
Vasily Levchenko
parent
4baeb5cb45
commit
ccc630d528
Vendored
+1
-1
@@ -201,7 +201,7 @@ class HelperNativeDep extends TgzNativeDep {
|
|||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void downloadAndExtract() {
|
public void downloadAndExtract() {
|
||||||
def downloader = new DependencyProcessor(baseOutDir, konanProperties, [baseName], baseUrl)
|
def downloader = new DependencyProcessor(baseOutDir, konanProperties, [baseName], baseUrl, false)
|
||||||
downloader.showInfo = false
|
downloader.showInfo = false
|
||||||
downloader.run()
|
downloader.run()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class DependencyProcessor(dependenciesRoot: File,
|
|||||||
val airplaneMode: Boolean = false,
|
val airplaneMode: Boolean = false,
|
||||||
maxAttempts: Int = DependencyDownloader.DEFAULT_MAX_ATTEMPTS,
|
maxAttempts: Int = DependencyDownloader.DEFAULT_MAX_ATTEMPTS,
|
||||||
attemptIntervalMs: Long = DependencyDownloader.DEFAULT_ATTEMPT_INTERVAL_MS,
|
attemptIntervalMs: Long = DependencyDownloader.DEFAULT_ATTEMPT_INTERVAL_MS,
|
||||||
customProgressCallback: ProgressCallback? = null) {
|
customProgressCallback: ProgressCallback? = null,
|
||||||
|
val keepUnstable:Boolean = true) {
|
||||||
|
|
||||||
val dependenciesDirectory = dependenciesRoot.apply { mkdirs() }
|
val dependenciesDirectory = dependenciesRoot.apply { mkdirs() }
|
||||||
val cacheDirectory = System.getProperty("user.home")?.let {
|
val cacheDirectory = System.getProperty("user.home")?.let {
|
||||||
@@ -85,22 +86,26 @@ class DependencyProcessor(dependenciesRoot: File,
|
|||||||
|
|
||||||
constructor(dependenciesRoot: File,
|
constructor(dependenciesRoot: File,
|
||||||
properties: KonanProperties,
|
properties: KonanProperties,
|
||||||
dependenciesUrl: String = properties.dependenciesUrl) : this(
|
dependenciesUrl: String = properties.dependenciesUrl,
|
||||||
|
keepUnstable:Boolean = true) : this(
|
||||||
dependenciesRoot,
|
dependenciesRoot,
|
||||||
properties.properties,
|
properties.properties,
|
||||||
properties.dependencies,
|
properties.dependencies,
|
||||||
dependenciesUrl)
|
dependenciesUrl,
|
||||||
|
keepUnstable = keepUnstable)
|
||||||
|
|
||||||
constructor(dependenciesRoot: File,
|
constructor(dependenciesRoot: File,
|
||||||
properties: Properties,
|
properties: Properties,
|
||||||
dependencies: List<String>,
|
dependencies: List<String>,
|
||||||
dependenciesUrl: String = properties.dependenciesUrl) : this(
|
dependenciesUrl: String = properties.dependenciesUrl,
|
||||||
|
keepUnstable:Boolean = true) : this(
|
||||||
dependenciesRoot,
|
dependenciesRoot,
|
||||||
dependenciesUrl,
|
dependenciesUrl,
|
||||||
dependencies,
|
dependencies,
|
||||||
airplaneMode = properties.airplaneMode,
|
airplaneMode = properties.airplaneMode,
|
||||||
maxAttempts = properties.downloadingAttempts,
|
maxAttempts = properties.downloadingAttempts,
|
||||||
attemptIntervalMs = properties.downloadingAttemptIntervalMs)
|
attemptIntervalMs = properties.downloadingAttemptIntervalMs,
|
||||||
|
keepUnstable = keepUnstable)
|
||||||
|
|
||||||
|
|
||||||
class DependencyFile(directory: File, fileName: String) {
|
class DependencyFile(directory: File, fileName: String) {
|
||||||
@@ -146,7 +151,7 @@ class DependencyProcessor(dependenciesRoot: File,
|
|||||||
depDir.isDirectory &&
|
depDir.isDirectory &&
|
||||||
depDir.list().isNotEmpty()) {
|
depDir.list().isNotEmpty()) {
|
||||||
|
|
||||||
if (depDir.list().contains(".unstable")) {
|
if (!keepUnstable && depDir.list().contains(".unstable")) {
|
||||||
// The downloaded version of the dependency is unstable -> redownload it.
|
// The downloaded version of the dependency is unstable -> redownload it.
|
||||||
depDir.deleteRecursively()
|
depDir.deleteRecursively()
|
||||||
archive.delete()
|
archive.delete()
|
||||||
|
|||||||
Reference in New Issue
Block a user