Release new version

This commit is contained in:
Grahame Grieve 2019-12-13 11:29:49 +11:00
parent 498d3bf505
commit 674432a8ad
12 changed files with 74 additions and 19 deletions

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -111,12 +111,12 @@
<dependency> <dependency>
<groupId>com.atlassian.commonmark</groupId> <groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark</artifactId> <artifactId>commonmark</artifactId>
<optional>test</optional> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.atlassian.commonmark</groupId> <groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark-ext-gfm-tables</artifactId> <artifactId>commonmark-ext-gfm-tables</artifactId>
<optional>test</optional> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -31,9 +31,13 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -48,6 +52,8 @@ import org.hl7.fhir.utilities.IniFile;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.cache.NpmPackage.NpmPackageFolder; import org.hl7.fhir.utilities.cache.NpmPackage.NpmPackageFolder;
import org.hl7.fhir.utilities.cache.PackageCacheManager.BuildRecord;
import org.hl7.fhir.utilities.cache.PackageCacheManager.BuildRecordSorter;
import org.hl7.fhir.utilities.json.JSONUtil; import org.hl7.fhir.utilities.json.JSONUtil;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
@ -71,6 +77,43 @@ import com.google.gson.JsonObject;
*/ */
public class PackageCacheManager { public class PackageCacheManager {
public class BuildRecordSorter implements Comparator<BuildRecord> {
@Override
public int compare(BuildRecord arg0, BuildRecord arg1) {
return arg1.date.compareTo(arg0.date);
}
}
public class BuildRecord {
private String url;
private String packageId;
private String repo;
private Date date;
public BuildRecord(String url, String packageId, String repo, Date date) {
super();
this.url = url;
this.packageId = packageId;
this.repo = repo;
this.date = date;
}
public String getUrl() {
return url;
}
public String getPackageId() {
return packageId;
}
public String getRepo() {
return repo;
}
public Date getDate() {
return date;
}
}
/** if you don't provide and implementation of this interface, the PackageCacheManager will use the web directly. /** if you don't provide and implementation of this interface, the PackageCacheManager will use the web directly.
* *
* You can use this interface to * You can use this interface to
@ -369,7 +412,7 @@ public class PackageCacheManager {
return null; return null;
} }
public JsonArray loadFromBuildServer() throws IOException { public void loadFromBuildServer() throws IOException, ParseException {
buildLoaded = true; // whether it succeeds or not buildLoaded = true; // whether it succeeds or not
URL url = new URL("https://build.fhir.org/ig/qas.json?nocache=" + System.currentTimeMillis()); URL url = new URL("https://build.fhir.org/ig/qas.json?nocache=" + System.currentTimeMillis());
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); HttpURLConnection connection = (HttpURLConnection) url.openConnection();
@ -377,17 +420,29 @@ public class PackageCacheManager {
InputStream json = connection.getInputStream(); InputStream json = connection.getInputStream();
buildInfo = (JsonArray) new com.google.gson.JsonParser().parse(TextFile.streamToString(json)); buildInfo = (JsonArray) new com.google.gson.JsonParser().parse(TextFile.streamToString(json));
List<BuildRecord> builds = new ArrayList<>();
for (JsonElement n : buildInfo) { for (JsonElement n : buildInfo) {
JsonObject o = (JsonObject) n; JsonObject o = (JsonObject) n;
if (o.has("url") && o.has("package-id") && o.get("package-id").getAsString().contains(".")) { if (o.has("url") && o.has("package-id") && o.get("package-id").getAsString().contains(".")) {
String u = o.get("url").getAsString(); String u = o.get("url").getAsString();
if (u.contains("/ImplementationGuide/")) if (u.contains("/ImplementationGuide/"))
u = u.substring(0, u.indexOf("/ImplementationGuide/")); u = u.substring(0, u.indexOf("/ImplementationGuide/"));
recordMap(u, o.get("package-id").getAsString()); builds.add(new BuildRecord(u, o.get("package-id").getAsString(), o.get("repo").getAsString(), readDate(o.get("date").getAsString())));
ciList.put(o.get("package-id").getAsString(), "https://build.fhir.org/ig/"+o.get("repo").getAsString());
} }
} }
return buildInfo; Collections.sort(builds, new BuildRecordSorter());
for (BuildRecord bld : builds) {
if (!ciList.containsKey(bld.getPackageId())) {
recordMap(bld.getUrl(), bld.getPackageId());
ciList.put(bld.getPackageId(), "https://build.fhir.org/ig/"+bld.getRepo());
}
}
}
private Date readDate(String s) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM, yyyy HH:mm:ss Z");
return sdf.parse(s);
} }
public boolean isBuildLoaded() { public boolean isBuildLoaded() {
@ -405,7 +460,7 @@ public class PackageCacheManager {
return null; return null;
} }
public boolean checkBuildLoaded() throws IOException { public boolean checkBuildLoaded() throws IOException, ParseException {
if (isBuildLoaded()) if (isBuildLoaded())
return true; return true;
loadFromBuildServer(); loadFromBuildServer();

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -13,7 +13,7 @@
each other. It is fine to bump the point version of this POM without affecting each other. It is fine to bump the point version of this POM without affecting
HAPI FHIR. HAPI FHIR.
--> -->
<version>4.1.23-SNAPSHOT</version> <version>4.1.24-SNAPSHOT</version>
<properties> <properties>
<hapi_fhir_version>4.1.0</hapi_fhir_version> <hapi_fhir_version>4.1.0</hapi_fhir_version>

View File

@ -1,7 +1,7 @@
@echo off @echo off
set oldver=4.1.22 set oldver=4.1.23
set newver=4.1.23 set newver=4.1.24
echo .. echo ..
echo ===================================================================== echo =====================================================================