3939
4040/**
4141 * Abstract implementation for creating the resulting app bundler image
42- *
42+ *
4343 * @author gamma
4444 *
4545 * @param <T> the Task
@@ -53,7 +53,7 @@ public abstract class AbstractOSXApplicationBuilder<T extends AbstractTask, S ex
5353
5454 /**
5555 * Setup this builder.
56- *
56+ *
5757 * @param task - original task
5858 * @param setup - original setup
5959 * @param fileResolver - original fileResolver
@@ -66,11 +66,11 @@ protected AbstractOSXApplicationBuilder( T task, S setup, FileResolver fileResol
6666
6767 /**
6868 * Prepare the basic settings of the application
69- *
69+ *
7070 * @param application to use
7171 * @throws Exception on errors
7272 */
73- protected void prepareApplication ( Application application ) throws Exception {
73+ protected void prepareApplication ( Application application , boolean isJNLPBuild ) throws Exception {
7474
7575 String appName = application .getDisplayName ();
7676
@@ -106,17 +106,19 @@ protected void prepareApplication( Application application ) throws Exception {
106106
107107 appBundler .setIdentifier ( identifier );
108108
109-
110- if ( application .getMainClass () == null ) {
111- throw new ConfigurationException ( "A main class is required for the application. You have to configure at least the following:\n \n \t setupBuilder {\n \t \t [..]\n \t \t mainClass = 'your.org.main.class'\n \t }\n \n " );
112- }
113- appBundler .setMainClassName ( application .getMainClass () );
109+ if ( !isJNLPBuild ) {
110+ // Main Class and Jar File are required.
111+ if ( application .getMainClass () == null ) {
112+ throw new ConfigurationException ( "A main class is required for the application. You have to configure at least the following:\n \n \t setupBuilder {\n \t \t [..]\n \t \t mainClass = 'your.org.main.class'\n \t }\n \n " );
113+ }
114+ appBundler .setMainClassName ( application .getMainClass () );
114115
115- // Check for mainJar to not be null
116- if ( mainJar == null ) {
117- throw new ConfigurationException ( "A main jar file is required for the application. You have to configure at least the following:\n \n \t setupBuilder {\n \t \t [..]\n \t \t mainJar = '/path/to/yourMain.jar'\n \t }\n \n " );
116+ // Check for mainJar to not be null
117+ if ( mainJar == null ) {
118+ throw new ConfigurationException ( "A main jar file is required for the application. You have to configure at least the following:\n \n \t setupBuilder {\n \t \t [..]\n \t \t mainJar = '/path/to/yourMain.jar'\n \t }\n \n " );
119+ }
120+ appBundler .setJarLauncherName ( mainJar );
118121 }
119- appBundler .setJarLauncherName ( mainJar );
120122
121123 appBundler .setCopyright ( setup .getCopyright () );
122124 appBundler .setIcon ( getApplicationIcon () );
@@ -138,7 +140,7 @@ protected void finishApplication() {
138140
139141 /**
140142 * Set the document types from the list
141- *
143+ *
142144 * @param list of document types
143145 * @throws IOException on complications with the icon
144146 */
@@ -193,7 +195,7 @@ protected void bundleJre() {
193195
194196 /**
195197 * Returns the icns application icon file
196- *
198+ *
197199 * @return Icon file
198200 * @throws IOException when there are errors while getting the file
199201 */
@@ -207,7 +209,7 @@ protected File getApplicationIcon() throws IOException {
207209
208210 /**
209211 * Modify a plist file
210- *
212+ *
211213 * @param plist file to modify
212214 * @param property property to set
213215 * @param value of property
@@ -226,7 +228,7 @@ protected void setPlistProperty( File plist, String property, String value ) {
226228
227229 /**
228230 * Add an entry to a plist file
229- *
231+ *
230232 * @param plist file to modify
231233 * @param property property to set
232234 * @param type of property
@@ -246,7 +248,7 @@ protected void addPlistProperty( File plist, String property, String type, Strin
246248
247249 /**
248250 * Add an entry to a plist file
249- *
251+ *
250252 * @param plist file to modify
251253 * @param property property to set
252254 */
@@ -264,7 +266,7 @@ protected void deletePlistProperty( File plist, String property ) {
264266
265267 /**
266268 * Copy the files defined in the gradle script into their final destination
267- *
269+ *
268270 * @param application the application
269271 * @throws IOException on errors
270272 */
@@ -277,7 +279,7 @@ protected void copyBundleFiles( Application application ) throws IOException {
277279
278280 /**
279281 * Set File permissions to the resulting application
280- *
282+ *
281283 * @param destination of the files to manipulate
282284 * @throws IOException on errors
283285 */
@@ -311,7 +313,7 @@ protected void setApplicationFilePermissions( File destination ) throws IOExcept
311313
312314 /**
313315 * Return the current AppBundler.
314- *
316+ *
315317 * @return appBundler
316318 */
317319 protected AppBundlerTask getAppBundler () {
0 commit comments