@Override public boolean equals(Object obj) { return obj instanceof AddonTarget && compareTo((AddonTarget)obj) == 0; }
@Override public File getFile(int pathId) { return new File(getPath(pathId)); }
@Override public int compareTo(@NonNull IAndroidTarget target) { // quick check. if (this == target) { return 0; } int versionDiff = getVersion().compareTo(target.getVersion()); // only if the versions are the same do we care about platform/add-ons. if (versionDiff == 0) { // platforms go before add-ons. if (target.isPlatform()) { return +1; } else { AddonTarget targetAddOn = (AddonTarget) target; // both are add-ons of the same version. Compare per vendor then by name int vendorDiff = getVendor().compareTo(targetAddOn.getVendor()); if (vendorDiff == 0) { return getName().compareTo(targetAddOn.getName()); } else { return vendorDiff; } } } return versionDiff; }
@Override public boolean canRunOn(IAndroidTarget target) { // basic test if (target == this) { return true; } // The receiver is an add-on. There are 2 big use cases: The add-on has libraries // or the add-on doesn't (in which case we consider it a platform). if (getAdditionalLibraries().isEmpty()) { return mBasePlatform.canRunOn(target); } else { // the only targets that can run the receiver are the same add-on in the same or later // versions. // first check: vendor/name if (!getVendor().equals(target.getVendor()) || !getName().equals(target.getName())) { return false; } // now check the version. At this point since we checked the add-on part, // we can revert to the basic check on version/codename which are done by the // base platform already. return mBasePlatform.canRunOn(target); } }
mDefaultSkin = new File(getPath(SKINS), defaultSkinName); } else { if (getSkins().length == 1) { mDefaultSkin = getSkins()[0]; } else { mDefaultSkin = mBasePlatform.getDefaultSkin(); mAdditionalLibraries = parseAdditionalLibraries(p, progress, fop);
@Override public String getShortClasspathName() { return String.format("%1$s [%2$s]", getName(), mBasePlatform.getVersionName()); }
@Override public int hashCode() { return hashString().hashCode(); } }
PlatformTarget baseTarget = platformTargets.get(addonVersion); if (baseTarget != null) { tempTargetToPackage.put(new AddonTarget(p, baseTarget, mSdkHandler.getSystemImageManager(progress), progress, mFop), p);
@Override public String getClasspathName() { return String.format("%1$s [%2$s]", getName(), mBasePlatform.getClasspathName()); }