Class InternalProjectConfiguration


  • public class InternalProjectConfiguration
    extends java.lang.Object
    This class contains all configuration info about the current project (not about the current OS/Arch/vendor etc) This class allows to specify where the Java core libs are located. If setJavaStaticLibs is called, the libraries are expected to be found in the location provided by the location passed to setJavaStaticLibs If this method has not been called, getJavaStaticLibsPath() will return the default location, taking into account the value of javaStaticSdkVersion. If that value is not set, the default value is used.
    • Constructor Detail

      • InternalProjectConfiguration

        public InternalProjectConfiguration​(ProjectConfiguration config)
        Private projects configuration, which includes everything, including public settings
        Parameters:
        config - public project configuration
    • Method Detail

      • getGraalPath

        public java.nio.file.Path getGraalPath()
      • getGraalVersion

        public Version getGraalVersion()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getJavaStaticSdkVersion

        public java.lang.String getJavaStaticSdkVersion()
        Returns the version string for the static JDK libs. If this has not been specified before, the default will be returned.
        Returns:
        the specified JavaStaticSDK version, or the default
      • setJavaStaticLibs

        public void setJavaStaticLibs​(java.lang.String location)
        Sets the location for the static JDK libs (e.g. libjava.a) When this method is used, subsequent calls to getStaticLibsPath will override the default location
        Parameters:
        location - the location of the directory where the static libs are expected.
      • getJavaStaticLibsPath

        public java.nio.file.Path getJavaStaticLibsPath()
        Returns the Path containing the location of the static libraries. If the setJavaStaticLibs method has been called before, the Path pointed to by the argument to setJavaStaticLibs will be returned. Otherwise, the default location of the static libs will be returned. There is no guarantee that the libraries in the returned directory actually exist.
        Returns:
        the path to the location where the static JDK libraries are expected.
      • useCustomJavaStaticLibs

        public boolean useCustomJavaStaticLibs()
        Check whether a custom path to static Java libs is provided
        Returns:
        true if a custom path is provided, false otherwise.
      • getDefaultJavaStaticPath

        public java.nio.file.Path getDefaultJavaStaticPath()
        Return the default path where the static JDK is installed for the os-arch combination of this configuration, and for the version in javaStaticSdkVersion
        Returns:
        the path to the Java SDK (including at least the libs)
      • setJavaFXStaticSDK

        public void setJavaFXStaticSDK​(java.lang.String location)
        Sets the location for the JavaFX static SDK At this moment, the JavaFX static SDK contains platform-specific jars and platform-specific static native libraries. When this method is used, subsequent calls to getJavaFXStaticLibsPath and getJavaFXStaticPath will override the default location
        Parameters:
        location - the location of the directory where the JavaFX static SDK expected.
      • getJavafxStaticPath

        public java.nio.file.Path getJavafxStaticPath()
        Return the path where the static JavaFX SDK is installed for the os-arch combination of this configuration, and for the version in javafxStaticSdkVersion. If the location of the JavaFX SDK has previously been set using setJavaFXStaticSDK, that SDK will be used.
        Returns:
        the path to the JavaFX SDK
      • useCustomJavafxStaticLibs

        public boolean useCustomJavafxStaticLibs()
        Check whether a custom path to static JavaFX libs is provided.
        Returns:
        true if a custom path is provided, false otherwise.
      • getDefaultJavafxStaticPath

        public java.nio.file.Path getDefaultJavafxStaticPath()
      • getJavafxStaticLibsPath

        public java.nio.file.Path getJavafxStaticLibsPath()
      • getJavafxStaticSdkVersion

        public java.lang.String getJavafxStaticSdkVersion()
      • getAndroidSdkPath

        public java.nio.file.Path getAndroidSdkPath()
        Gets Android SDK path
      • getAndroidNdkPath

        public java.nio.file.Path getAndroidNdkPath()
        Gets Android NDK path
      • getSysrootPath

        public java.nio.file.Path getSysrootPath()
        Gets sysroot path for the current arch
      • isUseJNI

        public boolean isUseJNI()
      • setUseJNI

        public void setUseJNI​(boolean useJNI)
      • isUseJavaFX

        public boolean isUseJavaFX()
      • setUseJavaFX

        public void setUseJavaFX​(boolean useJavaFX)
      • isUsePrismSW

        public boolean isUsePrismSW()
      • setUsePrismSW

        public void setUsePrismSW​(boolean usePrismSW)
      • isEnableCheckHash

        public boolean isEnableCheckHash()
      • isVerbose

        public boolean isVerbose()
      • isUsePrecompiledCode

        public boolean isUsePrecompiledCode()
      • setEnableCheckHash

        public void setEnableCheckHash​(boolean enableCheckHash)
        Enables hash checking to verify integrity of Graal and Java/JavaFX files
        Parameters:
        enableCheckHash - boolean to enable hash checking
      • isSharedLibrary

        public boolean isSharedLibrary()
      • setSharedLibrary

        public void setSharedLibrary​(boolean sharedLibrary)
      • isStaticLibrary

        public boolean isStaticLibrary()
      • setStaticLibrary

        public void setStaticLibrary​(boolean staticLibrary)
      • getTargetTriplet

        public Triplet getTargetTriplet()
      • getHostTriplet

        public Triplet getHostTriplet()
                               throws java.lang.IllegalArgumentException
        Retrieve the host triplet for this configuration. The host triplet is always the triplet for the current runtime, e.g. it should not be set (apart for testing)
        Returns:
        the Triplet for the current executing host
        Throws:
        java.lang.IllegalArgumentException - in case the current operating system is not supported
      • getBackend

        public java.lang.String getBackend()
      • setBackend

        public void setBackend​(java.lang.String backend)
      • isUseLLVM

        @Deprecated
        public boolean isUseLLVM()
        Deprecated.
      • getBundlesList

        public java.util.List<java.lang.String> getBundlesList()
      • getResourcesList

        public java.util.List<java.lang.String> getResourcesList()
      • getReflectionList

        public java.util.List<java.lang.String> getReflectionList()
      • getJniList

        public java.util.List<java.lang.String> getJniList()
      • getCompilerArgs

        public java.util.List<java.lang.String> getCompilerArgs()
      • getLinkerArgs

        public java.util.List<java.lang.String> getLinkerArgs()
      • getInitBuildTimeList

        public java.util.List<java.lang.String> getInitBuildTimeList()
      • setInitBuildTimeList

        public void setInitBuildTimeList​(java.util.List<java.lang.String> initBuildTimeList)
        Sets additional lists
        Parameters:
        initBuildTimeList - a list of classes that will be added to the default initialize build time list
      • getRuntimeArgsList

        public java.util.List<java.lang.String> getRuntimeArgsList()
      • setReleaseSymbolsList

        public void setReleaseSymbolsList​(java.util.List<java.lang.String> releaseSymbolsList)
        Sets additional lists of release symbols, like _Java_com_gluonhq*
        Parameters:
        releaseSymbolsList - a list of classes that will be added to the default release symbols list
      • getReleaseSymbolsList

        public java.util.List<java.lang.String> getReleaseSymbolsList()
      • getAppId

        public java.lang.String getAppId()
        Returns the appId from ProjectConfiguration. If the appId is null, a concatenation of strings "com.gluonhq." and a random string with 6 alphabets, is returned.
        Returns:
        appId from ProjectConfiguration. If the appId is null, it will return a random string.
      • getAppName

        public java.lang.String getAppName()
      • getMainClassName

        public java.lang.String getMainClassName()
      • getClasspath

        public java.lang.String getClasspath()
      • hasWeb

        public boolean hasWeb()
      • getRemoteHostName

        public java.lang.String getRemoteHostName()
      • getRemoteDir

        public java.lang.String getRemoteDir()
      • usesJDK11

        public boolean usesJDK11()
      • checkGraalVMVersion

        public void checkGraalVMVersion()
                                 throws java.io.IOException
        Check if the GraalVM provided by the configuration is supported
        Throws:
        java.io.IOException - if the GraalVM version is older than the minimum supported version
      • checkGraalVMJavaVersion

        public void checkGraalVMJavaVersion()
                                     throws java.io.IOException
        Check if the GraalVM's java provided by the configuration is supported
        Throws:
        java.io.IOException - if the GraalVM's java version is older than the minimum supported version
      • checkGraalVMVendor

        public void checkGraalVMVendor()
                                throws java.io.IOException
        Check if Gluon is the vendor of the GraalVM build, or else logs a message.
        Throws:
        java.io.IOException - if the GraalVM path or the GraalVM/release file don't exist
      • canRunLLVM

        @Deprecated
        public void canRunLLVM​(Triplet triplet)
                        throws java.io.IOException,
                               java.lang.InterruptedException
        Deprecated.
        for Android and iOS profiles, verifies that the LLVM toolchain is installed, or installs it otherwise.
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • getGraalVMJavaVersion

        public Version getGraalVMJavaVersion()
                                      throws java.io.IOException
        Gets the Java version that GraalVM bundles
        Returns:
        the Java version of the GraalVM's build
        Throws:
        java.lang.NullPointerException - when the configuration is null
        java.lang.IllegalArgumentException - when the configuration doesn't contain a property graalPath
        java.io.IOException - if the Java version can't be found
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object