Class CmakeUtils
java.lang.Object
com.android.build.gradle.external.cmake.CmakeUtils
Cmake utility class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCExtensionSet(CodeModel codeModel) Returns the C file extensions for the given code model.getCppExtensionSet(CodeModel codeModel) Returns the C++ file extensions for the given code model.static <ContentType>
StringgetObjectToString(ContentType content) Returns a JSON string representation of the given object.static intgetToolchainHash(com.android.build.gradle.internal.cxx.json.NativeToolchainValue toolchainValue) Returns the toolchain hash for the given toolchain.static com.android.repository.RevisiongetVersion(File cmakeInstallPath, Function<File, String> versionExecutor) Parses the Cmake (from the given install path) version string into a structure.static com.android.repository.RevisiongetVersion(String cmakeVersionString) static StringkeepWhileNumbersAndDots(String versionString)
-
Constructor Details
-
CmakeUtils
public CmakeUtils()
-
-
Method Details
-
getVersion
@NonNull public static com.android.repository.Revision getVersion(@NonNull File cmakeInstallPath, @NonNull Function<File, String> versionExecutor) throws IOExceptionParses the Cmake (from the given install path) version string into a structure.- Returns:
- Revision for the version string.
- Throws:
IOException- I/O failure
-
keepWhileNumbersAndDots
-
getVersion
@NonNull public static com.android.repository.Revision getVersion(@NonNull String cmakeVersionString) -
getCppExtensionSet
Returns the C++ file extensions for the given code model. -
getCExtensionSet
Returns the C file extensions for the given code model. -
getToolchainHash
public static int getToolchainHash(@NonNull com.android.build.gradle.internal.cxx.json.NativeToolchainValue toolchainValue) Returns the toolchain hash for the given toolchain. If the contents of the toolchain are null, the functions returns 0. -
getObjectToString
Returns a JSON string representation of the given object. This is used instead of 'toString' when printing an object's contents.
-