Commit 4c8e1d33 authored by James's avatar James

auto generate zip release, version moved into build.xml and stored in build.properties

parent cf7d920e
/bdm.properties
/dist/
/nbproject/private/
/build/
/jdm.properties
\ No newline at end of file
/bdm.properties
/dist/
/nbproject/private/
/build/
/jdm.properties
/tmp
*.zip
Please register or sign in to reply
/build.properties
\ No newline at end of file
jDiskMark is a disk io utility written in java. requires java 8.
jDiskMark is a disk io utility written in java.
== Builds ==
builds can be found at:
https://sourceforge.net/projects/jdiskmark/
to run use:
$ java -jar jDiskMark.jar
or on windows double click executable jar file.
== Usage ==
1. Requires java 8.
2. to run:
$ java -jar jDiskMark.jar
On windows double click executable jar file.
== Release Notes ==
v0.1
- initial release
v0.2
- auto generate zip release ie. jdiskmark-v0.2.zip
desired features
- past run history > persisted
- hard drive specs, ie. manufacturer, size, speed
- auto clear disk cache linux
- auto clear disk cache windows
......@@ -71,5 +71,44 @@
nbproject/build-impl.xml file.
-->
<copy file="flushmem.exe" todir="dist"/>
<!-- software revision number -->
<property name="version" value="0.2"/>
<property name="releaseDir" value="jdiskmark-v${version}"/>
<target name="-post-jar">
<copy file="flushmem.exe" todir="dist"/>
<antcall target="buildinfo"/>
<copy file="build.properties" todir="dist"/>
<mkdir dir="tmp"/>
<mkdir dir="tmp/${releaseDir}"/>
<move todir="tmp/${releaseDir}">
<fileset dir="dist">
<include name="**/*"/>
</fileset>
</move>
<zip destfile="dist/${releaseDir}.zip" basedir="tmp"/>
<move todir="dist/${releaseDir}">
<fileset dir="tmp/${releaseDir}"/>
</move>
<delete dir="tmp"/>
</target>
<target name="buildinfo">
  • generates a build.properties file that captures the building system

Please register or sign in to reply
<tstamp>
<format property="builtat" pattern="MM/dd/yyyy hh:mm aa" timezone="America/Los_Angeles"/>
</tstamp>
<exec executable="whoami" outputproperty="whoami"/>
<propertyfile file="build.properties"
comment="This file is automatically generated - DO NOT EDIT">
<entry key="buildtime" value="${builtat}"/>
<entry key="builder" value="${whoami}"/>
<entry key="version" value="${version}"/>
<entry key="os.name" value="${os.name}"/>
<entry key="os.version" value="${os.version}"/>
<entry key="os.arch" value="${os.arch}"/>
<entry key="sun.cpu.endian" value="${sun.cpu.endian}"/>
<entry key="sun.arch.data.model" value="${sun.arch.data.model}"/>
</propertyfile>
</target>
</project>
......@@ -21,7 +21,6 @@ import javax.swing.UIManager;
*/
public class App {
public static final String VERSION = "v0.1";
public static final String PROPERTIESFILE = "jdm.properties";
public static final String DATADIRNAME = "jDiskMarkData";
public static final int MEGABYTE = 1024 * 1024;
......@@ -72,6 +71,24 @@ public class App {
java.awt.EventQueue.invokeLater(App::init);
}
/**
* Get the version from the build properties. Defaults to 0.0 if not found.
* @return
*/
public static String getVersion() {
Properties bp = new Properties();
String version = "0.0";
try {
bp.load(new FileInputStream("build.properties"));
version = bp.getProperty("version");
} catch (FileNotFoundException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
}
return version;
}
public static void init() {
Gui.mainFrame = new MainFrame();
Gui.selFrame = new SelectFrame();
......@@ -154,7 +171,7 @@ public class App {
public static String getConfigString() {
StringBuilder sb = new StringBuilder();
sb.append("Config for Java Disk Mark ").append(VERSION).append('\n');
sb.append("Config for Java Disk Mark ").append(getVersion()).append('\n');
sb.append("readTest: ").append(readTest).append('\n');
sb.append("writeTest: ").append(writeTest).append('\n');
sb.append("locationDir: ").append(locationDir).append('\n');
......
......@@ -27,7 +27,7 @@ public final class MainFrame extends javax.swing.JFrame {
totalTxProgBar.setStringPainted(true);
totalTxProgBar.setValue(0);
totalTxProgBar.setString("");
setTitle(getTitle()+" "+App.VERSION);
setTitle(getTitle()+" "+App.getVersion());
// auto scroll the text area.
DefaultCaret caret = (DefaultCaret) msgTextArea.getCaret();
......@@ -621,7 +621,7 @@ public final class MainFrame extends javax.swing.JFrame {
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
JOptionPane.showMessageDialog(Gui.mainFrame,
"jDiskMark "+App.VERSION,"About...",JOptionPane.PLAIN_MESSAGE);
"jDiskMark "+App.getVersion(),"About...",JOptionPane.PLAIN_MESSAGE);
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void openLocButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openLocButtonActionPerformed
......
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