Skip to content

Commit

Permalink
Merge pull request #158 from TurekBot/ui-parameters
Browse files Browse the repository at this point in the history
Adding some UI manifest attributes as parameters to the CreateManifest class.
  • Loading branch information
Edvin Syse committed May 2, 2019
2 parents 3024b41 + 3b051f6 commit edfc7a5
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions src/main/java/fxlauncher/CreateManifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public static void main(String[] args) throws IOException, URISyntaxException {
String launchClass = args[1];
Path appPath = Paths.get(args[2]);

String cacheDir = null;
String updateText = null;
String updateLabelStyle = null;
String progressBarStyle = null;
String wrapperStyle = null;
String cacheDir = null;
Boolean acceptDowngrade = null;
Boolean stopOnUpdateErrors = null;
String parameters = null;
Expand All @@ -42,6 +45,22 @@ public static void main(String[] args) throws IOException, URISyntaxException {
Map<String, String> named = params.getNamed();

if (named != null) {
// Configure updateText
if (named.containsKey("update-text"))
updateText = named.get("update-text");

// Configure updateLabelStyle
if (named.containsKey("update-label-style"))
updateLabelStyle = named.get("update-label-style");

// Configure progressBarStyle
if (named.containsKey("progress-bar-style"))
progressBarStyle = named.get("progress-bar-style");

// Configure wrapperStyle
if (named.containsKey("wrapper-style"))
wrapperStyle = named.get("wrapper-style");

// Configure cacheDir
if (named.containsKey("cache-dir"))
cacheDir = named.get("cache-dir");
Expand All @@ -54,10 +73,6 @@ public static void main(String[] args) throws IOException, URISyntaxException {
if (named.containsKey("stop-on-update-errors"))
stopOnUpdateErrors = Boolean.valueOf(named.get("stop-on-update-errors"));

// Configure updateText
if (named.containsKey("update-text"))
updateText = named.get("update-text");

// Configure preload native libraries
if (named.containsKey("preload-native-libraries"))
preloadNativeLibraries = named.get("preload-native-libraries");
Expand Down Expand Up @@ -87,13 +102,16 @@ public static void main(String[] args) throws IOException, URISyntaxException {
stopOnUpdateErrorsDeprecated = true;
continue;
}
if (raw.startsWith("--update-text=")) continue;
if (raw.startsWith("--update-label-style=")) continue;
if (raw.startsWith("--progress-bar-style=")) continue;
if (raw.startsWith("--wrapper-style=")) continue;
if (raw.startsWith("--cache-dir=")) continue;
if (raw.startsWith("--accept-downgrade=")) continue;
if (raw.startsWith("--stop-on-update-errors=")) continue;
if (raw.startsWith("--include-extensions=")) continue;
if (raw.startsWith("--preload-native-libraries=")) continue;
if (raw.startsWith("--whats-new")) continue;
if (raw.startsWith("--update-text")) continue;
if (raw.startsWith("--lingering-update-screen")) continue;
if (rest.length() > 0) rest.append(" ");
rest.append(raw);
Expand All @@ -105,12 +123,15 @@ public static void main(String[] args) throws IOException, URISyntaxException {
}

FXManifest manifest = create(baseURI, launchClass, appPath);
if (updateText != null) manifest.updateText = updateText;
if (updateLabelStyle != null) manifest.updateLabelStyle = updateLabelStyle;
if (progressBarStyle != null) manifest.progressBarStyle = progressBarStyle;
if (wrapperStyle != null) manifest.wrapperStyle = wrapperStyle;
if (cacheDir != null) manifest.cacheDir = cacheDir;
if (acceptDowngrade != null) manifest.acceptDowngrade = acceptDowngrade;
if (parameters != null) manifest.parameters = parameters;
if (preloadNativeLibraries != null) manifest.preloadNativeLibraries = preloadNativeLibraries;
if (whatsNew != null) manifest.whatsNewPage = whatsNew;
if (updateText != null) manifest.updateText = updateText;
manifest.lingeringUpdateScreen = lingeringUpdateScreen;

// Use --stop-on-update-errors if it was specified.
Expand Down Expand Up @@ -155,7 +176,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
/**
* Add the includeExtensions to the default list of "war" and "jar".
* <p>
* Allthough the method is called setIncludeExtensions, it actually does an addAll.
* Although the method is called setIncludeExtensions, it actually does an addAll.
*
* @param includeExtensions
*/
Expand Down

0 comments on commit edfc7a5

Please sign in to comment.