Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding some UI manifest attributes as parameters to the CreateManifest class. #158

Merged
merged 1 commit into from
May 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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