Skip to content

Commit 1536526

Browse files
authored
Merge pull request #22 from OP-TED/release/1.1.0
Release/1.1.0
2 parents 61d9329 + 60165eb commit 1536526

File tree

16 files changed

+256
-94
lines changed

16 files changed

+256
-94
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v3
2222
- name: Import GPG Key
23-
uses: crazy-max/ghaction-import-gpg@v1
24-
env:
25-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
26-
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
23+
uses: crazy-max/ghaction-import-gpg@v5
24+
with:
25+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
2727
- name: Set up Java for publishing to Maven Central Repository
2828
uses: actions/setup-java@v3
2929
with:

CHANGELOG.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# eForms Core Library 1.0.5 Release Notes
1+
# eForms Core Library 1.1.0 Release Notes
22

33
_The library is a collection of utilities that are used by our sample applications as well as the EFX Toolkit for Java Developers._
44

5-
## In this release:
6-
This patch
7-
- improves performance by lazy-loading codelists,
8-
- improves handling of SemVer 2.0 version numbers.
5+
## In this release
6+
This release updates the SdkDownloader to simplify its logic and make sure it resolves pre-release versions of the SDK correctly.
97

108
## Download
119

1210
You can download the latest eForms Core library from Maven Central.
1311

14-
[![Maven Central](https://img.shields.io/maven-central/v/eu.europa.ted.eforms/eforms-core-java?label=Download%20&style=flat-square)](https://search.maven.org/search?q=g:%22eu.europa.ted.eforms%22%20AND%20a:%22eforms-core-java%22)
12+
[![Maven Central](https://img.shields.io/maven-central/v/eu.europa.ted.eforms/eforms-core-java?label=Download%20&style=flat-square)](https://central.sonatype.com/artifact/eu.europa.ted.eforms/eforms-core-java)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>eu.europa.ted.eforms</groupId>
55
<artifactId>eforms-core-java</artifactId>
6-
<version>1.0.5</version>
6+
<version>1.1.0</version>
77

88
<name>eForms Core Library</name>
99
<description>API and tools for eForms applications.</description>

src/main/java/eu/europa/ted/eforms/sdk/SdkVersion.java

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package eu.europa.ted.eforms.sdk;
22

33
import java.util.ArrayList;
4+
import java.util.Arrays;
45
import java.util.List;
56
import java.util.Objects;
67
import org.apache.commons.lang3.StringUtils;
@@ -24,27 +25,43 @@ public SdkVersion(final String version) {
2425
}
2526

2627
public String getMajor() {
27-
return version.getMajor().toString();
28+
return this.version.getMajor().toString();
2829
}
2930

3031
public String getMinor() {
31-
return version.getMinor().toString();
32+
return this.version.getMinor().toString();
3233
}
3334

3435
public String getPatch() {
35-
return version.getPatch() == null ? "0" : version.getPatch().toString();
36+
return this.version.getPatch() == null ? "0" : this.version.getPatch().toString();
3637
}
3738

3839
public String getNextMajor() {
39-
return version.withIncMajor().toString();
40+
return this.version.withIncMajor().toString();
4041
}
4142

4243
public String getNextMinor() {
43-
return version.withIncMinor().toString();
44+
return this.version.withIncMinor().toString();
45+
}
46+
47+
public boolean isMajor() {
48+
return !this.isMinor() && this.version.getMajor() != null;
49+
}
50+
51+
public boolean isMinor() {
52+
return !this.isPatch() && this.version.getMinor() != null;
4453
}
4554

4655
public boolean isPatch() {
47-
return version.getPatch() != null;
56+
return this.version.getPatch() != null;
57+
}
58+
59+
public boolean isPreRelease() {
60+
return this.version.getSuffixTokens().length > 0;
61+
}
62+
63+
public boolean isSnapshot() {
64+
return Arrays.asList(this.version.getSuffixTokens()).contains("SNAPSHOT");
4865
}
4966

5067
public String toNormalisedString(boolean withPatch) {
@@ -66,7 +83,7 @@ public String toStringWithoutPatch() {
6683

6784
@Override
6885
public String toString() {
69-
return version.toString();
86+
return this.version.toString();
7087
}
7188

7289
@Override
@@ -79,12 +96,12 @@ public int compareTo(SdkVersion that) {
7996
return 0;
8097
}
8198

82-
return version.compareTo(that.version);
99+
return this.version.compareTo(that.version);
83100
}
84101

85102
@Override
86103
public int hashCode() {
87-
return Objects.hash(version);
104+
return Objects.hash(this.version);
88105
}
89106

90107
@Override
@@ -96,6 +113,6 @@ public boolean equals(Object obj) {
96113
if (getClass() != obj.getClass())
97114
return false;
98115
SdkVersion other = (SdkVersion) obj;
99-
return Objects.equals(version, other.version);
116+
return Objects.equals(this.version, other.version);
100117
}
101118
}

0 commit comments

Comments
 (0)