private boolean rtlApplies(@NonNull Context context) { Project project = context.getMainProject(); if (project.getTargetSdk() < RTL_API) { return false; } int buildTarget = project.getBuildSdk(); if (buildTarget != -1 && buildTarget < RTL_API) { return false; } //noinspection RedundantIfStatement if (mEnabledRtlSupport != null && !mEnabledRtlSupport) { return false; } return true; }
@Override public int getBuildSdk() { if (mocker != null) { String compileTarget = mocker.getProject().getCompileTarget(); //noinspection ConstantConditions if (compileTarget != null && !compileTarget.isEmpty()) { AndroidVersion version = AndroidTargetHash.getPlatformVersion(compileTarget); if (version != null) { return version.getApiLevel(); } } } return super.getBuildSdk(); }
private boolean rtlApplies(@NonNull Context context) { Project project = context.getMainProject(); if (project.getTargetSdk() < RTL_API) { return false; } int buildTarget = project.getBuildSdk(); if (buildTarget != -1 && buildTarget < RTL_API) { return false; } //noinspection RedundantIfStatement if (mEnabledRtlSupport != null && !mEnabledRtlSupport) { return false; } return true; }
/** * 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; }
@Override public void beforeCheckProject(@NonNull Context context) { mHasNativeLibs = false; mApplicationTagHandle = null; if (!context.getMainProject().isGradleProject() || context.getMainProject().getGradleModelVersion() == null) { mSuppress = true; return; } //compileSdkVersion must be >= 23 boolean projectSupportsAttribute = context.getMainProject().getBuildSdk() >= 23; //android gradle plugin must be 2.2.0+ GradleVersion gradleVersion = context.getMainProject().getGradleModelVersion(); boolean gradleSupportsAttribute = MIN_GRADLE_VERSION.compareIgnoringQualifiers(gradleVersion) <= 0; //suppress lint check if the compile SDK or the Gradle plugin are too old mSuppress = !projectSupportsAttribute || !gradleSupportsAttribute; }
if (project.getBuildSdk() >= 24) { File sdkHome = context.getClient().getSdkHome(); FileOp fileOp = FileOpUtils.create();
|| context.isEnabled(INLINED); boolean checkMethods = context.isEnabled(OVERRIDE) && context.getMainProject().getBuildSdk() >= 1; String frameworkParent = null; if (checkMethods) { int buildSdk = context.getMainProject().getBuildSdk(); String name = method.name; assert frameworkParent != null;
|| context.isEnabled(INLINED); boolean checkMethods = context.isEnabled(OVERRIDE) && context.getMainProject().getBuildSdk() >= 1; String frameworkParent = null; if (checkMethods) { int buildSdk = context.getMainProject().getBuildSdk(); String name = method.name; assert frameworkParent != null;
int buildSdk = mContext.getMainProject().getBuildSdk(); String name = method.getName(); JavaEvaluator evaluator = mContext.getEvaluator();
int compileSdkVersion = context.getProject().getBuildSdk(); if (compileSdkVersion == 23) { if (revision.getMajor() > 23 || revision.getMajor() == 23