Search in sources :

Example 1 with Library

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;
}
Also used : JavaLibraryImpl(com.android.build.gradle.internal.ide.level2.JavaLibraryImpl) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) JvmLibrary(org.gradle.jvm.JvmLibrary) Library(com.android.builder.model.level2.Library) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) File(java.io.File) com.android.build.gradle.internal.ide.level2(com.android.build.gradle.internal.ide.level2) NonNull(com.android.annotations.NonNull)

Example 2 with 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());
}
Also used : ConfigurationDependencyGraphs(com.android.build.gradle.internal.dependency.ConfigurationDependencyGraphs) GraphItem(com.android.builder.model.level2.GraphItem) JvmLibrary(org.gradle.jvm.JvmLibrary) Library(com.android.builder.model.level2.Library)

Example 3 with Library

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());
}
Also used : IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 4 with Library

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);
}
Also used : Library(org.hl7.fhir.r4.model.Library) Test(org.junit.jupiter.api.Test)

Example 5 with Library

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);
}
Also used : Library(org.hl7.fhir.r4.model.Library) Test(org.junit.jupiter.api.Test)

Aggregations

Library (org.hl7.fhir.r4.model.Library)130 Test (org.junit.Test)85 Measure (org.hl7.fhir.r4.model.Measure)60 Patient (org.hl7.fhir.r4.model.Patient)41 HashMap (java.util.HashMap)36 Test (org.junit.jupiter.api.Test)34 ArrayList (java.util.ArrayList)32 Library (org.hl7.fhir.dstu3.model.Library)23 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)21 ByteArrayOutputStream (java.io.ByteArrayOutputStream)21 CapabilityStatement (org.hl7.fhir.r4.model.CapabilityStatement)21 MeasureReport (org.hl7.fhir.r4.model.MeasureReport)21 StringType (org.hl7.fhir.r4.model.StringType)21 IOException (java.io.IOException)20 VersionedIdentifier (org.cqframework.cql.elm.execution.VersionedIdentifier)20 FhirContext (ca.uhn.fhir.context.FhirContext)19 IParser (ca.uhn.fhir.parser.IParser)19 MeasureEvidenceOptions (com.ibm.cohort.engine.measure.evidence.MeasureEvidenceOptions)19 Bundle (org.hl7.fhir.r4.model.Bundle)19 Parameter (com.ibm.cohort.cql.evaluation.parameters.Parameter)18