- java.lang.Object
-
- com.gluonhq.substrate.SubstrateDispatcher
-
public class SubstrateDispatcher extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SubstrateDispatcher(java.nio.file.Path buildRoot, ProjectConfiguration config)Dispatches calls to different process steps.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidexecuteCompileStep(SubstrateDispatcher dispatcher)static voidmain(java.lang.String[] args)booleannativeCompile()This method will start native compilation for the specified configuration.booleannativeInstall()This method installs the generated package that was created afternativePackage()was called and ended successfully.booleannativeLink()This method will start native linking for the specified configuration, afternativeCompile()was called and ended successfully.booleannativePackage()This method creates a package of the native image application, that was created afternativeLink()was called and ended successfully.voidnativeRun()This method runs the native image application, that was created afternativeLink()was called and ended successfully.booleannativeSharedLibrary()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.booleannativeStaticLibrary()This method builds a static library that can be used by third party projects, considering it contains one or more entry points.java.lang.StringretrieveSubstrateMessage(java.lang.String task)
-
-
-
Constructor Detail
-
SubstrateDispatcher
public SubstrateDispatcher(java.nio.file.Path buildRoot, ProjectConfiguration config) throws java.io.IOExceptionDispatches 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 filesconfig- 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.ExceptionThis 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 returnstrueon successful compilation andfalsewhen compilations fails.- Returns:
- true if compilation succeeded, false if it fails
- Throws:
java.lang.Exceptionjava.lang.IllegalArgumentException- when the supplied configuration contains illegal combinations
-
nativeLink
public boolean nativeLink() throws java.io.IOException, java.lang.InterruptedExceptionThis method will start native linking for the specified configuration, afternativeCompile()was called and ended successfully. The result of linking is a at least an native image application file. This method returnstrueon successful linking andfalsewhen linking fails.- Returns:
- true if linking succeeded, false if it fails
- Throws:
java.lang.Exceptionjava.lang.IllegalArgumentException- when the supplied configuration contains illegal combinationsjava.io.IOExceptionjava.lang.InterruptedException
-
nativePackage
public boolean nativePackage() throws java.io.IOException, java.lang.InterruptedExceptionThis method creates a package of the native image application, that was created afternativeLink()was called and ended successfully. This method returnstrueon successful packaging andfalsewhen packaging fails.- Returns:
- true if packaging succeeded, false if it fails
- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
nativeInstall
public boolean nativeInstall() throws java.io.IOException, java.lang.InterruptedExceptionThis method installs the generated package that was created afternativePackage()was called and ended successfully. This method returnstrueon successful installation andfalsewhen installation fails.- Returns:
- true if installing succeeded, false if it fails
- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
nativeRun
public void nativeRun() throws java.io.IOException, java.lang.InterruptedExceptionThis method runs the native image application, that was created afternativeLink()was called and ended successfully.- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException- when the supplied configuration contains illegal combinationsjava.lang.InterruptedException
-
nativeSharedLibrary
public boolean nativeSharedLibrary() throws java.lang.ExceptionThis 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@CEntryPointannotation.- Throws:
java.lang.Exception
-
nativeStaticLibrary
public boolean nativeStaticLibrary() throws java.lang.ExceptionThis 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@CEntryPointannotation.- Throws:
java.lang.Exception
-
-