File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/main/java/io/github/fvarrui/javapackager Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,18 @@ protected File doApply(WindowsPackager packager) throws Exception {
3434 String jreDirectoryName = packager .getJreDirectoryName ();
3535 String jreMinVersion = packager .getJreMinVersion ();
3636 File jarFile = packager .getJarFile ();
37+ File appFolder = packager .getAppFolder ();
3738
3839 createAssets (packager ); // creates a folder only for launch4j assets
3940
40- String jarPath = winConfig .isWrapJar () ? getGenericJar ().getAbsolutePath () : jarFile .getName ();
41+ // copies JAR to app folder
42+ String jarPath ;
43+ if (winConfig .isWrapJar ()) {
44+ jarPath = getGenericJar ().getAbsolutePath ();
45+ } else {
46+ FileUtils .copyFileToFolder (jarFile , appFolder );
47+ jarPath = jarFile .getName ();
48+ }
4149
4250 Launch4jLibraryTask l4jTask = Context .getGradleContext ().getLibraryTask ();
4351 l4jTask .getOutputs ().upToDateWhen (task -> false );
Original file line number Diff line number Diff line change @@ -45,10 +45,18 @@ protected File doApply(WindowsPackager packager) throws Exception {
4545 String classpath = packager .getClasspath ();
4646 String jreMinVersion = packager .getJreMinVersion ();
4747 File jarFile = packager .getJarFile ();
48+ File appFolder = packager .getAppFolder ();
4849
4950 createAssets (packager );
5051
51- String jarPath = winConfig .isWrapJar () ? getGenericJar ().getAbsolutePath () : jarFile .getName ();
52+ // copies JAR to app folder
53+ String jarPath ;
54+ if (winConfig .isWrapJar ()) {
55+ jarPath = getGenericJar ().getAbsolutePath ();
56+ } else {
57+ FileUtils .copyFileToFolder (jarFile , appFolder );
58+ jarPath = jarFile .getName ();
59+ }
5260
5361 List <Element > optsElements = vmArgs .stream ().map (arg -> element ("opt" , arg )).collect (Collectors .toList ());
5462
You can’t perform that action at this time.
0 commit comments