Class J2ObjCCompiler

  • All Implemented Interfaces:
    Compiler, org.codehaus.plexus.logging.LogEnabled

    public class J2ObjCCompiler
    extends AbstractCompiler
    A plexus compiler which use J2ObjC . It is derived from the CSharpCompiler to compile with J2ObjC.
    • Field Detail

      • J_FLAG

        private static final java.lang.String J_FLAG
        -J Pass Java , such as -Xmx1G, to the system runtime.
        See Also:
        Constant Field Values
      • BATCH_SIZE

        private static final java.lang.String BATCH_SIZE
        --batch-translate-max= The maximum number of source files that are translated. together. Batching speeds up translation, but requires more memory.
        See Also:
        Constant Field Values
      • ONE_DASH_ARGS

        private static final java.util.List<java.lang.String> ONE_DASH_ARGS
        Put the arguments of j2objc who takes one dash inside an array, in order the check the command line.
      • TWO_DASH_ARGS

        private static final java.util.List<java.lang.String> TWO_DASH_ARGS
        Put the command line arguments with 2 dashes inside an array, in order the check the command line and build it.
    • Constructor Detail

      • J2ObjCCompiler

        public J2ObjCCompiler()
    • Method Detail

      • createCommandLine

        public java.lang.String[] createCommandLine​(CompilerConfiguration config)
                                             throws CompilerException
        Description copied from interface: Compiler
        Create the command line that would be executed using this configuration. If this particular compiler has no concept of a command line then returns null.
        Parameters:
        config - the CompilerConfiguration describing the compilation
        Returns:
        an array of Strings that make up the command line, or null if this compiler has no concept of command line
        Throws:
        CompilerException - if there was an error generating the command line
      • findExecutable

        private java.lang.String findExecutable​(CompilerConfiguration config)
        Find the executable given in the configuration or use j2objc from the PATH.
        Parameters:
        config -
        Returns:
        the List of args
      • buildCompilerArguments

        private java.lang.String[] buildCompilerArguments​(CompilerConfiguration config,
                                                          java.lang.String[] sourceFiles)
                                                   throws CompilerException
        Build the compiler arguments :
      • the output location is used for -d of j2objc)
      • the classpath entries are added to -classpath
      • the sourcefiles are listed at the end of the command line
      • the configuration can contain any of the arguments
Parameters:
config -
sourceFiles -
Returns:
The List to give to the command line tool
Throws:
CompilerException