Class J2ObjCCompiler
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.compiler.AbstractCompiler
org.codehaus.plexus.compiler.j2objc.J2ObjCCompiler
- All Implemented Interfaces:
Compiler
,org.codehaus.plexus.logging.LogEnabled
@Component(role=Compiler.class,
hint="j2objc ")
public class J2ObjCCompiler
extends AbstractCompiler
A plexus compiler which use J2ObjC . It is derived from the CSharpCompiler to
compile with J2ObjC.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
--batch-translate-max=The maximum number of source files that are translated. private static final String
-JPass Java , such as -Xmx1G, to the system runtime. Put the arguments of j2objc who takes one dash inside an array, in order the check the command line.Put the command line arguments with 2 dashes inside an array, in order the check the command line and build it.private static final String
Fields inherited from class org.codehaus.plexus.compiler.AbstractCompiler
EOL, PS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String[]
buildCompilerArguments
(CompilerConfiguration config, String[] sourceFiles) 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 argumentsboolean
canUpdateTarget
(CompilerConfiguration configuration) private List<CompilerMessage>
compileOutOfProcess
(File workingDirectory, File target, String executable, String[] args) String[]
Create the command line that would be executed using this configuration.private String
findExecutable
(CompilerConfiguration config) Find the executable given in the configuration or use j2objc from the PATH.static List<CompilerMessage>
parseCompilerOutput
(BufferedReader bufferedReader) performCompile
(CompilerConfiguration config) Performs the compilation of the project.Methods inherited from class org.codehaus.plexus.compiler.AbstractCompiler
compile, getCompilerOutputStyle, getInputFileEnding, getOutputFile, getOutputFileEnding, getPathString, getSourceFiles, getSourceFilesForSourceRoot, makeClassName, toStringArray
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
X_BOOTCLASSPATH
- See Also:
-
J_FLAG
-JPass Java , such as -Xmx1G, to the system runtime. - See Also:
-
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:
-
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
Put the command line arguments with 2 dashes inside an array, in order the check the command line and build it.
-
-
Constructor Details
-
J2ObjCCompiler
public J2ObjCCompiler()
-
-
Method Details
-
canUpdateTarget
- Specified by:
canUpdateTarget
in interfaceCompiler
- Overrides:
canUpdateTarget
in classAbstractCompiler
- Throws:
CompilerException
-
performCompile
Description copied from interface:Compiler
Performs the compilation of the project. Clients must implement this method.- Specified by:
performCompile
in interfaceCompiler
- Overrides:
performCompile
in classAbstractCompiler
- Parameters:
config
- the configuration description of the compilation to perform- Returns:
- the result of the compilation returned by the language processor
- Throws:
CompilerException
-
createCommandLine
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
Find the executable given in the configuration or use j2objc from the PATH.- Parameters:
config
-- Returns:
- the List
of args
-
buildCompilerArguments
private String[] buildCompilerArguments(CompilerConfiguration config, 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
-
compileOutOfProcess
private List<CompilerMessage> compileOutOfProcess(File workingDirectory, File target, String executable, String[] args) throws CompilerException - Throws:
CompilerException
-
parseCompilerOutput
public static List<CompilerMessage> parseCompilerOutput(BufferedReader bufferedReader) throws IOException - Throws:
IOException
-