Class CmakeUtils

java.lang.Object
com.android.build.gradle.external.cmake.CmakeUtils

public class CmakeUtils extends Object
Cmake utility class.
  • 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 IOException
      Parses the Cmake (from the given install path) version string into a structure.
      Returns:
      Revision for the version string.
      Throws:
      IOException - I/O failure
    • keepWhileNumbersAndDots

      @NonNull public static String keepWhileNumbersAndDots(String versionString)
    • getVersion

      @NonNull public static com.android.repository.Revision getVersion(@NonNull String cmakeVersionString)
    • getCppExtensionSet

      @NonNull public static Set<String> getCppExtensionSet(@NonNull CodeModel codeModel)
      Returns the C++ file extensions for the given code model.
    • getCExtensionSet

      @NonNull public static Set<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> 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.