Class XtendBatchCompiler


  • public class XtendBatchCompiler
    extends java.lang.Object
    Since:
    2.8
    • 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.
    • Constructor Detail

      • XtendBatchCompiler

        public XtendBatchCompiler()
    • 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 variant installJvmTypeProvider(ResourceSet, File, boolean) instead.
        Installs the complete JvmTypeProvider including index access into the ResourceSet. 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 the ResourceSet. 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.