Skip to content

Commit

Permalink
Dynamic versioning (#20)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com>
  • Loading branch information
ThePrez authored Apr 3, 2023
1 parent 1deecf0 commit 494cf10
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 273 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="bin"/>
</classpath>
</classpath>
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
*~
*.#*
.*.swp
*.trace
.DS_store
.project
bin/
target/
# Simulated Subversion default ignores end here
.vscode/
.vscode/
src/main/java/Test.java
src/main/java/com/ibm/as400/access/BuildInfo.java
41 changes: 41 additions & 0 deletions build/BuildInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.ibm.as400.access;

import java.text.SimpleDateFormat;


// This class is merely an input template to an autogenerated source class
// See use of maven-replacer-plugin in the project manifests
public class BuildInfo {
static String s_compileDateTime = "@timestamp@ (GMT)";
static String s_jtopenVersion = "@jtopenversion@";
static boolean s_isDevelopmentBuild = !Boolean.valueOf("@prod.build@");

public static boolean isDevelopmentBuild() {
return s_isDevelopmentBuild;
}
public static String getVersion() {
String devBuildSuffix = isDevelopmentBuild() ? " (development build)" : "";
String v = s_jtopenVersion;
if (v.startsWith("@")) {
return "<unknown>"+devBuildSuffix;
}
return v.trim().replaceFirst("^v", "")+devBuildSuffix;
}

public static String getTimestampString() {
String ts = s_compileDateTime;
if (ts.startsWith("@")) {
return "<unknown>";
}
return ts.trim();
}

public static String getTimestampYear() {
try {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return ""+ fmt.parse("@timestamp@").getYear() + 1900;
} catch(Exception e) {
return "<unknown>";
}
}
}
18 changes: 0 additions & 18 deletions build/jt400Micro_manifest.txt

This file was deleted.

48 changes: 24 additions & 24 deletions build/jt400Native_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,98 @@ Main-Class: com.ibm.as400.access.jdbcClient.Main

Name: com/ibm/as400/access/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.access
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/access/list/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.access.list
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/data/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.data
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/micro/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.micro
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/resource/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.resource
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/security/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.security
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/security/auth/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.security.auth
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/util/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.util
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/util/commtrace/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.util.commtrace
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/util/html/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.util.html
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/util/servlet/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: com.ibm.as400.util.servlet
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: utilities/
Specification-Title: IBM Toolbox for Java
Specification-Version: 7.5.0.3
Specification-Version: @jtopenspecversion@
Specification-Vendor: IBM Corporation
Implementation-Title: utilities
Implementation-Version: JTOpen 11.2
Implementation-Version: JTOpen @jtopenversion@
Implementation-Vendor: IBM Corporation and others

Name: com/ibm/as400/access/AFPResource.class
Expand Down
191 changes: 0 additions & 191 deletions build/jt400Servlet_manifest.txt

This file was deleted.

Loading

0 comments on commit 494cf10

Please sign in to comment.