Class XtendBatchCompiler
- java.lang.Object
-
- org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler
-
public class XtendBatchCompiler extends java.lang.Object
- Since:
- 2.8
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.io.FileFilter
ACCEPT_ALL_FILTER
protected java.lang.String
additionalPreCompileArgs
Additional arguments to the Eclipse batch compiler for the precompile step.protected java.lang.String
bootClassPath
protected java.lang.String
classPath
protected java.lang.ClassLoader
currentClassLoader
protected boolean
deleteTempDirectory
protected java.io.Writer
errorWriter
Deprecated.protected java.lang.String
fileEncoding
protected org.eclipse.xtext.resource.FileExtensionProvider
fileExtensionProvider
protected com.google.inject.Provider<org.eclipse.xtext.generator.JavaIoFileSystemAccess>
javaIoFileSystemAccessProvider
protected java.lang.String
outputPath
protected java.io.Writer
outputWriter
Deprecated.protected com.google.inject.Provider<org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions>
resourceSetDescriptionsProvider
protected com.google.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet>
resourceSetProvider
protected java.lang.String
sourcePath
protected java.lang.String
tempDirectory
protected java.util.List<java.io.File>
tempFolders
protected boolean
useCurrentClassLoaderAsParent
protected boolean
verbose
protected boolean
writeStorageFiles
protected boolean
writeTraceFiles
-
Constructor Summary
Constructors Constructor Description XtendBatchCompiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
checkConfiguration()
protected static boolean
cleanFolder(java.io.File parentFolder, java.io.FileFilter filter, boolean continueOnError, boolean deleteParentFolder)
boolean
compile()
protected java.lang.ClassLoader
createClassLoader(java.lang.Iterable<java.io.File> jarsAndFolders, java.lang.ClassLoader parentClassLoader)
protected java.io.File
createStubs(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
protected java.io.File
createTempDir(java.lang.String prefix)
protected void
deleteTmpFolders()
protected void
destroyClassLoader(java.lang.ClassLoader classLoader)
protected void
generateJavaFiles(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
java.lang.String
getAdditionalPreCompileArgs()
protected java.util.List<java.lang.String>
getBootClassPathEntries()
protected java.util.List<java.lang.String>
getClassPathEntries()
protected java.lang.String
getComplianceLevel()
Deprecated.protected java.util.List<java.lang.String>
getDirectories(java.lang.String path)
java.io.Writer
getErrorWriter()
Deprecated.java.lang.String
getFileEncoding()
java.lang.String
getGeneratedAnnotationComment()
java.lang.String
getJavaSourceVersion()
org.eclipse.xtext.generator.OutputConfiguration
getOutputConfiguration()
java.io.Writer
getOutputWriter()
Deprecated.org.eclipse.xtext.workspace.FileProjectConfig
getProjectConfig()
protected org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions
getResourceDescriptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
protected java.util.List<java.lang.String>
getSourcePathDirectories()
java.lang.String
getTempDirectory()
protected XtendFile
getXtendFile(org.eclipse.emf.ecore.resource.Resource resource)
protected void
installJvmTypeProvider(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.io.File tmpClassDirectory)
Deprecated.use the explicit variantinstallJvmTypeProvider(ResourceSet, File, boolean)
instead.protected void
installJvmTypeProvider(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.io.File tmpClassDirectory, boolean skipIndexLookup)
Installs the JvmTypeProvider optionally including index access into theResourceSet
.boolean
isDeleteTempDirectory()
boolean
isGenerateGeneratedAnnotation()
boolean
isGenerateSyntheticSuppressWarnings()
boolean
isIncludeDateInGeneratedAnnotation()
protected boolean
isSourceFile(org.eclipse.emf.ecore.resource.Resource resource)
protected boolean
isVerbose()
boolean
isWriteStorageFiles()
boolean
isWriteTraceFiles()
protected org.eclipse.emf.ecore.resource.ResourceSet
loadXtendFiles()
Deprecated.protected org.eclipse.emf.ecore.resource.ResourceSet
loadXtendFiles(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
protected boolean
preCompile(java.io.File classDirectory, java.lang.Iterable<java.lang.String> sourcePathDirectories, java.lang.Iterable<java.lang.String> classPathEntries)
protected boolean
preCompileJava(java.io.File tmpSourceDirectory, java.io.File classDirectory)
protected boolean
preCompileStubs(java.io.File tmpSourceDirectory, java.io.File classDirectory)
protected void
reportIssues(java.lang.Iterable<org.eclipse.xtext.validation.Issue> issues)
void
setAdditionalPreCompileArgs(java.lang.String additionalPreCompileArgs)
void
setBasePath(java.lang.String basePath)
void
setBootClassPath(java.lang.String bootClassPath)
This option is only supported on JDK 8 and older and will be ignored when source level is 9 or newer.void
setClassPath(java.lang.String classPath)
void
setCurrentClassLoader(java.lang.ClassLoader currentClassLoader)
void
setDeleteTempDirectory(boolean deletetempDirectory)
void
setErrorWriter(java.io.Writer errorWriter)
Deprecated.void
setFileEncoding(java.lang.String encoding)
void
setGeneratedAnnotationComment(java.lang.String generatedAnnotationComment)
void
setGenerateGeneratedAnnotation(boolean generateGeneratedAnnotation)
void
setGenerateSyntheticSuppressWarnings(boolean generateSyntheticSuppressWarnings)
void
setIncludeDateInGeneratedAnnotation(boolean includeDateInGeneratedAnnotation)
void
setJavaSourceVersion(java.lang.String javaSourceVersion)
void
setOutputPath(java.lang.String outputPath)
void
setOutputWriter(java.io.Writer ouputWriter)
Deprecated.void
setResourceSetProvider(com.google.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet> resourceSetProvider)
void
setSourcePath(java.lang.String sourcePath)
void
setTempDirectory(java.lang.String tempDirectory)
void
setUseCurrentClassLoaderAsParent(boolean useCurrentClassLoaderAsParent)
void
setVerbose(boolean verbose)
void
setWriteStorageFiles(boolean writeStorageFiles)
void
setWriteTraceFiles(boolean writeTraceFiles)
protected java.util.List<org.eclipse.xtext.validation.Issue>
validate(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
-
-
Field Detail
-
ACCEPT_ALL_FILTER
protected static final java.io.FileFilter ACCEPT_ALL_FILTER
-
resourceSetProvider
protected com.google.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet> resourceSetProvider
-
javaIoFileSystemAccessProvider
@Inject protected com.google.inject.Provider<org.eclipse.xtext.generator.JavaIoFileSystemAccess> javaIoFileSystemAccessProvider
-
fileExtensionProvider
@Inject protected org.eclipse.xtext.resource.FileExtensionProvider fileExtensionProvider
-
resourceSetDescriptionsProvider
@Inject protected com.google.inject.Provider<org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions> resourceSetDescriptionsProvider
-
sourcePath
protected java.lang.String sourcePath
-
classPath
protected java.lang.String classPath
-
bootClassPath
protected java.lang.String bootClassPath
- Since:
- 2.7
-
useCurrentClassLoaderAsParent
protected boolean useCurrentClassLoaderAsParent
-
outputPath
protected java.lang.String outputPath
-
fileEncoding
protected java.lang.String fileEncoding
-
verbose
protected boolean verbose
-
tempDirectory
protected java.lang.String tempDirectory
-
deleteTempDirectory
protected boolean deleteTempDirectory
-
tempFolders
protected java.util.List<java.io.File> tempFolders
-
writeTraceFiles
protected boolean writeTraceFiles
-
writeStorageFiles
protected boolean writeStorageFiles
- Since:
- 2.8
-
currentClassLoader
protected java.lang.ClassLoader currentClassLoader
-
additionalPreCompileArgs
protected java.lang.String additionalPreCompileArgs
Additional arguments to the Eclipse batch compiler for the precompile step. Defaults to '-proc:none' to disable annotation processing. Clients may override.- Since:
- 2.22
-
outputWriter
@Deprecated protected java.io.Writer outputWriter
Deprecated.
-
errorWriter
@Deprecated protected java.io.Writer errorWriter
Deprecated.
-
-
Method Detail
-
setCurrentClassLoader
public void setCurrentClassLoader(java.lang.ClassLoader currentClassLoader)
-
setUseCurrentClassLoaderAsParent
public void setUseCurrentClassLoaderAsParent(boolean useCurrentClassLoaderAsParent)
-
getTempDirectory
public java.lang.String getTempDirectory()
-
setTempDirectory
public void setTempDirectory(java.lang.String tempDirectory)
-
isWriteTraceFiles
public boolean isWriteTraceFiles()
-
setWriteTraceFiles
public void setWriteTraceFiles(boolean writeTraceFiles)
-
isWriteStorageFiles
public boolean isWriteStorageFiles()
- Since:
- 2.8
-
setWriteStorageFiles
public void setWriteStorageFiles(boolean writeStorageFiles)
- Since:
- 2.8
-
setAdditionalPreCompileArgs
public void setAdditionalPreCompileArgs(java.lang.String additionalPreCompileArgs)
- Since:
- 2.22
-
getAdditionalPreCompileArgs
public java.lang.String getAdditionalPreCompileArgs()
- Since:
- 2.22
-
setResourceSetProvider
@Inject public void setResourceSetProvider(com.google.inject.Provider<org.eclipse.emf.ecore.resource.ResourceSet> resourceSetProvider)
-
isDeleteTempDirectory
public boolean isDeleteTempDirectory()
-
setDeleteTempDirectory
public void setDeleteTempDirectory(boolean deletetempDirectory)
-
setClassPath
public void setClassPath(java.lang.String classPath)
-
setBootClassPath
public void setBootClassPath(java.lang.String bootClassPath)
This option is only supported on JDK 8 and older and will be ignored when source level is 9 or newer.- Since:
- 2.7
- See Also:
- Java 9 Release Notes
-
setBasePath
public void setBasePath(java.lang.String basePath)
- Since:
- 2.8
-
setOutputPath
public void setOutputPath(java.lang.String outputPath)
-
setSourcePath
public void setSourcePath(java.lang.String sourcePath)
-
getComplianceLevel
@Deprecated protected java.lang.String getComplianceLevel()
Deprecated.
-
isGenerateSyntheticSuppressWarnings
public boolean isGenerateSyntheticSuppressWarnings()
- Since:
- 2.8
-
setGenerateSyntheticSuppressWarnings
public void setGenerateSyntheticSuppressWarnings(boolean generateSyntheticSuppressWarnings)
- Since:
- 2.8
-
isGenerateGeneratedAnnotation
public boolean isGenerateGeneratedAnnotation()
- Since:
- 2.8
-
setGenerateGeneratedAnnotation
public void setGenerateGeneratedAnnotation(boolean generateGeneratedAnnotation)
- Since:
- 2.8
-
isIncludeDateInGeneratedAnnotation
public boolean isIncludeDateInGeneratedAnnotation()
- Since:
- 2.8
-
setIncludeDateInGeneratedAnnotation
public void setIncludeDateInGeneratedAnnotation(boolean includeDateInGeneratedAnnotation)
- Since:
- 2.8
-
getGeneratedAnnotationComment
public java.lang.String getGeneratedAnnotationComment()
- Since:
- 2.8
-
setGeneratedAnnotationComment
public void setGeneratedAnnotationComment(java.lang.String generatedAnnotationComment)
- Since:
- 2.8
-
getJavaSourceVersion
public java.lang.String getJavaSourceVersion()
- Since:
- 2.8
-
setJavaSourceVersion
public void setJavaSourceVersion(java.lang.String javaSourceVersion)
- Since:
- 2.8
-
setVerbose
public void setVerbose(boolean verbose)
-
isVerbose
protected boolean isVerbose()
-
getFileEncoding
public java.lang.String getFileEncoding()
-
setFileEncoding
public void setFileEncoding(java.lang.String encoding)
-
getOutputConfiguration
public org.eclipse.xtext.generator.OutputConfiguration getOutputConfiguration()
- Noreference:
- Only for testing
-
getProjectConfig
public org.eclipse.xtext.workspace.FileProjectConfig getProjectConfig()
- Noreference:
- Only for testing
-
compile
public boolean compile()
-
destroyClassLoader
protected void destroyClassLoader(java.lang.ClassLoader classLoader)
- Since:
- 2.8
-
checkConfiguration
protected boolean checkConfiguration()
- Since:
- 2.8
-
loadXtendFiles
protected org.eclipse.emf.ecore.resource.ResourceSet loadXtendFiles(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
loadXtendFiles
@Deprecated protected org.eclipse.emf.ecore.resource.ResourceSet loadXtendFiles()
Deprecated.
-
createStubs
protected java.io.File createStubs(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
preCompileStubs
protected boolean preCompileStubs(java.io.File tmpSourceDirectory, java.io.File classDirectory)
-
preCompileJava
protected boolean preCompileJava(java.io.File tmpSourceDirectory, java.io.File classDirectory)
- Since:
- 2.8
-
preCompile
protected boolean preCompile(java.io.File classDirectory, java.lang.Iterable<java.lang.String> sourcePathDirectories, java.lang.Iterable<java.lang.String> classPathEntries)
- Since:
- 2.8
-
validate
protected java.util.List<org.eclipse.xtext.validation.Issue> validate(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
isSourceFile
protected boolean isSourceFile(org.eclipse.emf.ecore.resource.Resource resource)
- Since:
- 2.8
-
installJvmTypeProvider
@Deprecated protected void installJvmTypeProvider(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.io.File tmpClassDirectory)
Deprecated.use the explicit variantinstallJvmTypeProvider(ResourceSet, File, boolean)
instead.Installs the complete JvmTypeProvider including index access into theResourceSet
. The lookup classpath is enhanced with the given tmp directory.
-
installJvmTypeProvider
protected void installJvmTypeProvider(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.io.File tmpClassDirectory, boolean skipIndexLookup)
Installs the JvmTypeProvider optionally including index access into theResourceSet
. The lookup classpath is enhanced with the given tmp directory.
-
createClassLoader
protected java.lang.ClassLoader createClassLoader(java.lang.Iterable<java.io.File> jarsAndFolders, java.lang.ClassLoader parentClassLoader)
- Since:
- 2.8
-
reportIssues
protected void reportIssues(java.lang.Iterable<org.eclipse.xtext.validation.Issue> issues)
-
generateJavaFiles
protected void generateJavaFiles(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
getResourceDescriptions
protected org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions getResourceDescriptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
getXtendFile
protected XtendFile getXtendFile(org.eclipse.emf.ecore.resource.Resource resource)
-
getClassPathEntries
protected java.util.List<java.lang.String> getClassPathEntries()
-
getBootClassPathEntries
protected java.util.List<java.lang.String> getBootClassPathEntries()
- Since:
- 2.7
-
getSourcePathDirectories
protected java.util.List<java.lang.String> getSourcePathDirectories()
-
getDirectories
protected java.util.List<java.lang.String> getDirectories(java.lang.String path)
-
createTempDir
protected java.io.File createTempDir(java.lang.String prefix)
-
deleteTmpFolders
protected void deleteTmpFolders()
-
cleanFolder
protected static boolean cleanFolder(java.io.File parentFolder, java.io.FileFilter filter, boolean continueOnError, boolean deleteParentFolder)
-
getOutputWriter
@Deprecated public java.io.Writer getOutputWriter()
Deprecated.
-
setOutputWriter
@Deprecated public void setOutputWriter(java.io.Writer ouputWriter)
Deprecated.
-
getErrorWriter
@Deprecated public java.io.Writer getErrorWriter()
Deprecated.
-
setErrorWriter
@Deprecated public void setErrorWriter(java.io.Writer errorWriter)
Deprecated.
-
-