eu.lindenbaum.maven.util
Class MojoUtils

java.lang.Object
  extended by eu.lindenbaum.maven.util.MojoUtils

public final class MojoUtils
extends Object

Containing utilities related to maven-erlang-plugin specific Mojos.

Since:
2.0.0
Author:
Olle Törnström , Sven Heyll , Tobias Schlager

Constructor Summary
MojoUtils()
           
 
Method Summary
static List<File> getApplicationCodePaths(Properties p)
          Gathers a complete list of directories used as code paths in an application's build process.
static List<File> getApplicationTestCodePaths(Properties p)
          Gathers a complete list of directories used as code paths in an application's test build process.
static List<File> getIncludeDirectories(Properties p)
          Gathers a complete list of directories used as include directories in a standard compilation process.
static List<File> getReleaseCodePaths(Properties p)
          Gathers a complete list of directories used as code paths in a release build process.
static List<File> getTestIncludeDirectories(Properties p)
          Gathers a complete list of directories used as include directories in a test compilation process.
static Collection<File> getTestSupportArtifacts(Properties p)
          Returns a list of artifacts used by the plugin to provide a proper test phase, e.g. the compiled artifacts of getTestSupportScripts(Properties).
static Collection<File> getTestSupportScripts(Properties p)
          Returns a list of script files used by the plugin to provide a proper test phase, e.g. erlang scripts for surefire reports.
static boolean isWindows()
          Returns whether the executing JVM is running under Microsoft Windows or not.
static boolean newerFilesThan(File dir, File reference)
          Returns whether there are erlang source/header files in a specific directory (recursive) having a newer modification time than a given reference file.
static void startBackend(org.apache.maven.plugin.logging.Log log, String cmd, String nodeName, String nodeCookie)
          Attaches the plugin to a backend erlang node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MojoUtils

public MojoUtils()
Method Detail

getTestSupportScripts

public static Collection<File> getTestSupportScripts(Properties p)
Returns a list of script files used by the plugin to provide a proper test phase, e.g. erlang scripts for surefire reports.

Parameters:
p - the properties object containing plug-in paths
Returns:
a non-null collection of test support scripts

getTestSupportArtifacts

public static Collection<File> getTestSupportArtifacts(Properties p)
Returns a list of artifacts used by the plugin to provide a proper test phase, e.g. the compiled artifacts of getTestSupportScripts(Properties).

Parameters:
p - the properties object containing plug-in paths
Returns:
a non-null collection of test support artifacts

isWindows

public static boolean isWindows()
                         throws org.apache.maven.plugin.MojoExecutionException
Returns whether the executing JVM is running under Microsoft Windows or not.

Returns:
true on Microsoft Windows systems, false otherwise
Throws:
org.apache.maven.plugin.MojoExecutionException - in case the 'os.name' property is not set

startBackend

public static void startBackend(org.apache.maven.plugin.logging.Log log,
                                String cmd,
                                String nodeName,
                                String nodeCookie)
                         throws org.apache.maven.plugin.MojoExecutionException
Attaches the plugin to a backend erlang node. If the backend node is not already running it will be started.

Parameters:
log - logger to use
cmd - path to the erl command
nodeName - name of the backend to connect to
nodeCookie - cookie of the backend to connect to
Throws:
org.apache.maven.plugin.MojoExecutionException

newerFilesThan

public static boolean newerFilesThan(File dir,
                                     File reference)
Returns whether there are erlang source/header files in a specific directory (recursive) having a newer modification time than a given reference file.

Parameters:
dir - input directory to check
reference - the file taken as reference time (modified)
Returns:
true if there are .erl/.hrl files newer than the reference file

getIncludeDirectories

public static List<File> getIncludeDirectories(Properties p)
Gathers a complete list of directories used as include directories in a standard compilation process.

Parameters:
p - the properties object containing some of the include directories
Returns:
a non-null list of include directories

getTestIncludeDirectories

public static List<File> getTestIncludeDirectories(Properties p)
Gathers a complete list of directories used as include directories in a test compilation process.

Parameters:
p - the properties object containing some of the include directories
Returns:
a non-null list of include directories

getApplicationCodePaths

public static List<File> getApplicationCodePaths(Properties p)
Gathers a complete list of directories used as code paths in an application's build process.

Parameters:
p - the properties object containing the code path directories
Returns:
a non-null list of code path directories

getApplicationTestCodePaths

public static List<File> getApplicationTestCodePaths(Properties p)
Gathers a complete list of directories used as code paths in an application's test build process.

Parameters:
p - the properties object containing the code path directories
Returns:
a non-null list of code path directories

getReleaseCodePaths

public static List<File> getReleaseCodePaths(Properties p)
Gathers a complete list of directories used as code paths in a release build process.

Parameters:
p - the properties object containing the code path directories
Returns:
a non-null list of code path directories


Copyright © 2011 Lindenbaum GmbH. All Rights Reserved.