use of com.android.build.gradle.internal.ide.level2.JavaLibraryImpl in project atlas by alibaba.
the class AtlasDependencyGraph method instantiateLibrary.
@NonNull
private static Library instantiateLibrary(@NonNull AtlasDependencyGraph.HashableResolvedArtifactResult artifact) {
Library library;
ComponentIdentifier id = artifact.getId().getComponentIdentifier();
String address = AtlasDependencyGraph.computeAddress(artifact);
if (!(id instanceof ProjectComponentIdentifier) || artifact.isWrappedModule()) {
if (artifact.getDependencyType() == DependencyType.ANDROID || artifact.getDependencyType() == DependencyType.AWB) {
File explodedFolder = artifact.getFile();
library = new com.android.build.gradle.internal.ide.level2.AndroidLibraryImpl(address, artifact.bundleResult != null ? artifact.bundleResult.getFile() : // fallback so that the value is non-null
explodedFolder, explodedFolder, findLocalJarsAsStrings(explodedFolder));
} else {
library = new JavaLibraryImpl(address, artifact.getFile());
}
} else {
library = new ModuleLibraryImpl(address, ((ProjectComponentIdentifier) id).getProjectPath(), getVariant(artifact));
}
synchronized (sGlobalLibrary) {
sGlobalLibrary.put(library.getArtifactAddress(), library);
}
return library;
}
Aggregations