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

Implement --update-text option. #144

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions src/main/java/fxlauncher/CreateManifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
Path appPath = Paths.get(args[2]);

String cacheDir = null;
String updateText = null;
Boolean acceptDowngrade = null;
Boolean stopOnUpdateErrors = null;
String parameters = null;
Expand Down Expand Up @@ -55,6 +56,10 @@ 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 stopOnUpdateErrors
frknikiz marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -90,6 +95,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
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 @@ -106,6 +112,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
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 All @@ -119,7 +126,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
}
// If --stop-on-update-errors was not specified,
// use --stopOnUpdateError if it was specified.
else if (stopOnUpdateErrorsDeprecated != null){
else if (stopOnUpdateErrorsDeprecated != null) {
manifest.stopOnUpdateErrors = stopOnUpdateErrorsDeprecated;
System.out.println("Warning: --stopOnUpdateErrors is deprecated. "
+ "Use --stop-on-update-errors instead.");
Expand All @@ -133,7 +140,7 @@ public static FXManifest create(URI baseURI, String launchClass, Path appPath) t
manifest.uri = baseURI;
manifest.launchClass = launchClass;

if(!manifest.uri.getPath().endsWith("/")) {
if (!manifest.uri.getPath().endsWith("/")) {
manifest.uri = new URI(String.format("%s/", baseURI.toString()));
}
Files.walkFileTree(appPath, new SimpleFileVisitor<Path>() {
Expand All @@ -149,8 +156,9 @@ 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.
*
* @param includeExtensions
*/
public static void setIncludeExtensions(List<String> includeExtensions) {
Expand Down