Class CmakeUtils


  • public class CmakeUtils
    extends java.lang.Object
    Cmake utility class.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmakeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<java.lang.String> getCExtensionSet​(CodeModel codeModel)
      Returns the C file extensions for the given code model.
      static java.util.Set<java.lang.String> getCppExtensionSet​(CodeModel codeModel)
      Returns the C++ file extensions for the given code model.
      static <ContentType>
      java.lang.String
      getObjectToString​(ContentType content)
      Returns a JSON string representation of the given object.
      static int getToolchainHash​(com.android.build.gradle.internal.cxx.json.NativeToolchainValue toolchainValue)
      Returns the toolchain hash for the given toolchain.
      static com.android.repository.Revision getVersion​(java.io.File cmakeInstallPath)
      Parses the Cmake (from the given install path) version string into a structure.
      static com.android.repository.Revision getVersion​(java.lang.String cmakeVersionString)  
      static java.lang.String keepWhileNumbersAndDots​(java.lang.String versionString)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmakeUtils

        public CmakeUtils()
    • Method Detail

      • getVersion

        @NonNull
        public static com.android.repository.Revision getVersion​(@NonNull
                                                                 java.io.File cmakeInstallPath)
                                                          throws java.io.IOException
        Parses 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)
      • 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.