Skip to content

Commit

Permalink
Converts tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Dec 30, 2014
1 parent e773e9c commit 5b06193
Show file tree
Hide file tree
Showing 8 changed files with 832 additions and 829 deletions.
122 changes: 61 additions & 61 deletions src/main/java/com/akathist/maven/plugins/launch4j/ClassPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,62 +28,62 @@

public class ClassPath {

/**
* The main class to run. This is not required if you are wrapping an executable jar.
*/
@Parameter
String mainClass;

/**
* The launch4j executable sets up a classpath before running your jar, but it must know what the
* classpath should be. If you set this property to true, the plugin will indicate a classpath
* based on all the dependencies your program will need at runtime. You can augment this classpath
* using the preCp and postCp properties.
*/
@Parameter(defaultValue="true")
boolean addDependencies = true;

/**
* If you want maven to build the classpath from dependencies, you can optionally set the jarLocation,
* which is the location of the jars in your distro relative to the executable. So if your distro
* has the exe at the top level and all the jars in a lib directory, you could set this to "lib."
* This property does not affect preCp and postCp.
*/
@Parameter
String jarLocation;

/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* after this list.
*/
@Parameter
String preCp;

/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* before this list.
*/
@Parameter
String postCp;

private void addToCp(List<String> cp, String cpStr) {
cp.addAll(Arrays.asList(cpStr.split("\\s*;\\s*")));
}

net.sf.launch4j.config.ClassPath toL4j(Set<Artifact> dependencies, List<Artifact> runtimeDependencies) {
net.sf.launch4j.config.ClassPath ret = new net.sf.launch4j.config.ClassPath();
ret.setMainClass(mainClass);
List<String> cp = new ArrayList<String>();
if (preCp != null) addToCp(cp, preCp);

if (addDependencies) {
if (jarLocation == null) jarLocation = "";
else if ( ! jarLocation.endsWith("/")) jarLocation += "/";
/**
* The main class to run. This is not required if you are wrapping an executable jar.
*/
@Parameter
String mainClass;

/**
* The launch4j executable sets up a classpath before running your jar, but it must know what the
* classpath should be. If you set this property to true, the plugin will indicate a classpath
* based on all the dependencies your program will need at runtime. You can augment this classpath
* using the preCp and postCp properties.
*/
@Parameter(defaultValue = "true")
boolean addDependencies = true;

/**
* If you want maven to build the classpath from dependencies, you can optionally set the jarLocation,
* which is the location of the jars in your distro relative to the executable. So if your distro
* has the exe at the top level and all the jars in a lib directory, you could set this to &quot;lib.&quot;
* This property does not affect preCp and postCp.
*/
@Parameter
String jarLocation;

/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* after this list.
*/
@Parameter
String preCp;

/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* before this list.
*/
@Parameter
String postCp;

private void addToCp(List<String> cp, String cpStr) {
cp.addAll(Arrays.asList(cpStr.split("\\s*;\\s*")));
}

net.sf.launch4j.config.ClassPath toL4j(Set<Artifact> dependencies, List<Artifact> runtimeDependencies) {
net.sf.launch4j.config.ClassPath ret = new net.sf.launch4j.config.ClassPath();
ret.setMainClass(mainClass);

List<String> cp = new ArrayList<String>();
if (preCp != null) addToCp(cp, preCp);

if (addDependencies) {
if (jarLocation == null) jarLocation = "";
else if (!jarLocation.endsWith("/")) jarLocation += "/";

// Add all runtime dependencies as we need them to run the wrapped jar
dependencies.addAll(runtimeDependencies);
Expand All @@ -98,13 +98,13 @@ net.sf.launch4j.config.ClassPath toL4j(Set<Artifact> dependencies, List<Artifact
cp.add(jarLocation + depFilename);
}
}
}
}

if (postCp != null) addToCp(cp, postCp);
ret.setPaths(cp);
if (postCp != null) addToCp(cp, postCp);
ret.setPaths(cp);

return ret;
}
return ret;
}

