summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsteban de la Canal <estebandlc@google.com>2015-06-03 16:47:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-06-03 16:50:19 +0000
commitac51ec3bb34a709ac9dfe5aca5162649bb5cd06a (patch)
treebd7edc53eace7b8a0520ce8d846ba480a53c99ad
parentb1164a2b62b6716790724fb3d6ae8228493f72f0 (diff)
parent0caced7f60b4b3787763b176949794295a961b14 (diff)
downloadbase-ac51ec3bb34a709ac9dfe5aca5162649bb5cd06a.tar.gz
Merge "Don't compute preview platform tools as a dependency for non-preview tools" into studio-1.2-dev
-rwxr-xr-xsdklib/src/main/java/com/android/sdklib/internal/repository/updater/SdkUpdaterLogic.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/sdklib/src/main/java/com/android/sdklib/internal/repository/updater/SdkUpdaterLogic.java b/sdklib/src/main/java/com/android/sdklib/internal/repository/updater/SdkUpdaterLogic.java
index 0dc9df07af..2ceb0e52f4 100755
--- a/sdklib/src/main/java/com/android/sdklib/internal/repository/updater/SdkUpdaterLogic.java
+++ b/sdklib/src/main/java/com/android/sdklib/internal/repository/updater/SdkUpdaterLogic.java
@@ -871,6 +871,10 @@ public class SdkUpdaterLogic {
Package p = a.getParentPackage();
if (p instanceof PlatformToolPackage) {
FullRevision r = ((PlatformToolPackage) p).getRevision();
+ // If computing dependencies for a non-preview package, don't offer preview dependencies
+ if (r.isPreview() && !rev.isPreview()) {
+ continue;
+ }
if (r.compareTo(localRev) >= compareThreshold) {
localRev = r;
localAiMax = ai;
@@ -897,6 +901,11 @@ public class SdkUpdaterLogic {
Package p = a.getParentPackage();
if (p instanceof PlatformToolPackage) {
FullRevision r = ((PlatformToolPackage) p).getRevision();
+ // If computing dependencies for a non-preview package, don't offer preview dependencies
+ if (r.isPreview() && !rev.isPreview()) {
+ continue;
+ }
+
if (r.compareTo(localRev) >= compareThreshold) {
localRev = r;
localAiMax = null;
@@ -929,6 +938,11 @@ public class SdkUpdaterLogic {
for (Package p : remotePkgs) {
if (p instanceof PlatformToolPackage) {
FullRevision r = ((PlatformToolPackage) p).getRevision();
+ // If computing dependencies for a non-preview package, don't offer preview dependencies
+ if (r.isPreview() && !rev.isPreview()) {
+ continue;
+ }
+
if (r.compareTo(rev) >= 0) {
// Make sure there's at least one valid archive here
for (Archive a : p.getArchives()) {