View Javadoc
1   /**
2    * Copyright (C) 2008-2010 Matt Gumbley, DevZendo.org <http://devzendo.org>;
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  /**
18   * 
19   */
20  package org.devzendo.xplp;
21  
22  import java.io.File;
23  import java.io.IOException;
24  import java.util.Properties;
25  import java.util.Set;
26  
27  import org.apache.maven.artifact.Artifact;
28  import org.apache.maven.plugin.AbstractMojo;
29  
30  /**
31   * Create a Mc OS X launcher directory structure.
32   * @author matt
33   *
34   */
35  public class MacOSXScriptLauncherCreator extends UnixScriptLauncherCreator {
36      private final String mLauncherType;
37      /**
38       * @param mojo the parent mojo class
39       * @param outputDirectory where to create the .app structure 
40       * @param mainClassName the main class
41       * @param applicationName the name of the application
42       * @param libraryDirectory where the libraries are stored
43       * @param transitiveArtifacts the set of transitive artifact dependencies
44       * @param resourceDirectories the project's resource directories
45       * @param parameterProperties the plugin configuration parameters, as properties
46       * @param systemProperties an array of name=value system properties
47       * @param vmArguments an array of arguments to the VM
48       * @param narClassifierTypes an array of NAR classifier:types
49       * @param launcherType the launcher type, Console or GUI
50       */
51      public MacOSXScriptLauncherCreator(final AbstractMojo mojo,
52              final File outputDirectory,
53              final String mainClassName,
54              final String applicationName,
55              final String libraryDirectory,
56              final Set<Artifact> transitiveArtifacts,
57              final Set<File> resourceDirectories,
58              final Properties parameterProperties, 
59              final String[] systemProperties, 
60              final String[] vmArguments,
61              final String[] narClassifierTypes,
62              final String launcherType) {
63          super(mojo, outputDirectory, "macosx", mainClassName,
64              applicationName, libraryDirectory,
65              transitiveArtifacts, resourceDirectories, parameterProperties,
66              systemProperties, vmArguments, narClassifierTypes);
67          mLauncherType = launcherType;
68      }
69  
70      /**
71       * {@inheritDoc}
72       */
73      @Override
74      public void createLauncher() throws IOException {
75          getMojo().getLog().info("Launcher type:               " + mLauncherType);
76          super.createLauncher();
77      }
78  }