Class SubstrateDispatcher


  • public class SubstrateDispatcher
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void executeCompileStep​(SubstrateDispatcher dispatcher)  
      static void main​(java.lang.String[] args)  
      boolean nativeCompile()
      This method will start native compilation for the specified configuration.
      boolean nativeInstall()
      This method installs the generated package that was created after nativePackage() was called and ended successfully.
      boolean nativeLink()
      This method will start native linking for the specified configuration, after nativeCompile() was called and ended successfully.
      boolean nativePackage()
      This method creates a package of the native image application, that was created after nativeLink() was called and ended successfully.
      void nativeRun()
      This method runs the native image application, that was created after nativeLink() was called and ended successfully.
      boolean nativeSharedLibrary()
      This method builds a native image that can be used as shared library by third party projects, considering it contains one or more entry points.
      boolean nativeStaticLibrary()
      This method builds a static library that can be used by third party projects, considering it contains one or more entry points.
      java.lang.String retrieveSubstrateMessage​(java.lang.String task)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SubstrateDispatcher

        public SubstrateDispatcher​(java.nio.file.Path buildRoot,
                                   ProjectConfiguration config)
                            throws java.io.IOException
        Dispatches calls to different process steps. Uses shared build root path and project configuration
        Parameters:
        buildRoot - the root, relative to which the compilation step can create object files and temporary files
        config - the ProjectConfiguration, including the target triplet
        Throws:
        java.io.IOException
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • executeCompileStep

        public static void executeCompileStep​(SubstrateDispatcher dispatcher)
      • retrieveSubstrateMessage

        public java.lang.String retrieveSubstrateMessage​(java.lang.String task)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • nativeCompile

        public boolean nativeCompile()
                              throws java.lang.Exception
        This method will start native compilation for the specified configuration. The result of compilation is a at least one native file (2 files in case LLVM backend is used). This method returns true on successful compilation and false when compilations fails.
        Returns:
        true if compilation succeeded, false if it fails
        Throws:
        java.lang.Exception
        java.lang.IllegalArgumentException - when the supplied configuration contains illegal combinations
      • nativeLink

        public boolean nativeLink()
                           throws java.io.IOException,
                                  java.lang.InterruptedException
        This method will start native linking for the specified configuration, after nativeCompile() was called and ended successfully. The result of linking is a at least an native image application file. This method returns true on successful linking and false when linking fails.
        Returns:
        true if linking succeeded, false if it fails
        Throws:
        java.lang.Exception
        java.lang.IllegalArgumentException - when the supplied configuration contains illegal combinations
        java.io.IOException
        java.lang.InterruptedException
      • nativePackage

        public boolean nativePackage()
                              throws java.io.IOException,
                                     java.lang.InterruptedException
        This method creates a package of the native image application, that was created after nativeLink() was called and ended successfully. This method returns true on successful packaging and false when packaging fails.
        Returns:
        true if packaging succeeded, false if it fails
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • nativeInstall

        public boolean nativeInstall()
                              throws java.io.IOException,
                                     java.lang.InterruptedException
        This method installs the generated package that was created after nativePackage() was called and ended successfully. This method returns true on successful installation and false when installation fails.
        Returns:
        true if installing succeeded, false if it fails
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • nativeRun

        public void nativeRun()
                       throws java.io.IOException,
                              java.lang.InterruptedException
        This method runs the native image application, that was created after nativeLink() was called and ended successfully.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException - when the supplied configuration contains illegal combinations
        java.lang.InterruptedException
      • nativeSharedLibrary

        public boolean nativeSharedLibrary()
                                    throws java.lang.Exception
        This method builds a native image that can be used as shared library by third party projects, considering it contains one or more entry points. Static entry points, callable from C, can be created with the @CEntryPoint annotation.
        Throws:
        java.lang.Exception
      • nativeStaticLibrary

        public boolean nativeStaticLibrary()
                                    throws java.lang.Exception
        This method builds a static library that can be used by third party projects, considering it contains one or more entry points. Static entry points, callable from C, can be created with the @CEntryPoint annotation.
        Throws:
        java.lang.Exception