mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 06:51:17 +07:00
IDEA-79737 support for circular dependencies between android libraries with the same package
This commit is contained in:
@@ -211,7 +211,7 @@ public class AndroidAptCompiler implements SourceGeneratingCompiler {
|
||||
AndroidFacet facet = AndroidFacet.getInstance(module);
|
||||
if (facet != null) {
|
||||
AndroidFacetConfiguration configuration = facet.getConfiguration();
|
||||
if (!isToCompileModule(module, configuration)) {
|
||||
if (!isToCompileModule(module, configuration) || hasBadCircularDependencies(facet)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -261,6 +261,40 @@ public class AndroidAptCompiler implements SourceGeneratingCompiler {
|
||||
return items.toArray(new GenerationItem[items.size()]);
|
||||
}
|
||||
|
||||
|
||||
// see IDEA-79737 for details
|
||||
private static boolean hasBadCircularDependencies(@NotNull AndroidFacet facet) {
|
||||
final List<AndroidFacet> dependencies = AndroidSdkUtils.getAllAndroidDependencies(facet.getModule(), true);
|
||||
|
||||
final Manifest manifest = facet.getManifest();
|
||||
if (manifest == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final String aPackage = manifest.getPackage().getValue();
|
||||
if (aPackage == null || aPackage.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (AndroidFacet depFacet : dependencies) {
|
||||
final Manifest depManifest = depFacet.getManifest();
|
||||
|
||||
if (depManifest != null) {
|
||||
if (!aPackage.equals(depManifest.getPackage().getValue())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
final List<AndroidFacet> depDependencies = AndroidSdkUtils.getAllAndroidDependencies(depFacet.getModule(), true);
|
||||
|
||||
if (depDependencies.contains(facet) &&
|
||||
dependencies.contains(depFacet) &&
|
||||
depFacet.getModule().getName().compareTo(facet.getModule().getName()) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String[] getLibPackages(@NotNull Module module, @NotNull String packageName) {
|
||||
final Set<String> packageSet = new HashSet<String>();
|
||||
|
||||
Reference in New Issue
Block a user