use of org.jetbrains.android.compiler.artifact.AndroidApplicationArtifactType in project android by JetBrains.
the class AndroidBuildTargetScopeProvider method isProGuardUsed.
private static boolean isProGuardUsed(@NotNull Project project, @NotNull CompileScope scope) {
for (Module module : scope.getAffectedModules()) {
final AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null && facet.getProperties().RUN_PROGUARD) {
return true;
}
}
final String proguardCfgPathsStr = scope.getUserData(AndroidCompileUtil.PROGUARD_CFG_PATHS_KEY);
if (proguardCfgPathsStr != null && proguardCfgPathsStr.length() > 0) {
return true;
}
final Set<Artifact> artifacts = ArtifactCompileScope.getArtifactsToBuild(project, scope, false);
for (Artifact artifact : artifacts) {
if (artifact.getArtifactType() instanceof AndroidApplicationArtifactType) {
final ArtifactProperties<?> properties = artifact.getProperties(AndroidArtifactPropertiesProvider.getInstance());
if (properties instanceof AndroidApplicationArtifactProperties) {
final AndroidApplicationArtifactProperties p = (AndroidApplicationArtifactProperties) properties;
if (p.isRunProGuard()) {
return true;
}
}
}
}
return false;
}
Aggregations