Commit 987406b9 authored by Piotr Wendykier's avatar Piotr Wendykier

- Version and build number (time stamp) are now stored in manifest.

- Removed build.number.
parent 5a51ecd3
#Build Number for ANT. Do not edit!
#Mon May 21 13:23:52 CEST 2018
build.number=1300029
This diff is collapsed.
......@@ -276,8 +276,8 @@ public class MainMenu
{
JOptionPane.showMessageDialog(
null,
VisNow.TITLE + " v" + VisNow.VERSION + "\n\nCopyright 2014 ICM University of Warsaw",
VisNow.TITLE + " v" + VisNow.VERSION,
VisNow.TITLE + " v" + VisNow.getVersionNumber() + "\n\nCopyright 2014 onward ICM University of Warsaw",
VisNow.TITLE + " v" + VisNow.getVersionNumber(),
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(getClass()
.getResource("/pl/edu/icm/visnow/gui/icons/big/visnow.png"))
......
......@@ -165,7 +165,7 @@ public class MainWindow extends javax.swing.JFrame
openTestDataMenu.setVisible(false);
VNSwingUtils.setFillerComponent(mainPanel, applicationsPanel);
setTitle(VisNow.TITLE + " v" + VisNow.VERSION + " build "+ VisNow.get().getBuildNumber());
setTitle(VisNow.TITLE + " v" + VisNow.getVersionNumber() + " build "+ VisNow.getBuildNumber());
userMessagePanelToggle(false);
}
......
......@@ -40,7 +40,7 @@ public class StartPagePanel extends javax.swing.JPanel
{
if (VisNow.get() != null) {
showOnStartupCheckBox.setSelected(!VisNow.get().getMainConfig().isStartPageHidden());
jLabel2.setText(VisNow.TITLE + " v" + VisNow.VERSION + " build "+ VisNow.get().getBuildNumber());
jLabel2.setText(VisNow.TITLE + " v" + VisNow.getVersionNumber() + " build "+ VisNow.getBuildNumber());
}
}
......
......@@ -285,9 +285,9 @@ public class VisNow {
}
}
public String getBuildNumber()
public static String getVersionNumber()
{
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(jarPath))) {
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(findJarPath()))) {
Manifest mf = jarStream.getManifest();
Attributes mainAttribs = mf.getMainAttributes();
return mainAttribs.getValue("Implementation-Version");
......@@ -295,6 +295,17 @@ public class VisNow {
return null;
}
}
public static String getBuildNumber()
{
try (JarInputStream jarStream = new JarInputStream(new FileInputStream(findJarPath()))) {
Manifest mf = jarStream.getManifest();
Attributes mainAttribs = mf.getMainAttributes();
return mainAttribs.getValue("Built-Date");
} catch (IOException ex) {
return null;
}
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" FRAME ">
......@@ -1341,7 +1352,7 @@ public class VisNow {
static final Font lowerLineFont = new Font("Dialog", Font.PLAIN, 10);
private static void renderSplashFrame(float progress, String loadText) {
renderSplashFrame(progress, loadText, TITLE + " v" + VERSION, "Interdisciplinary Centre for Mathematical and Computational Modelling, University of Warsaw");
renderSplashFrame(progress, loadText, TITLE + " v" + VisNow.getVersionNumber(), "Interdisciplinary Centre for Mathematical and Computational Modelling, University of Warsaw");
}
private static void renderSplashFrame(float progress, String loadText, String bottomTextUpperLine, String bottomTextLowerLine) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment