- * Currently this will just print the library name and the version. This is used during the build process for making - * Distmaker releases. + * Provides the main entry point. + *
+ * Application prints the library name and version. + *
+ * This is used during the build process for making DistMaker releases. + * + * @author lopeznr1 */ public class DistApp { /** The DistMaker version is defined here. */ - public static final Version version = new PlainVersion(0, 56, 0); + public static final Version version = new PlainVersion(0, 57, 0); /** * Main entry point that will print out the version of DistMaker to stdout. diff --git a/src/distMaker/DistMakerEngine.java b/src/distMaker/DistMakerEngine.java index abe3bf5..19cad78 100644 --- a/src/distMaker/DistMakerEngine.java +++ b/src/distMaker/DistMakerEngine.java @@ -18,7 +18,6 @@ import distMaker.gui.PickReleasePanel; import distMaker.jre.*; import distMaker.node.*; import distMaker.platform.*; -import distMaker.utils.Version; import glum.digest.Digest; import glum.gui.panel.generic.MessagePanel; import glum.gui.panel.generic.PromptPanel; @@ -29,15 +28,16 @@ import glum.net.NetUtil; import glum.task.*; import glum.unit.DateUnit; import glum.util.ThreadUtil; +import glum.version.Version; /** * Primary controller class of DistMaker package. This class provides the following functionality: - *
+ *
* Note this method may return null if we are: - *
+ *
* This method will be called via reflection. */ private void checkForUpdatesWorker(FullTaskPanel aTask, UpdateCheckListener aListener) @@ -399,9 +401,9 @@ public class DistMakerEngine /** * Helper method to show an informative message on msgPanel and execute the specified runnable. - *
+ *
* If isModal == true then aRunnable will only be executed after the msgPanel has been accepted. - *
+ *
* The runnable will not be run until the parentFrame is visible. */ private void displayNoticeAndExecute(final String aMsg, final Runnable aRunnable, final boolean isModal) @@ -450,7 +452,7 @@ public class DistMakerEngine /** * Helper method to download the specified release. - *
+ *
* Returns true if the release was downloaded properly. */ private boolean downloadAppRelease(Task aTask, AppRelease aRelease, File aDestPath) @@ -714,7 +716,7 @@ public class DistMakerEngine /** * Class used to store a complex 'tuple' value. - *
+ *
* This object is used to store the results of a successful JRE update. */ private class JreUpdateResult @@ -732,7 +734,7 @@ public class DistMakerEngine /** * Helper method to download a compatible JreRelease for the AppCatalog to the specified destPath. - *
+ *
* On success the JreVersion that was downloaded is returned. */ private JreUpdateResult downloadJreUpdate(Task aTask, AppCatalog aUpdateCat, File aDestPath, long releaseSizeFull) @@ -863,18 +865,18 @@ public class DistMakerEngine /** * Helper method that "reverts" an update. After this method is called the DistMaker application's configuration * should be in the same state as before an update was applied. - *
+ *
* It is necessary to do this, since the user may later cancel the update request and it is important to leave the * program and configuration files in a stable state. - *
+ *
* An update will be reverted by doing: - *
+ *
* There should not be any issues with this roll back process. However if there are, a best effort will be made to * continue rolling back the updates - note that the application might be in an unstable state - and may not be able * to be restarted. @@ -1051,7 +1053,7 @@ public class DistMakerEngine /** * Helper method that prompts the user for forms of input depending on the state of the App - *
+ *
* This method will be called via reflection.
*/
private void queryUserForInput(Task aTask, File aDeltaPath, List
+ *
* If we are running in a developers environment then this value will be null.
*/
public static Version getAppLauncherVersion()
@@ -75,7 +77,7 @@ public class DistUtils
/**
* Utility method to determine the path where the application is installed.
- *
+ *
* If this application is not a formal DistMaker application, then the working directory will be returned.
*/
public static File getAppPath()
@@ -450,7 +452,7 @@ public class DistUtils
/**
* Utility method to switch the DistMaker library into debug mode. You should never call this method unless you are
* modifying the DistMaker library.
- *
+ *
* This functionality only exists to allow rapid development of DistMaker
*/
public static void setDebugDeveloperDetails(int aUpdateCode, String aUpdateMsg, File aDevelopAppPath)
diff --git a/src/distMaker/MiscUtils.java b/src/distMaker/MiscUtils.java
index 1832383..85f7c36 100644
--- a/src/distMaker/MiscUtils.java
+++ b/src/distMaker/MiscUtils.java
@@ -32,9 +32,9 @@ public class MiscUtils
{
/**
* Utility method to convert a Unix base-10 mode into the equivalent string.
- *
+ *
* Example: 493 -> 'rwxr-xr-x'
- *
+ *
* The returned string will always be of length 9
*/
public static String convertUnixModeToStr(int aMode)
@@ -52,9 +52,9 @@ public class MiscUtils
/**
* Utility method to convert a Unix base-10 mode into the Set
+ *
* Example: 493 -> 'rwxr-xr-x'
- *
+ *
* The returned string will always be of length 9
*/
public static Set
+ *
* Returns null if aAbsolutePath does not start with aBasePath.
*/
public static String getRelativePath(File aBasePath, File aAbsolutePath)
@@ -129,7 +129,7 @@ public class MiscUtils
/**
* Utility method that returns a BufferedReader corresponding to the specified file.
- *
+ *
* This helps reduce boiler plate code.
*/
public static BufferedReader openFileAsBufferedReader(File aFile) throws IOException
@@ -139,7 +139,7 @@ public class MiscUtils
/**
* Helper method that prints the exception of ErrorDM in an intelligent fashion to the specified task.
- *
+ *
* All ErrorDM exceptions (and their causes) will be printed. If the cause is not of type ErrorDM then the stack
* trace will be printed as well.
*/
@@ -173,10 +173,10 @@ public class MiscUtils
/**
* Unpacks an input file into an output file.
- *
- * Source based off of:
+ * Source based off of:
+ *
* The output file is created in the output folder, having the same name as the input file, minus the '.tar'
* extension.
*
@@ -314,7 +314,7 @@ public class MiscUtils
/**
* Helper method to output the specified strings to aFile
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void writeDoc(File aFile, List
+ *
* Should the program become non operational then the end user would have to manually configure the config/script
* files by hand or a reinstall would be required.
*/
@@ -176,7 +175,7 @@ public class MemoryConfigPanel extends GlassPanel implements ActionListener, Lis
// Title Area
titleL = new JLabel("App Memory Configuration", JLabel.CENTER); // this text gets replaced once the curent version
- // status is known
+ // status is known
add(titleL, "gapbottom 15,growx,span 2,wrap");
//GTextField maxMemTF;
@@ -228,8 +227,6 @@ public class MemoryConfigPanel extends GlassPanel implements ActionListener, Lis
add(resetB, "");
add(closeB, "");
- setBorder(new BevelBorder(BevelBorder.RAISED));
-
// Configure the slider to be aware of the new memory range
targMemS.setModelRange(memSizeRange);
targMemS.setModelValue(currMemSize);
@@ -275,7 +272,7 @@ public class MemoryConfigPanel extends GlassPanel implements ActionListener, Lis
/**
* Utility method to round (floor) values to the nearest megabyte. The returned value is guaranteed to be at least 1
* megabyte.
- *
+ *
* The input value, aSize, should be specified in bytes, and the returned value will be specified in bytes.
*/
private long roundToMB(long aSize)
diff --git a/src/distMaker/gui/PickReleasePanel.java b/src/distMaker/gui/PickReleasePanel.java
index 77ece23..8b2f4c4 100644
--- a/src/distMaker/gui/PickReleasePanel.java
+++ b/src/distMaker/gui/PickReleasePanel.java
@@ -1,14 +1,12 @@
package distMaker.gui;
import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
+import java.awt.event.*;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import javax.swing.*;
-import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -31,7 +29,7 @@ import net.miginfocom.swing.MigLayout;
*
* @author lopeznr1
*/
-public class PickReleasePanel extends GlassPanel implements ActionListener, ListSelectionListener
+public class PickReleasePanel extends GlassPanel implements ActionListener, ItemListener, ListSelectionListener
{
// Constants
private static final long serialVersionUID = 1L;
@@ -163,6 +161,12 @@ public class PickReleasePanel extends GlassPanel implements ActionListener, List
}
}
+ @Override
+ public void itemStateChanged(ItemEvent aEvent)
+ {
+ updateGui();
+ }
+
@Override
public void valueChanged(ListSelectionEvent aEvent)
{
@@ -192,11 +196,11 @@ public class PickReleasePanel extends GlassPanel implements ActionListener, List
add(headTA, "w 0::,growx,span,wrap");
// Latest version area
- newestRB = GuiUtil.createJRadioButton("Unspecified", this, smallFont);
+ newestRB = GuiUtil.createJRadioButton(this, "Unspecified", smallFont);
newestRB.setSelected(true);
// Older version area
- olderRB = GuiUtil.createJRadioButton("Select an older release:", this, smallFont);
+ olderRB = GuiUtil.createJRadioButton(this, "Select an older release:", smallFont);
listPanel = buildItemListTablePanel();
listPanel.setBorder(new EmptyBorder(0, 15, 0, 0));
@@ -228,8 +232,6 @@ public class PickReleasePanel extends GlassPanel implements ActionListener, List
proceedB = GuiUtil.createJButton("Proceed", this, smallFont);
add(abortB, "align right,span,split 2");
add(proceedB, "");
-
- setBorder(new BevelBorder(BevelBorder.RAISED));
}
/**
diff --git a/src/distMaker/jre/AppLauncherRelease.java b/src/distMaker/jre/AppLauncherRelease.java
index 4ec0571..c4b0826 100644
--- a/src/distMaker/jre/AppLauncherRelease.java
+++ b/src/distMaker/jre/AppLauncherRelease.java
@@ -1,11 +1,11 @@
package distMaker.jre;
-import distMaker.utils.*;
import glum.digest.Digest;
+import glum.version.*;
/**
* Immutable class that describes an AppLauncher release.
- *
+ *
* The reference fileName should be a jar file.
*
* @author lopeznr1
diff --git a/src/distMaker/jre/AppLauncherUtils.java b/src/distMaker/jre/AppLauncherUtils.java
index 6dd78f5..38add77 100644
--- a/src/distMaker/jre/AppLauncherUtils.java
+++ b/src/distMaker/jre/AppLauncherUtils.java
@@ -18,6 +18,7 @@ import glum.net.NetUtil;
import glum.task.PartialTask;
import glum.task.Task;
import glum.util.ThreadUtil;
+import glum.version.*;
/**
* Collection of utility methods associated with the DistMaker's AppLauncher.
@@ -27,7 +28,7 @@ import glum.util.ThreadUtil;
public class AppLauncherUtils
{
/**
- * Returns a list of all the available AppLauncher releases specified at:
+ *
* Returns false if the AppLauncher does NOT need be updated. Otherwise true will be returned and the version info
* will be logged to the specified aTask.
*/
@@ -181,16 +182,16 @@ public class AppLauncherUtils
/**
* Utility method that will return the AppLauncherRelease that satisfies the requirements as specified by the
* JreRelease.
- *
+ *
* Returns null if no AppLauncherRelease is located that can satisfy the specified JreRelease.
- *
+ *
* Any issues that cropped up while searching for a valid AppLauncherRelease will be logged to the specified task,
* aTask.
- *
+ *
* TODO: Remove the comments below
- *
+ *
* corresponding to the AppLauncher that we to the specified version required by this JRE.
- *
+ *
* Returns false on any failure.
*/
public static AppLauncherRelease updateAppLauncher(Task aTask, JreRelease aJreRelease, File aDestPath,
diff --git a/src/distMaker/jre/JreRelease.java b/src/distMaker/jre/JreRelease.java
index 1ebf6bb..f8586c9 100644
--- a/src/distMaker/jre/JreRelease.java
+++ b/src/distMaker/jre/JreRelease.java
@@ -2,8 +2,8 @@ package distMaker.jre;
import distMaker.platform.Architecture;
import distMaker.platform.Platform;
-import distMaker.utils.Version;
import glum.digest.Digest;
+import glum.version.Version;
/**
* Immutable class that describes a JRE Release.
diff --git a/src/distMaker/jre/JreUtils.java b/src/distMaker/jre/JreUtils.java
index 1ad325b..bc29ab0 100644
--- a/src/distMaker/jre/JreUtils.java
+++ b/src/distMaker/jre/JreUtils.java
@@ -7,7 +7,6 @@ import java.util.*;
import distMaker.platform.*;
import distMaker.utils.ParseUtils;
-import distMaker.utils.PlainVersion;
import glum.digest.Digest;
import glum.digest.DigestType;
import glum.io.IoUtil;
@@ -16,6 +15,7 @@ import glum.net.Credential;
import glum.net.NetUtil;
import glum.task.Task;
import glum.util.ThreadUtil;
+import glum.version.PlainVersion;
/**
* Collection of utility methods that provide JRE related functionality.
@@ -26,11 +26,11 @@ public class JreUtils
{
/**
* Returns the relative path a JRE should be expanded to.
- *
- * Namely legacy JRE versions (versions prior to Java 9) will be expanded to:
+ * Namely legacy JRE versions (versions prior to Java 9) will be expanded to:
+ *
* This only examines the filename to determine the platform.
- *
+ *
* This method should be considered deprecated as of DistMaker 0.48
*/
@Deprecated
diff --git a/src/distMaker/jre/JreVersion.java b/src/distMaker/jre/JreVersion.java
index d15f6ea..c067fc4 100644
--- a/src/distMaker/jre/JreVersion.java
+++ b/src/distMaker/jre/JreVersion.java
@@ -4,8 +4,8 @@ import java.util.ArrayList;
import com.google.common.collect.ImmutableList;
-import distMaker.utils.Version;
import glum.io.ParseUtil;
+import glum.version.Version;
/**
* Immutable class which defines a Java version.
@@ -58,9 +58,9 @@ public class JreVersion implements Comparable
+ *
* The better version is defined as the later version (and the more specific version).
- *
+ *
* Returns null if the better version can not be determined or if the versions are equal.
*/
public static JreVersion getBetterVersion(JreVersion verA, JreVersion verB)
diff --git a/src/distMaker/node/AppCatalog.java b/src/distMaker/node/AppCatalog.java
index f75b899..886ed78 100644
--- a/src/distMaker/node/AppCatalog.java
+++ b/src/distMaker/node/AppCatalog.java
@@ -34,7 +34,7 @@ public class AppCatalog
/**
* Returns the most recent {@link JreRelease} from the specified list that is compatible with this
* {@link AppCatalog}.
- *
+ *
* Returns null if there are no {@link JreRelease} that is compatible.
*/
public JreRelease getCompatibleJre(List
- * TODO: This should be renamed formNameMap to formDigestMap
+ * TODO: This should be renamed formNameMap to formDigestMap
+ *
* Returns null if no infoMsg has been specified.
*/
public String getInfoMsg()
@@ -77,13 +87,13 @@ public class AppRelease implements Comparable
+ *
* Two locations will be searched.... TODO: Add more details of those locations.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static File getPlistFile()
@@ -57,10 +57,10 @@ public class AppleUtils
/**
* Utility method to update the specified version in the plist file (pFile) to the new version.
- *
+ *
* Note this method is very brittle, and assumes that the version will occur in the sibling node which immediately
* follows the node with a value of CFBundleVersion. TODO: Consider reducing brittleness.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateAppVersion(String aNewVersin, File pFile)
@@ -118,7 +118,7 @@ public class AppleUtils
/**
* Utility method to update the configuration file (pFile) to reflect the specified AppLauncherRelease.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateAppLauncher(AppLauncherRelease aRelease, File pFile)
@@ -193,7 +193,7 @@ public class AppleUtils
/**
* Utility method to update the configuration file (pFile) to reflect the specified JRE version.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateJreVersion(JreVersion aJreVersion, File pFile)
@@ -258,10 +258,10 @@ public class AppleUtils
/**
* Utility method to update the specified max memory (-Xmx) value in the plist file (pFile) to the specified
* maxMemVal.
- *
+ *
* In order for this method to succeed there must be a valid JVMOptions section followed by an array of string
* elements of JVM arguments. The array element may be empty but must be specified.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateMaxMem(long numBytes, File pFile)
@@ -384,15 +384,15 @@ public class AppleUtils
/**
* Utility helper method to clean up the specified XML document.
- *
+ *
* Clean up the XML to remove spurious empty line nodes. This is needed in Java 9 since the XML processing is
* different from Java 8 and prior. Spurious newlines seem to be introduced with Java 9 XML libs.
- *
+ *
* Source:
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
private static void saveDoc(File aFile, Document aDoc)
diff --git a/src/distMaker/platform/ArchitectureUtils.java b/src/distMaker/platform/ArchitectureUtils.java
index c4d1c36..bf1a7ec 100644
--- a/src/distMaker/platform/ArchitectureUtils.java
+++ b/src/distMaker/platform/ArchitectureUtils.java
@@ -2,10 +2,10 @@ package distMaker.platform;
/**
* Collection of utility methods that provide a mechanism for the following:
- *
+ *
* This always returns x64.
- *
+ *
* TODO: In the future update the code to return the architecture rather than assume x64!
*/
public static Architecture getArchitecture()
@@ -26,7 +26,7 @@ public class ArchitectureUtils
/**
* Utility method that takes a string and will transform it to the corresponding {@link Architecture}.
- *
+ *
* Returns null if the architecture could not be determined.
*/
public static Architecture transformToArchitecture(String aInputStr)
diff --git a/src/distMaker/platform/LinuxUtils.java b/src/distMaker/platform/LinuxUtils.java
index 4993a72..b165a25 100644
--- a/src/distMaker/platform/LinuxUtils.java
+++ b/src/distMaker/platform/LinuxUtils.java
@@ -18,12 +18,12 @@ public class LinuxUtils
{
/**
* Returns the executable script used to launch the JVM.
- *
+ *
* If there are multiple launch scripts then this method may grab the wrong file and fail.
- *
+ *
* TODO: In the future the launch script should pass itself as an argument to the JVM and DistMaker should keep track
* of that. If the script is significantly manipulated from the original the launch file may be improperly detected.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static File getScriptFile()
@@ -60,7 +60,7 @@ public class LinuxUtils
/**
* Utility method to update the configuration to reflect the specified JRE version.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateAppLauncher(AppLauncherRelease aRelease, File aScriptFile)
@@ -119,7 +119,7 @@ public class LinuxUtils
/**
* Utility method to update the configuration to reflect the specified JRE version.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateJreVersion(JreVersion aJreVersion, File aScriptFile)
@@ -170,13 +170,13 @@ public class LinuxUtils
/**
* Utility method to update the specified maxMem var in the script (aFile) to the requested number of bytes.
- *
+ *
* Note this method assumes the specified file is a shell script built by DistMaker where the var maxMem holds the
* proper (right side) specification for the JVM's -Xmx value.
- *
+ *
* If the maxMem var definition is moved in the script file to after the launch of the application then this method
* will (silently) fail to configure the value needed to launch the JVM.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateMaxMem(long aNumBytes, File aScriptFile)
diff --git a/src/distMaker/platform/MemUtils.java b/src/distMaker/platform/MemUtils.java
index d7fc6e5..e5ec9b9 100644
--- a/src/distMaker/platform/MemUtils.java
+++ b/src/distMaker/platform/MemUtils.java
@@ -1,12 +1,17 @@
package distMaker.platform;
-import glum.reflect.ReflectUtil;
-import glum.unit.ByteUnit;
-
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.reflect.Method;
+import glum.reflect.ReflectUtil;
+import glum.unit.ByteUnit;
+
+/**
+ * Collection of utility methods that provide various functionality associated with system memory.
+ *
+ * @author lopeznr1
+ */
public class MemUtils
{
// Constants
@@ -59,9 +64,9 @@ public class MemUtils
/**
* Utility method that takes an inputStr, locates the fragment -Xmx*, and replaces the fragment with the appropriate
* -Xmx with respect to numBytes.
- *
+ *
* This method is a bit brittle in that it assumes the -Xmx string is surrounded with 1 white space character.
- *
+ *
* This method will return null if the string, -Xmx, is not located within the inputStr.
*/
public static String transformMaxMemHeapString(String inputStr, long numBytes)
diff --git a/src/distMaker/platform/PlatformUtils.java b/src/distMaker/platform/PlatformUtils.java
index 19bc8c3..45d65fd 100644
--- a/src/distMaker/platform/PlatformUtils.java
+++ b/src/distMaker/platform/PlatformUtils.java
@@ -5,19 +5,19 @@ import java.io.File;
import distMaker.ErrorDM;
import distMaker.jre.*;
import distMaker.node.AppRelease;
-import distMaker.utils.Version;
+import glum.version.Version;
/**
* Collection of utility methods that provide platform independent mechanism for the following:
- *
- * Namely legacy AppLauncher versions (versions equal to 0.0.x) will be expanded to:
+ * Namely legacy AppLauncher versions (versions equal to 0.0.x) will be expanded to:
+ *
* The returned path will be relative to the top of the application's DistMaker root rather than the applications
* Java run path.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*/
public static String getAppLauncherLocation(Version aVersion)
@@ -69,7 +69,7 @@ public class PlatformUtils
/**
* Utility method that returns the platform specific configuration file for the java application.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*/
public static File getConfigurationFile()
@@ -90,10 +90,10 @@ public class PlatformUtils
/**
* Utility method that returns the relative path where the specified JRE should be unpacked to.
- *
+ *
* The returned path will be relative to the top of the application's DistMaker root rather than the applications
* Java run path.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*/
public static String getJreLocation(JreVersion aJreVersion)
@@ -117,7 +117,7 @@ public class PlatformUtils
/**
* Returns the {@link Platform} on which the current JRE is running on.
- *
+ *
* If the platform is not recognized the a {@link ErrorDM} will be thrown.
*/
public static Platform getPlatform()
@@ -135,9 +135,9 @@ public class PlatformUtils
/**
* Utility method to configure the AppLauncher used by the (active) DistMaker distribution.
- *
+ *
* Note this will only take effect after the application has been restarted.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*
* @param aRelease
@@ -165,9 +165,9 @@ public class PlatformUtils
/**
* Utility method to configure the JRE version used by the (active) DistMaker distribution.
- *
+ *
* Note this will only take effect after the application has been restarted.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*
* @param aJrePath
@@ -195,9 +195,9 @@ public class PlatformUtils
/**
* Utility method to configure the (active) DistMaker distribution to use the specified maxMem.
- *
+ *
* Note this will only take effect after the application has been restarted.
- *
+ *
* On failure this method will throw an exception of type {@link ErrorDM}.
*
* @param maxMemSize
@@ -225,7 +225,7 @@ public class PlatformUtils
/**
* Utility method that takes a string and will transform it to the corresponding {@link Platform}.
- *
+ *
* Returns null if the platform could not be determined.
*/
public static Platform transformToPlatform(String aInputStr)
@@ -249,9 +249,9 @@ public class PlatformUtils
/**
* Utility method to update the (active) DistMaker distribution to reflect the specified AppRelease.
- *
+ *
* Note this will only take effect after the application has been restarted.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateAppRelease(AppRelease aRelease)
diff --git a/src/distMaker/platform/WindowsUtils.java b/src/distMaker/platform/WindowsUtils.java
index 9da9fdf..0b66d1e 100644
--- a/src/distMaker/platform/WindowsUtils.java
+++ b/src/distMaker/platform/WindowsUtils.java
@@ -17,13 +17,13 @@ public class WindowsUtils
{
/**
* Returns the l4j runtime configuration file. If one can not be determined then this method will return null.
- *
+ *
* If the configuration file is determined but does not exist, then an empty configuration file will be created.
- *
+ *
* Note this method looks for a file that ends in .l4j.cfg, or an exe file and creates the corresponding config file.
- *
+ *
* If there are multiple .exe or .l4j.cfg files, then this method may grab the wrong file and fail.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static File getConfigFile()
@@ -73,7 +73,7 @@ public class WindowsUtils
/**
* Utility method to update the configuration to reflect the specified AppLauncher version.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateAppLauncher(AppLauncherRelease aRelease, File aConfigFile)
@@ -84,7 +84,7 @@ public class WindowsUtils
/**
* Utility method to update the configuration to reflect the specified JRE version.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateJreVersion(JreVersion aJreVersion, File aConfigFile)
@@ -96,10 +96,10 @@ public class WindowsUtils
/**
* Utility method to update the specified max memory (-Xmx) value in the text file (aFile) to the specified
* maxMemVal.
- *
+ *
* Note this method is very brittle, and assumes that there is a single value where the string, -Xmx, is specified in
* the script. It assumes this string will be surrounded by a single space character on each side.
- *
+ *
* On failure this method will throw an exception of type ErrorDM.
*/
public static void updateMaxMem(long numBytes, File aConfigFile)
diff --git a/src/distMaker/utils/ParseUtils.java b/src/distMaker/utils/ParseUtils.java
index e805322..2bdeb9d 100644
--- a/src/distMaker/utils/ParseUtils.java
+++ b/src/distMaker/utils/ParseUtils.java
@@ -1,15 +1,17 @@
package distMaker.utils;
import distMaker.DistUtils;
+import glum.version.PlainVersion;
+import glum.version.Version;
public class ParseUtils
{
/**
* Utility method that processes the 'exit' instruction.
- *
+ *
* Returns true if the processing of the configuration file should exit.
- *
+ *
* Processing of the configuration file should exit if the specified needed version is not met or the version string
* could not be parsed into major minor components.
*
diff --git a/src/distMaker/utils/PlainVersion.java b/src/distMaker/utils/PlainVersion.java
deleted file mode 100644
index 748e1a9..0000000
--- a/src/distMaker/utils/PlainVersion.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package distMaker.utils;
-
-/**
- * Provides the standard implementation of the Version interface.
- *
- * @author lopeznr1
- */
-public class PlainVersion implements Version
-{
- // Constants
- public static PlainVersion AbsMin = new PlainVersion(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
- public static PlainVersion AbsMax = new PlainVersion(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
- public static PlainVersion Zero = new PlainVersion(0, 0, 0);
-
- // Attributes
- private final int major;
- private final int minor;
- private final int patch;
-
- public PlainVersion(int aMajor, int aMinor, int aPatch)
- {
- major = aMajor;
- minor = aMinor;
- patch = aPatch;
- }
-
- /**
- * Forms a PlainVersion from the specified string. The version should have have at most 3 integer components
- * separated by the char: '.'. Any extra components after the first 3 will be ignored. A NumberFormatException will
- * be thrown if the type of any of the first 3 are not integers.
- */
- public static PlainVersion parse(String aStr)
- {
- String[] tokenArr = aStr.split("\\.");
-
- int major = 0, minor = 0, patch = 0;
- major = Integer.parseInt(tokenArr[0]);
- if (tokenArr.length >= 2)
- minor = Integer.parseInt(tokenArr[1]);
- if (tokenArr.length >= 3)
- patch = Integer.parseInt(tokenArr[2]);
-
- return new PlainVersion(major, minor, patch);
- }
-
- @Override
- public int getMajorVersion()
- {
- return major;
- }
-
- @Override
- public int getMinorVersion()
- {
- return minor;
- }
-
- @Override
- public int getPatchVersion()
- {
- return patch;
- }
-
- @Override
- public String toString()
- {
- String retStr = "" + major + "." + minor;
- if (patch != 0)
- retStr += "." + patch;
-
- return retStr;
- }
-
-}
diff --git a/src/distMaker/utils/Version.java b/src/distMaker/utils/Version.java
deleted file mode 100644
index 1bb12cc..0000000
--- a/src/distMaker/utils/Version.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package distMaker.utils;
-
-/**
- * Interface which provides access to version components (major, minor, patch).
- *
- * Each component is modeled as an integer and it is assumed that higher values correspond to more developed software.
- *
- * Reference: https://semver.org/
- *
- * Implementors of this interface should be immutable.
- *
- * @author lopeznr1
- */
-public interface Version
-{
- /**
- * Returns the major version component.
- */
- public int getMajorVersion();
-
- /**
- * Returns the minor version component.
- */
- public int getMinorVersion();
-
- /**
- * Returns the patch version component.
- */
- public int getPatchVersion();
-
-}
diff --git a/src/distMaker/utils/VersionUtils.java b/src/distMaker/utils/VersionUtils.java
deleted file mode 100644
index 5cac5ab..0000000
--- a/src/distMaker/utils/VersionUtils.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package distMaker.utils;
-
-/**
- * Utility class that allows for comparing Versions.
- *
- * Eventually when Java allows operator overloading then this class can go away since the standard mathematical
- * comparison symbols would be much clearer.
- *
- * @author lopeznr1
- */
-public class VersionUtils
-{
- /**
- * Utility method that returns true if aVerA occurs after aVerB
- */
- public static boolean isAfter(Version aVerA, Version aVerB)
- {
- int majorA = aVerA.getMajorVersion();
- int minorA = aVerA.getMinorVersion();
- int patchA = aVerA.getPatchVersion();
- int majorB = aVerB.getMajorVersion();
- int minorB = aVerB.getMinorVersion();
- int patchB = aVerB.getPatchVersion();
-
- if (majorA > majorB)
- return true;
- if (majorA == majorB && minorA > minorB)
- return true;
- if (majorA == majorB && minorA == minorB && patchA > patchB)
- return true;
-
- return false;
- }
-
- /**
- * Utility method that returns true if aVerA occurs after aVerB
- */
- public static boolean isAfterOrEquar(Version aVerA, Version aVerB)
- {
- // Delegate to isAfter
- return isAfter(aVerB, aVerA) == false;
- }
-
- /**
- * Utility method that returns true if the following statement is true:
- *
- * aVerEval >= aVerMin && aVerEval <= aVerMax
- *
- * A LogicError will be thrown if the aVerMin and aVerMax are inverted (aVerMin > aVerMax)
- */
- public static boolean isInRange(Version aVerEval, Version aVerMin, Version aVerMax)
- {
- // Ensure the endpoints are not inverted
- if (isAfter(aVerMin, aVerMax) == true)
- throw new RuntimeException("Min/Max versions appear to be swapped. min: " + aVerMin + " max: " + aVerMax);
-
- // Decompose and delegate
- if (isAfter(aVerMin, aVerEval) == true)
- return false;
- if (isAfter(aVerEval, aVerMax) == true)
- return false;
-
- return true;
- }
-
- /**
- * Utility method to allow the comparison of two versions.
- *
- * @param aVerA
- * @param aVerB
- * @return
- */
- public static int compare(Version aVerA, Version aVerB)
- {
-
- int majorA = aVerA.getMajorVersion();
- int minorA = aVerA.getMinorVersion();
- int patchA = aVerA.getPatchVersion();
- int majorB = aVerB.getMajorVersion();
- int minorB = aVerB.getMinorVersion();
- int patchB = aVerB.getPatchVersion();
-
- int cmpVal;
- cmpVal = majorA - majorB;
- if (cmpVal != 0)
- return cmpVal;
- cmpVal = minorA - minorB;
- if (cmpVal != 0)
- return cmpVal;
- cmpVal = patchA - patchB;
- if (cmpVal != 0)
- return cmpVal;
-
- return 0;
- }
-}
diff --git a/tools/buildRelease b/tools/buildRelease
index 5cd4e95..679d339 100755
--- a/tools/buildRelease
+++ b/tools/buildRelease
@@ -8,6 +8,11 @@ import signal
import subprocess
import sys
+
+# Define the libraries the application depends on
+libList = ['glum-1.3.7.jar', 'guava-18.0.jar', 'distMaker.jar']
+
+
def buildRelease(aVersion, aDoNotClean=False):
"""Method that builds a release of DistMaker. Upon sucessful execution, a
tar.gz archive will be generated named: 'DistMaker-
+ *
* http://stackoverflow.com/questions/315618/how-do-i-extract-a-tar-file-in-java/7556307#7556307
- *
+ * Returns a list of all the available AppLauncher releases specified at:
* {@literal
- * {@code
- * while non legacy versions will be expanded to something like:
- * {@code
+ * {@code
+ * while non legacy versions will be expanded to something like:
+ * {@code
+ * Returns a list of all the available JRE releases specified at:
* {@literal
+ *
* TODO: This should probably be a mapping of Digest to Node rather than filename to Node
*/
private Map
+ *
+ *
+ * @author lopeznr1
*/
public class AppRelease implements Comparable
- *
+ *
+ *
*
* @param aDoc
* @throws XPathExpressionException
@@ -433,7 +433,7 @@ public class AppleUtils
/**
* Utility helper method to output aDoc to the specified file.
- *
- *
+ *
+ *
* Note that setting of system parameters will not take effect until the DistMaker application is restarted.
*
* @author lopeznr1
@@ -14,9 +14,9 @@ public class ArchitectureUtils
{
/**
* Returns the architecture the current JRE is running on.
- *
- *
+ *
+ *
* Note that setting of system parameters will not take effect until the DistMaker application is restarted.
*
* @author lopeznr1
@@ -26,11 +26,11 @@ public class PlatformUtils
{
/**
* Returns the file name that should be used for a specific AppLauncher version.
- *
- * {@code appLauncher.jar}
- * while non legacy versions will be expanded to something like:
- * {@code appLauncher-
+ * {@code appLauncher.jar}
+ * while non legacy versions will be expanded to something like:
+ * {@code appLauncher-