- java.lang.Object
-
- com.gluonhq.substrate.model.InternalProjectConfiguration
-
public class InternalProjectConfiguration extends java.lang.ObjectThis 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. IfsetJavaStaticLibsis called, the libraries are expected to be found in the location provided by the location passed tosetJavaStaticLibsIf 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 Summary
Constructors Constructor Description InternalProjectConfiguration(ProjectConfiguration config)Private projects configuration, which includes everything, including public settings
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcanRunLLVM(Triplet triplet)Deprecated.voidcheckGraalVMJavaVersion()Check if the GraalVM's java provided by the configuration is supportedvoidcheckGraalVMVendor()Check if Gluon is the vendor of the GraalVM build, or else logs a message.voidcheckGraalVMVersion()Check if the GraalVM provided by the configuration is supportedjava.nio.file.PathgetAndroidNdkPath()Gets Android NDK pathjava.nio.file.PathgetAndroidSdkPath()Gets Android SDK pathjava.lang.StringgetAppId()Returns the appId fromProjectConfiguration.java.lang.StringgetAppName()java.lang.StringgetBackend()java.util.List<java.lang.String>getBundlesList()java.lang.StringgetClasspath()java.util.List<java.lang.String>getCompilerArgs()java.nio.file.PathgetDefaultJavafxStaticPath()java.nio.file.PathgetDefaultJavaStaticPath()Return the default path where the static JDK is installed for the os-arch combination of this configuration, and for the version injavaStaticSdkVersionjava.nio.file.PathgetGraalPath()VersiongetGraalVersion()VersiongetGraalVMJavaVersion()Gets the Java version that GraalVM bundlesTripletgetHostTriplet()Retrieve the host triplet for this configuration.java.util.List<java.lang.String>getInitBuildTimeList()java.nio.file.PathgetJavafxStaticLibsPath()java.nio.file.PathgetJavafxStaticPath()Return the path where the static JavaFX SDK is installed for the os-arch combination of this configuration, and for the version injavafxStaticSdkVersion.java.lang.StringgetJavafxStaticSdkVersion()java.nio.file.PathgetJavaStaticLibsPath()Returns the Path containing the location of the static libraries.java.lang.StringgetJavaStaticSdkVersion()Returns the version string for the static JDK libs.java.util.List<java.lang.String>getJniList()java.util.List<java.lang.String>getLinkerArgs()java.lang.StringgetMainClassName()java.util.List<java.lang.String>getReflectionList()ReleaseConfigurationgetReleaseConfiguration()java.util.List<java.lang.String>getReleaseSymbolsList()java.lang.StringgetRemoteDir()java.lang.StringgetRemoteHostName()java.util.List<java.lang.String>getResourcesList()java.util.List<java.lang.String>getRuntimeArgsList()java.nio.file.PathgetSysrootPath()Gets sysroot path for the current archTripletgetTargetTriplet()booleanhasWeb()booleanisEnableCheckHash()booleanisSharedLibrary()booleanisStaticLibrary()booleanisUseJavaFX()booleanisUseJNI()booleanisUseLLVM()Deprecated.booleanisUsePrecompiledCode()booleanisUsePrismSW()booleanisVerbose()voidsetBackend(java.lang.String backend)voidsetEnableCheckHash(boolean enableCheckHash)Enables hash checking to verify integrity of Graal and Java/JavaFX filesvoidsetInitBuildTimeList(java.util.List<java.lang.String> initBuildTimeList)Sets additional listsvoidsetJavaFXStaticSDK(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.voidsetJavaStaticLibs(java.lang.String location)Sets the location for the static JDK libs (e.g.voidsetReleaseSymbolsList(java.util.List<java.lang.String> releaseSymbolsList)Sets additional lists of release symbols, like _Java_com_gluonhq*voidsetSharedLibrary(boolean sharedLibrary)voidsetStaticLibrary(boolean staticLibrary)voidsetUseJavaFX(boolean useJavaFX)voidsetUseJNI(boolean useJNI)voidsetUsePrismSW(boolean usePrismSW)java.lang.StringtoString()booleanuseCustomJavafxStaticLibs()Check whether a custom path to static JavaFX libs is provided.booleanuseCustomJavaStaticLibs()Check whether a custom path to static Java libs is providedbooleanusesJDK11()
-
-
-
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 togetStaticLibsPathwill 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 thesetJavaStaticLibsmethod has been called before, the Path pointed to by the argument tosetJavaStaticLibswill 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 injavaStaticSdkVersion- 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 togetJavaFXStaticLibsPathandgetJavaFXStaticPathwill 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 injavafxStaticSdkVersion. If the location of the JavaFX SDK has previously been set usingsetJavaFXStaticSDK, 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 fromProjectConfiguration. 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()
-
getReleaseConfiguration
public ReleaseConfiguration getReleaseConfiguration()
-
usesJDK11
public boolean usesJDK11()
-
checkGraalVMVersion
public void checkGraalVMVersion() throws java.io.IOExceptionCheck 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.IOExceptionCheck 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.IOExceptionCheck 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.IOExceptionjava.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 nulljava.lang.IllegalArgumentException- when the configuration doesn't contain a property graalPathjava.io.IOException- if the Java version can't be found
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-