Skip to content

Commit

Permalink
feat: bump to v2 to remove bundleRelease param
Browse files Browse the repository at this point in the history
Signed-off-by: Kye Maloy <kye.maloy@ibm.com>
  • Loading branch information
KyeMaloy97 committed May 9, 2023
1 parent 2a69e09 commit 4cf238f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.ibm.cics</groupId>
<artifactId>cics-bundle-common</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>CICS Bundle Common Parent</name>
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/com/ibm/cics/bundle/parts/BundlePublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,16 @@ public class BundlePublisher {
private final int major;
private final int minor;
private final int micro;
private final long release;

private Consumer<Path> listener = f -> {};
private Map<Path, BundleResource> bundleResources = new HashMap<>();
private List<Define> defines = new ArrayList<>();

public BundlePublisher(Path bundleRoot, String bundleId, int major, int minor, int micro, long release) {
public BundlePublisher(Path bundleRoot, String bundleId, int major, int minor, int micro) {
this.bundleRoot = bundleRoot;
this.bundleId = bundleId;
this.major = major;
this.minor = minor;
this.micro = micro;
this.release = release;
}

public void addStaticResource(Path path, BundleResourceContentSupplier content) throws PublishException {
Expand Down Expand Up @@ -157,8 +154,7 @@ public void publishResources() throws PublishException {
bundleId,
major,
minor,
micro,
release
micro
);

for (Map.Entry<Path, BundleResource> bundleResourceE : bundleResources.entrySet()) {
Expand Down Expand Up @@ -200,7 +196,7 @@ public void publishDynamicResources() throws PublishException {
}
}

private void writeManifest(List<Define> defines, String id, int major, int minor, int micro, long release) throws PublishException {
private void writeManifest(List<Define> defines, String id, int major, int minor, int micro) throws PublishException {
Document d = DOCUMENT_BUILDER.newDocument();
Element root = d.createElementNS(BundlePartType.NS, "manifest");
root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", BundlePartType.NS);
Expand All @@ -209,7 +205,7 @@ private void writeManifest(List<Define> defines, String id, int major, int minor
root.setAttribute("bundleMajorVer", String.valueOf(major));
root.setAttribute("bundleMinorVer", String.valueOf(minor));
root.setAttribute("bundleMicroVer", String.valueOf(micro));
root.setAttribute("bundleRelease", String.valueOf(release));
root.setAttribute("bundleRelease", "0";
root.setAttribute("bundleVersion", "1");

d.appendChild(root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void setUp() throws Exception {

@Test
public void publish() throws Exception {
BundlePublisher bundlePublisher = new BundlePublisher(bundleRoot, "foo", 1, 2, 3, 4);
BundlePublisher bundlePublisher = new BundlePublisher(bundleRoot, "foo", 1, 2, 3);
bundlePublisher.addResource(new EarBundlePart("bar", "banana", ear));

bundlePublisher.publishResources();
Expand All @@ -78,7 +78,7 @@ private void verifyContents(Path root) throws IOException {
cicsXml,
isIdenticalTo(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\" bundleMajorVer=\"1\" bundleMicroVer=\"3\" bundleMinorVer=\"2\" bundleRelease=\"4\" bundleVersion=\"1\" id=\"foo\">\n" +
"<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\" bundleMajorVer=\"1\" bundleMicroVer=\"3\" bundleMinorVer=\"2\" bundleRelease=\"0\" bundleVersion=\"1\" id=\"foo\">\n" +
" <meta_directives>\n" +
" <timestamp>2019-08-28T08:26:05.076Z</timestamp>\n" +
" </meta_directives>\n" +
Expand Down

0 comments on commit 4cf238f

Please sign in to comment.