Package gw.lang.gosuc.simple
Class GosuCompiler
- java.lang.Object
-
- gw.lang.gosuc.simple.GosuCompiler
-
- All Implemented Interfaces:
IGosuCompiler
public class GosuCompiler extends java.lang.Object implements IGosuCompiler
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.File_compilingSourceFileprotected GosuInitialization_gosuInitializationprivate static java.lang.String[]SOURCE_EXTS
-
Constructor Summary
Constructors Constructor Description GosuCompiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddToSources(java.nio.file.Path sourcePath, java.util.List<java.lang.String> sourceFiles)private java.lang.Stringcombine(java.lang.String message1, java.lang.String message2)booleancompile(CommandLineOptions options, ICompilerDriver driver)booleancompile(java.io.File sourceFile, ICompilerDriver driver)private booleancompileGosuSources(CommandLineOptions options, ICompilerDriver driver, java.util.List<java.lang.String> gosuFiles)private booleancompileJavaSources(CommandLineOptions options, ICompilerDriver driver, java.util.List<java.lang.String> javaFiles)voidcopyFile(java.io.File sourceFile, java.io.File destFile)private static IFileSystemcreateFileSystemInstance()private voidcreateGosuOutputFiles(IGosuClass gsClass, ICompilerDriver driver)private voidcreateJavaOutputFiles(java.util.Collection<manifold.internal.javac.InMemoryClassJavaFileObject> compiledJavaFiles, ICompilerDriver driver)private booleancreateNewFile(java.io.File file)private java.util.List<java.lang.String>getSourceFiles(CommandLineOptions options)static java.lang.StringgetStackTrace(java.lang.Throwable e)private ITypegetType(java.io.File file)longinitializeGosu(java.util.List<java.lang.String> sourceFolders, java.util.List<java.lang.String> classpath, java.util.List<java.lang.String> backingSourcePath, java.lang.String outputPath)private booleanisCompilable(IType type)booleanisPathIgnored(java.lang.String sourceFile)private booleanisSourceFile(java.lang.String absolutePathName)private java.util.List<java.lang.String>makeJavacOptions(CommandLineOptions options)private voidmaybeCopySourceFile(java.io.File parent, IGosuClass gsClass, java.io.File sourceFile, ICompilerDriver driver)private booleanmkDir(java.io.File file)private booleanmkdirs(java.io.File file)private voidpopulateGosuClassFile(java.io.File outputFile, IGosuClass gosuClass, ICompilerDriver driver)private voidpopulateJavaClassFile(java.io.File outputFile, byte[] bytes, ICompilerDriver driver)voiduninitializeGosu()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gw.lang.gosuc.simple.IGosuCompiler
initializeGosu, unitializeGosu
-
-
-
-
Field Detail
-
SOURCE_EXTS
private static final java.lang.String[] SOURCE_EXTS
-
_gosuInitialization
protected GosuInitialization _gosuInitialization
-
_compilingSourceFile
protected java.io.File _compilingSourceFile
-
-
Method Detail
-
compile
public boolean compile(CommandLineOptions options, ICompilerDriver driver)
- Specified by:
compilein interfaceIGosuCompiler
-
getSourceFiles
private java.util.List<java.lang.String> getSourceFiles(CommandLineOptions options)
-
addToSources
private void addToSources(java.nio.file.Path sourcePath, java.util.List<java.lang.String> sourceFiles)
-
isSourceFile
private boolean isSourceFile(java.lang.String absolutePathName)
-
compileGosuSources
private boolean compileGosuSources(CommandLineOptions options, ICompilerDriver driver, java.util.List<java.lang.String> gosuFiles)
-
compileJavaSources
private boolean compileJavaSources(CommandLineOptions options, ICompilerDriver driver, java.util.List<java.lang.String> javaFiles)
-
makeJavacOptions
private java.util.List<java.lang.String> makeJavacOptions(CommandLineOptions options)
-
compile
public boolean compile(java.io.File sourceFile, ICompilerDriver driver)- Specified by:
compilein interfaceIGosuCompiler
-
getType
private IType getType(java.io.File file)
-
isCompilable
private boolean isCompilable(IType type)
-
createGosuOutputFiles
private void createGosuOutputFiles(IGosuClass gsClass, ICompilerDriver driver)
-
createJavaOutputFiles
private void createJavaOutputFiles(java.util.Collection<manifold.internal.javac.InMemoryClassJavaFileObject> compiledJavaFiles, ICompilerDriver driver)
-
getStackTrace
public static java.lang.String getStackTrace(java.lang.Throwable e)
-
combine
private java.lang.String combine(java.lang.String message1, java.lang.String message2)
-
mkDir
private boolean mkDir(java.io.File file)
-
mkdirs
private boolean mkdirs(java.io.File file)
-
createNewFile
private boolean createNewFile(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
maybeCopySourceFile
private void maybeCopySourceFile(java.io.File parent, IGosuClass gsClass, java.io.File sourceFile, ICompilerDriver driver)
-
copyFile
public void copyFile(java.io.File sourceFile, java.io.File destFile) throws java.io.IOException- Throws:
java.io.IOException
-
populateGosuClassFile
private void populateGosuClassFile(java.io.File outputFile, IGosuClass gosuClass, ICompilerDriver driver) throws java.io.IOException- Throws:
java.io.IOException
-
populateJavaClassFile
private void populateJavaClassFile(java.io.File outputFile, byte[] bytes, ICompilerDriver driver) throws java.io.IOException- Throws:
java.io.IOException
-
initializeGosu
public long initializeGosu(java.util.List<java.lang.String> sourceFolders, java.util.List<java.lang.String> classpath, java.util.List<java.lang.String> backingSourcePath, java.lang.String outputPath)- Specified by:
initializeGosuin interfaceIGosuCompiler
-
createFileSystemInstance
private static IFileSystem createFileSystemInstance()
-
uninitializeGosu
public void uninitializeGosu()
- Specified by:
uninitializeGosuin interfaceIGosuCompiler
-
isPathIgnored
public boolean isPathIgnored(java.lang.String sourceFile)
- Specified by:
isPathIgnoredin interfaceIGosuCompiler
-
-