@Override
public String toString() {
Expand Down
208 changes: 104 additions & 104 deletions src/main/java/com/akathist/maven/plugins/launch4j/Jre.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,120 +27,120 @@
*/
public class Jre {

/**
* Use this property when you are bundling a jre with your application. It holds the path to the jre.
* If relative, this path is from the executable.
* <p>
* If you specify path only and not minVersion, then the executable will show an error if the jre is not found.
* <p>
* If you specify path along with minVersion, then the executable will check the path first, and if no jre
* is found there, it will search the local system for a jre matching minVersion. If it still doesn't
* find anything, it will show the java download page. You may also specify maxVersion to further
* constrain the search.
*/
String path;

/**
* Use this property if you want the executable to search the system for a jre.
* It names the minimum version acceptable, in x.x.x[_xx] format.
* <p>
* If you specify this property without giving a path, then the executable will search for a jre
* and, none is found, display the java download page.
* <p>
* If you include a path also, the executable will try that path before searching for jre matching minVersion.
* <p>
* In either case, you can also specify a maxVersion.
*/
String minVersion;

/**
* If you specify minVersion, you can also use maxVersion to further constrain the search for a jre.
* This property should be in the format x.x.x[_xx].
*/
String maxVersion;

/**
* Allows you to specify a preference for a public JRE or a private JDK runtime.
* <p>
* Valid values are:
* <table border="1">
* <tr>
* <td>jreOnly</td>
* <td>Always use a public JRE</td>
* </tr>
* <tr>
* <td>preferJre</td>
* <td>Prefer a public JRE, but use a JDK private runtime if it is newer than the public JRE</td>
* </tr>
* <tr>
* <td>preferJdk</td>
* <td>Prefer a JDK private runtime, but use a public JRE if it is newer than the JDK</td>
* </tr>
* <tr>
* <td>jdkOnly</td>
* <td>Always use a private JDK runtime (fails if there is no JDK installed)</td>
* </tr>
* </table>
*/
@Parameter(defaultValue="preferJre")
String jdkPreference;

/**
* Sets java's initial heap size in MB, like the -Xms flag.
*/
int initialHeapSize;

/**
* Sets java's initial heap size in percent of free memory.
*/
int initialHeapPercent;

/**
* Sets java's maximum heap size in MB, like the -Xmx flag.
*/
int maxHeapSize;

/**
* Sets java's maximum heap size in percent of free memory.
*/
int maxHeapPercent;

/**
* Use this to pass arbitrary options to the java/javaw program.
* For instance, you can say:
* <pre>
* &lt;opt&gt;-Dlaunch4j.exedir="%EXEDIR%"&lt;/opt&gt;
* &lt;opt&gt;-Dlaunch4j.exefile="%EXEFILE%"&lt;/opt&gt;
* &lt;opt&gt;-Denv.path="%Path%"&lt;/opt&gt;
* &lt;opt&gt;-Dsettings="%HomeDrive%%HomePath%\\settings.ini"&lt;/opt&gt;
* </pre>
*/
List<String> opts;
/**
* Use this property when you are bundling a jre with your application. It holds the path to the jre.
* If relative, this path is from the executable.
* <p>
* If you specify path only and not minVersion, then the executable will show an error if the jre is not found.
* <p>
* If you specify path along with minVersion, then the executable will check the path first, and if no jre
* is found there, it will search the local system for a jre matching minVersion. If it still doesn't
* find anything, it will show the java download page. You may also specify maxVersion to further
* constrain the search.
*/
String path;

/**
* Use this property if you want the executable to search the system for a jre.
* It names the minimum version acceptable, in x.x.x[_xx] format.
* <p>
* If you specify this property without giving a path, then the executable will search for a jre
* and, none is found, display the java download page.
* <p>
* If you include a path also, the executable will try that path before searching for jre matching minVersion.
* <p>
* In either case, you can also specify a maxVersion.
*/
String minVersion;

/**
* If you specify minVersion, you can also use maxVersion to further constrain the search for a jre.
* This property should be in the format x.x.x[_xx].
*/
String maxVersion;

/**
* Allows you to specify a preference for a public JRE or a private JDK runtime.
* <p>
* Valid values are:
* <table border="1">
* <tr>
* <td>jreOnly</td>
* <td>Always use a public JRE</td>
* </tr>
* <tr>
* <td>preferJre</td>
* <td>Prefer a public JRE, but use a JDK private runtime if it is newer than the public JRE</td>
* </tr>
* <tr>
* <td>preferJdk</td>
* <td>Prefer a JDK private runtime, but use a public JRE if it is newer than the JDK</td>
* </tr>
* <tr>
* <td>jdkOnly</td>
* <td>Always use a private JDK runtime (fails if there is no JDK installed)</td>
* </tr>
* </table>
*/
@Parameter(defaultValue = "preferJre")
String jdkPreference;

/**
* Sets java's initial heap size in MB, like the -Xms flag.
*/
int initialHeapSize;

/**
* Sets java's initial heap size in percent of free memory.
*/
int initialHeapPercent;

/**
* Sets java's maximum heap size in MB, like the -Xmx flag.
*/
int maxHeapSize;

/**
* Sets java's maximum heap size in percent of free memory.
*/
int maxHeapPercent;

/**
* Use this to pass arbitrary options to the java/javaw program.
* For instance, you can say:
* <pre>
* &lt;opt&gt;-Dlaunch4j.exedir="%EXEDIR%"&lt;/opt&gt;
* &lt;opt&gt;-Dlaunch4j.exefile="%EXEFILE%"&lt;/opt&gt;
* &lt;opt&gt;-Denv.path="%Path%"&lt;/opt&gt;
* &lt;opt&gt;-Dsettings="%HomeDrive%%HomePath%\\settings.ini"&lt;/opt&gt;
* </pre>
*/
List<String> opts;

/**
* Sets JVM version to use: 32 bits, 64 bits or 64/32 bits
* Possible values: 32, 64, 64/32 - it will fallback to default value if different option was used
* Default value is: 64/32
*/
@Parameter(defaultValue="64/32")
@Parameter(defaultValue = "64/32")
String runtimeBits;

net.sf.launch4j.config.Jre toL4j() {
net.sf.launch4j.config.Jre ret = new net.sf.launch4j.config.Jre();

ret.setPath(path);
ret.setMinVersion(minVersion);
ret.setMaxVersion(maxVersion);
ret.setJdkPreference(jdkPreference);
ret.setInitialHeapSize(initialHeapSize);
ret.setInitialHeapPercent(initialHeapPercent);
ret.setMaxHeapSize(maxHeapSize);
ret.setMaxHeapPercent(maxHeapPercent);
ret.setOptions(opts);
net.sf.launch4j.config.Jre toL4j() {
net.sf.launch4j.config.Jre ret = new net.sf.launch4j.config.Jre();

ret.setPath(path);
ret.setMinVersion(minVersion);
ret.setMaxVersion(maxVersion);
ret.setJdkPreference(jdkPreference);
ret.setInitialHeapSize(initialHeapSize);
ret.setInitialHeapPercent(initialHeapPercent);
ret.setMaxHeapSize(maxHeapSize);
ret.setMaxHeapPercent(maxHeapPercent);
ret.setOptions(opts);
ret.setRuntimeBits(runtimeBits);

return ret;
}
return ret;
}

@Override
public String toString() {
Expand Down
Loading

0 comments on commit 5b06193

Please sign in to comment.