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
public class J2ObjCCompiler extends AbstractCompiler
A plexus compiler which use J2ObjC . It is derived from the CSharpCompiler to compile with J2ObjC.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
BATCH_SIZE
--batch-translate-max=The maximum number of source files that are translated. private static java.lang.String
J_FLAG
-JPass Java , such as -Xmx1G, to the system runtime. private static 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.private static 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.private static java.lang.String
X_BOOTCLASSPATH
-
Fields inherited from class org.codehaus.plexus.compiler.AbstractCompiler
EOL, PS
-
-
Constructor Summary
Constructors Constructor Description J2ObjCCompiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String[]
buildCompilerArguments(CompilerConfiguration config, java.lang.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 java.util.List<CompilerMessage>
compileOutOfProcess(java.io.File workingDirectory, java.io.File target, java.lang.String executable, java.lang.String[] args)
java.lang.String[]
createCommandLine(CompilerConfiguration config)
Create the command line that would be executed using this configuration.private java.lang.String
findExecutable(CompilerConfiguration config)
Find the executable given in the configuration or use j2objc from the PATH.static java.util.List<CompilerMessage>
parseCompilerOutput(java.io.BufferedReader bufferedReader)
CompilerResult
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
-
-
-
-
Field Detail
-
X_BOOTCLASSPATH
private static final java.lang.String X_BOOTCLASSPATH
- See Also:
- Constant Field Values
-
J_FLAG
private static final java.lang.String J_FLAG
-JPass 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.
-
-
Method Detail
-
canUpdateTarget
public boolean canUpdateTarget(CompilerConfiguration configuration) throws CompilerException
- Specified by:
canUpdateTarget
in interfaceCompiler
- Overrides:
canUpdateTarget
in classAbstractCompiler
- Throws:
CompilerException
-
performCompile
public CompilerResult performCompile(CompilerConfiguration config) throws CompilerException
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
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
-
compileOutOfProcess
private java.util.List<CompilerMessage> compileOutOfProcess(java.io.File workingDirectory, java.io.File target, java.lang.String executable, java.lang.String[] args) throws CompilerException
- Throws:
CompilerException
-
parseCompilerOutput
public static java.util.List<CompilerMessage> parseCompilerOutput(java.io.BufferedReader bufferedReader) throws java.io.IOException
- Throws:
java.io.IOException
-
-