Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ The build is driven by Gradle through the included wrapper; no separate Gradle i
```
On Windows use `gradlew.bat` instead of `./gradlew`. The assembled distribution lands in `server/setup`, the same location the previous Ant build used. For release artifacts, run a clean build: `./gradlew clean build dist`. Windows with SDKMan may generate an error about the file path being too long in the javadoc step, skip this by adding `-x :server:userApiJavadoc` to your Gradle command.

#### Release versioning (API vs installer)

The runtime API/schema version stays in Gradle `version` / `mirth.version` (currently `4.6.0`). Patch-train releases can carry a four-part build id without changing that API version:

```bash
./gradlew clean build dist -PbuildVersion=4.6.0.1
install4jc -release 4.6.0.1 tools/install4j/oie-installer-config.install4j
```

`-PbuildVersion` writes `mirth.build` into `version.properties` (shown in About when set). `install4jc -release` sets the installer/media version only. Serializers and channel compatibility continue to use `4.6.0`.

Dependencies are pinned and checksum-verified. To change a dependency version: edit `gradle/libs.versions.toml`, then refresh the checksum metadata **with a cold dependency cache and CI's flags**:
```bash
GRADLE_USER_HOME=$(mktemp -d) ./gradlew --write-verification-metadata sha256 build dist -PdisableSigning=true -Pcoverage=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public void loadContent() {
content.append(String.format("%s Server %s\n\n", BrandingConstants.PRODUCT_NAME, PlatformUI.SERVER_VERSION));
}

if (PlatformUI.BUILD_VERSION != null && !PlatformUI.BUILD_VERSION.isEmpty()) {
content.append("Build ").append(PlatformUI.BUILD_VERSION).append("\n\n");
}

if (PlatformUI.BUILD_DATE != null) {
content.append("Built on ").append(PlatformUI.BUILD_DATE).append("\n\n");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ public void setupFrame(Client mirthClient) throws ClientException {
setTitle(getTitle() + " - (" + PlatformUI.SERVER_VERSION + ")");

PlatformUI.BUILD_DATE = mirthClient.getBuildDate();
PlatformUI.BUILD_VERSION = mirthClient.getBuildVersion();

// Initialize ObjectXMLSerializer once we know the server version
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class PlatformUI {
public static String CLIENT_VERSION;
public static String SERVER_VERSION;
public static String BUILD_DATE;
public static String BUILD_VERSION;
public static Color DEFAULT_BACKGROUND_COLOR = ServerSettings.DEFAULT_COLOR;
public static Color BOLD_RED_BACKGROUND_COLOR = Color.decode("#D40E21");
public static String[] HTTPS_PROTOCOLS = MirthSSLUtil.DEFAULT_HTTPS_CLIENT_PROTOCOLS;
Expand Down
9 changes: 8 additions & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ compileTestJava {
def generateVersionProperties = tasks.register('generateVersionProperties') {
description = 'Generates version.properties (embedded in mirth-client-core.jar).'
def outFile = file('version.properties')
def buildVersion = providers.gradleProperty('buildVersion').orElse('').get()
inputs.property 'version', version
inputs.property 'buildVersion', buildVersion
// the date must be computed at execution time, not when the daemon
// happened to configure the project
inputs.property 'date', project.providers.provider {
Expand All @@ -62,7 +64,12 @@ def generateVersionProperties = tasks.register('generateVersionProperties') {
outputs.file outFile
doLast {
def buildDate = new SimpleDateFormat('MMMM d, yyyy', Locale.US).format(new Date())
outFile.text = "mirth.version=${version}\nmirth.date=${buildDate}\n"
def text = "mirth.version=${version}\nmirth.date=${buildDate}\n"

if (buildVersion) {
text += "mirth.build=${buildVersion}\n"
}
outFile.text = text
}
}

Expand Down
10 changes: 10 additions & 0 deletions server/src/main/java/com/mirth/connect/client/core/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,16 @@ public String getBuildDate() throws ClientException {
return getServlet(ConfigurationServletInterface.class).getBuildDate();
}

/**
* Returns the patch-train build id of the server.
*
* @see ConfigurationServletInterface#getBuildVersion
*/
@Override
public String getBuildVersion() throws ClientException {
return getServlet(ConfigurationServletInterface.class).getBuildVersion();
}

/**
* Returns the status of the server.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public interface ConfigurationServletInterface extends BaseServletInterface {
@MirthOperation(name = "getBuildDate", display = "Get build date", auditable = false)
public String getBuildDate() throws ClientException;

@GET
@Path("/buildVersion")
@Produces(MediaType.TEXT_PLAIN)
@Operation(summary = "Returns the patch-train build id of the server.")
@MirthOperation(name = "getBuildVersion", display = "Get build version", auditable = false)
public String getBuildVersion() throws ClientException;

@GET
@Path("/status")
@Operation(summary = "Returns the status of the server.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javax.ws.rs.core.SecurityContext;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -95,6 +96,13 @@ public String getBuildDate() {
return configurationController.getBuildDate();
}

@Override
@DontCheckAuthorized
public String getBuildVersion() {
// Authorization not required
return configurationController.getBuildVersion();
}

@Override
@DontCheckAuthorized
public int getStatus() {
Expand Down Expand Up @@ -123,6 +131,11 @@ public Map<String, Object> getAbout() {
properties.put("name", configurationController.getServerName());
properties.put("version", configurationController.getServerVersion());
properties.put("date", configurationController.getBuildDate());
String buildVersion = configurationController.getBuildVersion();

if (StringUtils.isNotBlank(buildVersion)) {
properties.put("build", buildVersion);
}
properties.put("database", configurationController.getDatabaseType());

properties.put("channelCount", channelController.getChannelIds().size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ public static ConfigurationController getInstance() {
*/
public abstract String getBuildDate();

/**
* Returns the patch-train build id (ex. 4.6.0.1), or null/empty when unset.
* Distinct from {@link #getServerVersion()}, which is the API/schema version.
*
* @return the build version, or null/empty if not set
*/
public abstract String getBuildVersion();

/**
* The maximum amount of time that a session can be idle before it is invalidated.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,11 @@ public String getBuildDate() {
return versionConfig.getString("mirth.date");
}

@Override
public String getBuildVersion() {
return versionConfig.getString("mirth.build", "");
}

@Override
public int getMaxInactiveSessionInterval() {
return maxInactiveSessionInterval;
Expand Down
Loading