Class CmakeUtils
- java.lang.Object
-
- com.android.build.gradle.external.cmake.CmakeUtils
-
public class CmakeUtils extends java.lang.ObjectCmake utility class.
-
-
Constructor Summary
Constructors Constructor Description CmakeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>getBuildCommand(java.io.File cmakeExecutable, java.io.File outputFolder, java.lang.String targetName)Returns the build command for the given target (given the output folder and cmake executable).static java.util.List<java.lang.String>getBuildTargetsCommand(java.io.File cmakeExecutable, java.io.File outputFolder, java.util.List<java.lang.String> buildCommandArgs)Returns the command to build multiple targets.static java.util.Set<java.lang.String>getCExtensionSet(CodeModel codeModel)Returns the C file extensions for the given code model.static java.util.List<java.lang.String>getCleanCommand(java.io.File cmakeExecutable, java.io.File outputFolder)Returns the command to clean up for the given target (given the output folder and cmake executable).static java.util.Set<java.lang.String>getCppExtensionSet(CodeModel codeModel)Returns the C++ file extensions for the given code model.static <ContentType>
java.lang.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(java.io.File cmakeInstallPath)Parses the Cmake (from the given install path) version string into a structure.static com.android.repository.RevisiongetVersion(java.lang.String cmakeVersionString)static java.lang.StringkeepWhileNumbersAndDots(java.lang.String versionString)
-
-
-
Method Detail
-
getVersion
@NonNull public static com.android.repository.Revision getVersion(@NonNull java.io.File cmakeInstallPath) throws java.io.IOExceptionParses the Cmake (from the given install path) version string into a structure.- Returns:
- Revision for the version string.
- Throws:
java.io.IOException- I/O failure
-
keepWhileNumbersAndDots
@NonNull public static java.lang.String keepWhileNumbersAndDots(java.lang.String versionString)
-
getVersion
@NonNull public static com.android.repository.Revision getVersion(@NonNull java.lang.String cmakeVersionString)
-
getBuildCommand
@NonNull public static java.util.List<java.lang.String> getBuildCommand(@NonNull java.io.File cmakeExecutable, @NonNull java.io.File outputFolder, @NonNull java.lang.String targetName)Returns the build command for the given target (given the output folder and cmake executable).
-
getCleanCommand
@NonNull public static java.util.List<java.lang.String> getCleanCommand(@NonNull java.io.File cmakeExecutable, @NonNull java.io.File outputFolder)Returns the command to clean up for the given target (given the output folder and cmake executable).
-
getBuildTargetsCommand
public static java.util.List<java.lang.String> getBuildTargetsCommand(@NonNull java.io.File cmakeExecutable, @NonNull java.io.File outputFolder, @NonNull java.util.List<java.lang.String> buildCommandArgs)Returns the command to build multiple targets. Before executing the returned command, the targets to build must be substituted using the substituteBuildTargetsCommand method.
-
getCppExtensionSet
@NonNull public static java.util.Set<java.lang.String> getCppExtensionSet(@NonNull CodeModel codeModel)Returns the C++ file extensions for the given code model.
-
getCExtensionSet
@NonNull public static java.util.Set<java.lang.String> getCExtensionSet(CodeModel codeModel)
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
@Nullable public static <ContentType> java.lang.String getObjectToString(@Nullable ContentType content)Returns a JSON string representation of the given object. This is used instead of 'toString' when printing an object's contents.
-
-