|| target.getVersion().getApiLevel() > latestTarget.getVersion().getApiLevel() )
/** * Returns whether the compilation target is a preview. */ public boolean isPreviewTarget() { checkState(mTargetInfo != null, "Cannot call isTargetAPreview() before setTargetInfo() is called."); return mTargetInfo.getTarget().getVersion().isPreview(); }
/** * Returns whether the compilation target is a preview. */ public boolean isPreviewTarget() { checkState(mTargetInfo != null, "Cannot call isTargetAPreview() before setTargetInfo() is called."); return mTargetInfo.getTarget().getVersion().isPreview(); }
public String getTargetCodename() { checkState(mTargetInfo != null, "Cannot call getTargetCodename() before setTargetInfo() is called."); return mTargetInfo.getTarget().getVersion().getCodename(); }
public String getTargetCodename() { checkState(mTargetInfo != null, "Cannot call getTargetCodename() before setTargetInfo() is called."); return mTargetInfo.getTarget().getVersion().getCodename(); }
@Override public int compareTo(IAndroidTarget o) { return getVersion().compareTo(o.getVersion()); } }
@Override public String hashString() { return String.format(AndroidTargetHash.ADD_ON_FORMAT, getVendor(), getName(), mBasePlatform.getVersion().getApiString()); }
/** * Returns the highest known API level. * * @return the highest known API level */ public int getHighestKnownApiLevel() { int max = SdkVersionInfo.HIGHEST_KNOWN_STABLE_API; for (IAndroidTarget target : getTargets()) { if (target.isPlatform()) { int api = target.getVersion().getApiLevel(); if (api > max && !target.getVersion().isPreview()) { max = api; } } } return max; }
/** * Returns the hash string for a given target (add-on or platform.) * * @param target A non-null target. * @return A non-null hash string uniquely representing this target. */ public static String getTargetHashString(@NonNull IAndroidTarget target) { if (target.isPlatform()) { return getPlatformHashString(target.getVersion()); } else { return getAddonHashString( target.getVendor(), target.getName(), target.getVersion()); } }
@Override public boolean canRunOn(@NonNull IAndroidTarget target) { if (getVersion().isPreview()) { return target.getVersion().equals(getVersion()); } return target.getVersion().getApiLevel() > getVersion().getApiLevel(); }
@Override public int compareTo(@NonNull IAndroidTarget o) { int res = getVersion().compareTo(o.getVersion()); if (res != 0) { return res; } return o.isPlatform() ? 0 : -1; }
/** * Returns first target found with API level no lower than the minimum provided. * @param minimumApiLevel minimum api level desired for target. * @param progress progress indicator. * @return a matching {@link IAndroidTarget} or null */ @Nullable public IAndroidTarget getTargetOfAtLeastApiLevel( int minimumApiLevel, @NonNull ProgressIndicator progress) { for (IAndroidTarget target : getTargets(progress)) { if (target.getVersion().getApiLevel() >= minimumApiLevel) { return target; } } return null; }
@NonNull public static ImmutableList<File> computeFullBootClasspath( @NonNull IAndroidTarget target, @NonNull File annotationsJar) { Preconditions.checkNotNull(target); Preconditions.checkNotNull(annotationsJar); ImmutableList.Builder<File> classpath = ImmutableList.builder(); for (String p : target.getBootClasspath()) { classpath.add(new File(p)); } // add additional libraries if any List<IAndroidTarget.OptionalLibrary> libs = target.getAdditionalLibraries(); for (IAndroidTarget.OptionalLibrary lib : libs) { File jar = lib.getJar(); Verify.verify(jar != null, "Jar missing from additional library %s.", lib.getName()); classpath.add(jar); } // add optional libraries if any List<IAndroidTarget.OptionalLibrary> optionalLibraries = target.getOptionalLibraries(); for (IAndroidTarget.OptionalLibrary lib : optionalLibraries) { File jar = lib.getJar(); Verify.verify(jar != null, "Jar missing from optional library %s.", lib.getName()); classpath.add(jar); } // add annotations.jar if needed. if (target.getVersion().getApiLevel() <= 15) { classpath.add(annotationsJar); } return classpath.build(); }
if (target.getVersion().getApiLevel() <= 15) { classpath.add(annotationsJar);
if (target.getVersion().getApiLevel() <= 15) { classpath.add(mSdkInfo.getAnnotationsJar());
@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; }
/** * Returns the compile target to use for the given project * * @param project the project in question * * @return the compile target to use to build the given project */ @Nullable public IAndroidTarget getCompileTarget(@NonNull Project project) { int buildSdk = project.getBuildSdk(); IAndroidTarget[] targets = getTargets(); for (int i = targets.length - 1; i >= 0; i--) { IAndroidTarget target = targets[i]; if (target.isPlatform() && target.getVersion().getApiLevel() == buildSdk) { return target; } } return null; }
IAndroidTarget androidTarget = androidBuilder.getTargetInfo().getTarget(); AndroidVersion version = androidTarget.getVersion(); if (version.getCodename() != null) { sdkVersionOverride = ApiVersionImpl.clone(version);
IAndroidTarget androidTarget = androidBuilder.getTargetInfo().getTarget(); AndroidVersion version = androidTarget.getVersion(); if (version.getCodename() != null) { sdkVersionOverride = ApiVersionImpl.clone(version);
AndroidGradleOptions.getTargetFeatureLevel(getGlobalScope().getProject()); if (androidBuilderTarget.getVersion().getFeatureLevel() == targetDeviceFeatureLevel) {