use of org.hl7.elm.r1.Library 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;
}
use of org.hl7.elm.r1.Library in project atlas by alibaba.
the class AtlasDependencyGraph method clone.
public static DependencyGraphs clone(@NonNull DependencyGraphs dependencyGraphs, int modelLevel, boolean modelWithFullDependency) {
if (modelLevel < AndroidProject.MODEL_LEVEL_4_NEW_DEP_MODEL) {
return EMPTY_DEPENDENCY_GRAPH;
}
Preconditions.checkState(dependencyGraphs instanceof ConfigurationDependencyGraphs);
ConfigurationDependencyGraphs cdg = (ConfigurationDependencyGraphs) dependencyGraphs;
// these items are already ready for serializable, all we need to clone is
// the DependencyGraphs instance.
List<Library> libs = cdg.getLibraries();
synchronized (sGlobalLibrary) {
for (Library library : libs) {
sGlobalLibrary.put(library.getArtifactAddress(), library);
}
}
final List<GraphItem> nodes = cdg.getCompileDependencies();
if (modelWithFullDependency) {
return new FullDependencyGraphsImpl(nodes, nodes, ImmutableList.of(), ImmutableList.of());
}
// just need to register the libraries in the global libraries.
return new SimpleDependencyGraphsImpl(nodes, cdg.getProvidedLibraries());
}
use of org.hl7.elm.r1.Library in project cqf-ruler by DBCG.
the class IdsTest method testClassSupported.
@Test
public void testClassSupported() {
IIdType id = Ids.newId(org.hl7.fhir.dstu3.model.Library.class, "123");
assertTrue(id instanceof org.hl7.fhir.dstu3.model.IdType);
assertEquals("Library", id.getResourceType());
assertEquals("123", id.getIdPart());
}
use of org.hl7.elm.r1.Library in project cqf-ruler by DBCG.
the class LibrariesTest method libraryNoVersionReturnsNull.
@Test
public void libraryNoVersionReturnsNull() {
Library library = new Library();
String version = Libraries.getVersion(library);
assertNull(version);
}
use of org.hl7.elm.r1.Library in project cqf-ruler by DBCG.
the class LibrariesTest method libraryWithVersionReturnsVersion.
@Test
public void libraryWithVersionReturnsVersion() {
Library library = new Library().setVersion("1.0.0");
String version = Libraries.getVersion(library);
assertEquals("1.0.0", version);
}
Aggregations