Skip to content

Commit

Permalink
Merge pull request #144 from frknikiz/master
Browse files Browse the repository at this point in the history
Implement --update-text option.
  • Loading branch information
Edvin Syse authored Dec 19, 2018
2 parents bdc477c + c460576 commit 5b6eaa5
Showing 1 changed file with 11 additions and 3 deletions.
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 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 @@ -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

0 comments on commit 5b6eaa5

Please sign in to comment.