[gradle][dependencies] don't try to deal with unstable dependencies in tools just in :dependencies:update task

This commit is contained in:
Vasily Levchenko
2017-12-08 11:59:53 +03:00
committed by Vasily Levchenko
parent 4baeb5cb45
commit ccc630d528
2 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -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()