eu.lindenbaum.maven.erlang
Class BeamCompilerScript

java.lang.Object
  extended by eu.lindenbaum.maven.erlang.BeamCompilerScript
All Implemented Interfaces:
Script<CompilerResult>

public final class BeamCompilerScript
extends Object

A Script that can be used to compile erlang files. In case of compiler errors the script will leave the not yet compiled files uncompiled.

Author:
Tobias Schlager

Field Summary
protected  String script
           
 
Fields inherited from interface eu.lindenbaum.maven.erlang.Script
NL
 
Constructor Summary
BeamCompilerScript(List<File> files, File outdir, List<File> includes, List<String> options)
          Creates a compiler script for a List of erlang files.
 
Method Summary
 String get()
          Returns an evaluateable String containing the erlang script of the implementing class.
 CompilerResult handle(com.ericsson.otp.erlang.OtpErlangObject result)
          Converts the result of the Script execution into an object logging the compiler output correctly as well as providing failed compilation units, if any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

script

protected final String script
Constructor Detail

BeamCompilerScript

public BeamCompilerScript(List<File> files,
                          File outdir,
                          List<File> includes,
                          List<String> options)
                   throws org.apache.maven.plugin.MojoExecutionException
Creates a compiler script for a List of erlang files.

Parameters:
files - a list of files to compile
outdir - the destination directory for the compiled .beam
includes - a list of include directories
options - a list of compiler options according to the erlang docs
Throws:
org.apache.maven.plugin.MojoExecutionException
See Also:
http://www.erlang.org/doc/man/compile.html
Method Detail

get

public String get()
Description copied from interface: Script
Returns an evaluateable String containing the erlang script of the implementing class.

Returns:
An erlang script that can be evaluated.

handle

public CompilerResult handle(com.ericsson.otp.erlang.OtpErlangObject result)
Converts the result of the Script execution into an object logging the compiler output correctly as well as providing failed compilation units, if any.

Parameters:
result - The return term of the Script execution.
Returns:
An object capable of delivering the results transparently.


Copyright © 2011 Lindenbaum GmbH. All Rights Reserved.