Class BuildProblem

java.lang.Object
org.moeaframework.util.CommandLineUtility
org.moeaframework.builder.BuildProblem

public class BuildProblem extends CommandLineUtility
Command line tool for creating new natively-compiled problems. This tool will create a folder containing all the files needed to write and compile the problem, package everything into a JAR, and display instructions for using the generated files.

To define a new language:

  1. Create a nested package with the name of the language.
  2. Create a Manifest file with lines formatted as <sourceFile> -> <destinationFile>. This controls how the files are extracted into the destination folder.
  3. Create the individual files, typically with the extension .template to prevent compilation errors. These files can use ${key} string substitutions.
  4. Add the name of the language to LANGUAGES.
  • Field Details

    • LANGUAGES

      public static final Map<String,String> LANGUAGES
      The supported language options.
    • PATH_SEPARATOR

      public static final String PATH_SEPARATOR
      The variable used in Makefiles specifying the platform-specific classpath separator.
      See Also:
  • Constructor Details

    • BuildProblem

      public BuildProblem()
      Creates a new instance of this command line tool.
  • Method Details

    • getOptions

      public org.apache.commons.cli.Options getOptions()
      Description copied from class: CommandLineUtility
      Returns the options made available by this command line utility. The base implementation automatically provides the -h,--help option. Implementations overriding this method and begin with a call to super.getOptions().
      Overrides:
      getOptions in class CommandLineUtility
      Returns:
      the options made available by this command line utility
    • run

      public void run(org.apache.commons.cli.CommandLine commandLine) throws Exception
      Description copied from class: CommandLineUtility
      Runs this command line utility with the specified command line arguments.
      Specified by:
      run in class CommandLineUtility
      Parameters:
      commandLine - the command line arguments
      Throws:
      Exception - if any exception occurred while running this command
    • main

      public static void main(String[] args) throws Exception
      Starts this command line utility.
      Parameters:
      args - the command line arguments
      Throws:
      Exception - if an error occurred