Skip to content

Commit

Permalink
Release 1.0.9 with support for parameter configurable manifest locati…
Browse files Browse the repository at this point in the history
…on (#3)
  • Loading branch information
Edvin Syse committed Mar 14, 2016
1 parent 09daf17 commit 825ad8c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.0.9] - Unreleased

### Added

- App manifest location can be given as command line parameter (https://github.com/edvin/fxlauncher/issues/3)

## [1.0.8] - 2016-03-02

### Added
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See the launcher in action in this short [screencast](https://www.youtube.com/wa

## How does it work?

FXLauncher is a 14Kb jar that can be used to boot your application. It knows the location
FXLauncher is a 18Kb jar that can be used to boot your application. It knows the location
of your application repository where you host all the app resources.

See a manifest [example here](http://fxldemo.tornado.no/app.xml). FXLauncher will look up the
Expand All @@ -35,7 +35,15 @@ Before each run, the launcher will synchronize all resources and seamlessly laun
## How to use FXLauncher

See the QuickStart projects at the top of the README for information on integrating FXLauncher in your build system.

## Adhoc usage

FXLauncher can also be used to launch an application at an arbitrary url by specifying the `--app` parameter at startup:

```bash
java -jar fxlauncher.jar --app=http://remote/location/app.xml
```

#### Native installers

The native installer does not contain any application code, only the launcher. There is
Expand Down Expand Up @@ -64,6 +72,6 @@ then made available to the `FXMLLoader`. You can access it via `FXMLLoader.getDe

### Platform specific resources

From version 1.0.7, FXLauncher supports filtering of resources for the running platform. Any resource
FXLauncher supports filtering of resources for the running platform. Any resource
that ends with `-[mac|win|linux].jar` will only be downloaded and put on the classpath on the corresponding
platform. The manifest enforces this though the `os` attribute in `app.xml`.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>no.tornado</groupId>
<artifactId>fxlauncher</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
<packaging>jar</packaging>
<name>FX Launcher</name>
<description>Auto updating launcher for JavaFX Applications</description>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/fxlauncher/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -191,6 +193,15 @@ private void reportError(String title, Throwable error) {
}

private void syncManifest() throws Exception {
Map<String, String> namedParams = getParameters().getNamed();

if (namedParams.containsKey("app")) {
String manifestURL = namedParams.get("app");
log.info(String.format("Loading manifest from parameter supplied location %s", manifestURL));
manifest = JAXB.unmarshal(URI.create(manifestURL), FXManifest.class);
return;
}

URL embeddedManifest = Launcher.class.getResource("/app.xml");
manifest = JAXB.unmarshal(embeddedManifest, FXManifest.class);

Expand Down

0 comments on commit 825ad8c

Please sign in to comment.