Class AbstractTargetConfiguration

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean crossCompile  
      protected static java.util.List<java.lang.String> ENABLED_FEATURES  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean compile()
      Compile sets the required command line arguments and runs native-image
      protected boolean compileAdditionalSources()  
      boolean createSharedLib()
      Creates a native image that can be used as shared library
      boolean createStaticLib()
      Creates a static library
      protected java.nio.file.Path getCLibPath()  
      protected java.util.List<java.nio.file.Path> getLinkerLibraryPaths()
      Creates a list of Paths that will be added to the library search path for the linker.
      protected java.util.List<java.lang.String> getNativeCodeList()  
      protected java.util.List<java.nio.file.Path> getStaticJDKLibPaths()  
      protected java.util.List<java.lang.String> getTargetNativeCodeExtensions()  
      boolean install()
      Installs the packaged application on the local system or on a device that is attached to the local system.
      boolean link()
      Links a previously created objectfile with the required dependencies into a native executable or library
      boolean packageApp()
      Creates a package of the application (including at least executable and other possible files) in a given format.
      java.lang.String run()
      Runs the generated native image
      boolean runUntilEnd()
      Run the generated native image and returns true if the process ended successfully
      • Methods inherited from class java.lang.Object

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

      • ENABLED_FEATURES

        protected static final java.util.List<java.lang.String> ENABLED_FEATURES
      • crossCompile

        protected final boolean crossCompile
    • Method Detail

      • compile

        public boolean compile()
                        throws java.io.IOException,
                               java.lang.InterruptedException
        Compile sets the required command line arguments and runs native-image
        Specified by:
        compile in interface TargetConfiguration
        Returns:
        true if the process ends successfully, false otherwise
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • link

        public boolean link()
                     throws java.io.IOException,
                            java.lang.InterruptedException
        Description copied from interface: TargetConfiguration
        Links a previously created objectfile with the required dependencies into a native executable or library
        Specified by:
        link in interface TargetConfiguration
        Returns:
        true if linking succeeded, false otherwise
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • packageApp

        public boolean packageApp()
                           throws java.io.IOException,
                                  java.lang.InterruptedException
        Creates a package of the application (including at least executable and other possible files) in a given format. By default, this method is no-op returning true.
        Specified by:
        packageApp in interface TargetConfiguration
        Returns:
        true if packaging succeeded or is a no-op, false if it failed.
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • install

        public boolean install()
                        throws java.io.IOException,
                               java.lang.InterruptedException
        Installs the packaged application on the local system or on a device that is attached to the local system. By default, this method is no-op returning true.
        Specified by:
        install in interface TargetConfiguration
        Returns:
        true if installing succeeded or is a no-op, false if it failed.
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • run

        public java.lang.String run()
                             throws java.io.IOException,
                                    java.lang.InterruptedException
        Runs the generated native image
        Specified by:
        run in interface TargetConfiguration
        Returns:
        a string with the last logged output of the process
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • runUntilEnd

        public boolean runUntilEnd()
                            throws java.io.IOException,
                                   java.lang.InterruptedException
        Run the generated native image and returns true if the process ended successfully
        Specified by:
        runUntilEnd in interface TargetConfiguration
        Returns:
        true if the process ended successfully, false otherwise
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • createSharedLib

        public boolean createSharedLib()
                                throws java.io.IOException,
                                       java.lang.InterruptedException
        Creates a native image that can be used as shared library
        Specified by:
        createSharedLib in interface TargetConfiguration
        Returns:
        true if the process succeeded or false if the process failed
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • createStaticLib

        public boolean createStaticLib()
                                throws java.io.IOException,
                                       java.lang.InterruptedException
        Creates a static library
        Specified by:
        createStaticLib in interface TargetConfiguration
        Returns:
        true if the process succeeded or false if the process failed
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • compileAdditionalSources

        protected boolean compileAdditionalSources()
                                            throws java.io.IOException,
                                                   java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • getLinkerLibraryPaths

        protected java.util.List<java.nio.file.Path> getLinkerLibraryPaths()
                                                                    throws java.io.IOException
        Creates a list of Paths that will be added to the library search path for the linker. Targets are allowed to override this, e.g. in case they don't want the static JDK directory on the library path (see https://github.com/gluonhq/substrate/issues/879) Note: we should probably invert this logic: the static library path should not be used as linkLibraryPath unless explicitly asked by the target.
        Returns:
        a list of Paths to add to the library search path
        Throws:
        java.io.IOException
      • getTargetNativeCodeExtensions

        protected java.util.List<java.lang.String> getTargetNativeCodeExtensions()
      • getNativeCodeList

        protected java.util.List<java.lang.String> getNativeCodeList()
                                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getCLibPath

        protected java.nio.file.Path getCLibPath()
      • getStaticJDKLibPaths

        protected java.util.List<java.nio.file.Path> getStaticJDKLibPaths()
                                                                   throws java.io.IOException
        Throws:
        java.io.IOException