rename package cache operations for clarity + new release

This commit is contained in:
Grahame Grieve 2019-02-01 06:11:01 +11:00
commit 8a9987b88f
7 changed files with 38 additions and 10 deletions

5
.editorconfig Normal file
View File

@ -0,0 +1,5 @@
[*.java]
charset = utf-8
indent_style = space
indent_size = 2

View File

@ -17,11 +17,11 @@
<!-- HAPI Dependencies --> <!-- HAPI Dependencies -->
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId> <artifactId>org.hl7.fhir.utilities</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId> <artifactId>hapi-fhir-base</artifactId>
</dependency> </dependency>
<!-- UCUM --> <!-- UCUM -->

View File

@ -13,6 +13,8 @@ import java.util.Set;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.codec.Charsets;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.dstu3.conformance.ProfileUtilities; import org.hl7.fhir.dstu3.conformance.ProfileUtilities;
import org.hl7.fhir.dstu3.context.SimpleWorkerContext; import org.hl7.fhir.dstu3.context.SimpleWorkerContext;
import org.hl7.fhir.dstu3.formats.IParser.OutputStyle; import org.hl7.fhir.dstu3.formats.IParser.OutputStyle;
@ -195,9 +197,10 @@ public class SnapShotGenerationTests {
private static FHIRPathEngine fp; private static FHIRPathEngine fp;
@Parameters(name = "{index}: file {0}") @Parameters(name = "{index}: file {0}")
public static Iterable<Object[]> data() throws ParserConfigurationException, IOException, FHIRFormatError { public static Iterable<Object[]> data() throws IOException, FHIRFormatError {
SnapShotGenerationTestsContext context = new SnapShotGenerationTestsContext(); SnapShotGenerationTestsContext context = new SnapShotGenerationTestsContext();
context.tests = (TestScript) new XmlParser().parse(new FileInputStream(Utilities.path(TestingUtilities.home(), "tests", "resources", "snapshot-generation-tests.xml"))); String contents = readFileFromClasspathAsString("snapshot-generation-tests.xml");
context.tests = (TestScript) new XmlParser().parse(contents);
context.checkTestsDetails(); context.checkTestsDetails();
@ -209,6 +212,10 @@ public class SnapShotGenerationTests {
return objects; return objects;
} }
private static String readFileFromClasspathAsString(String theClasspath) throws IOException {
return IOUtils.toString(SnapShotGenerationTests.class.getResourceAsStream(theClasspath), Charsets.UTF_8);
}
private final TestScriptTestComponent test; private final TestScriptTestComponent test;
private final String name; private final String name;

View File

@ -43,6 +43,9 @@ public class TestingUtilities {
String s = System.getenv("FHIR_HOME"); String s = System.getenv("FHIR_HOME");
if (!Utilities.noString(s)) if (!Utilities.noString(s))
return s; return s;
s = System.getProperty("FHIR_HOME");
if (!Utilities.noString(s))
return s;
s = "C:\\work\\org.hl7.fhir\\build"; s = "C:\\work\\org.hl7.fhir\\build";
if (new File(s).exists()) if (new File(s).exists())
return s; return s;

View File

@ -15,14 +15,20 @@
<dependencies> <dependencies>
<!-- HAPI Dependencies --> <!-- HAPI Dependencies -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
</dependency>
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId> <artifactId>org.hl7.fhir.utilities</artifactId>
</dependency> </dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<exclusions>
<exclusion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-utilities</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- UCUM --> <!-- UCUM -->
<dependency> <dependency>

View File

@ -409,7 +409,8 @@ public class PackageCacheManager {
private void analysePackage(String dir, String v, Map<String, String> profiles, Map<String, String> canonicals) throws IOException { private void analysePackage(String dir, String v, Map<String, String> profiles, Map<String, String> canonicals) throws IOException {
int i = 0; int i = 0;
int c = 11; int c = 11;
for (File f : new File(Utilities.path(dir, "package")).listFiles()) { File[] packages = new File(Utilities.path(dir, "package")).listFiles();
for (File f : packages) {
i++; i++;
if (progress && i % 20 == 0) { if (progress && i % 20 == 0) {
c++; c++;

View File

@ -74,11 +74,17 @@
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId> <artifactId>hapi-fhir-base</artifactId>
<version>${hapi_fhir_version}</version> <version>${hapi_fhir_version}</version>
<exclusions>
<exclusion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-utilities</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId> <artifactId>org.hl7.fhir.utilities</artifactId>
<version>${hapi_fhir_version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>