Class ServerProtocolV1

java.lang.Object
com.android.build.gradle.external.cmake.server.ServerProtocolV1
All Implemented Interfaces:
Server

public class ServerProtocolV1 extends Object implements Server
Implementation of version 1 of Cmake server for Cmake versions 3.7.1. Cmake server or a long running mode which allows a client to configure and request buildsystem information generated by Cmake. More info: https://cmake.org/cmake/help/v3.7/manual/cmake-server.7.html
  • Field Details

  • Method Details

    • finalize

      public void finalize()
      Overrides:
      finalize in class Object
    • connect

      public boolean connect() throws IOException
      Description copied from interface: Server
      Starts and connects to a Cmake server and sends a HelloRequest.
      Specified by:
      connect in interface Server
      Returns:
      true if connected successfully to Cmake server
      Throws:
      IOException - I/O failure
    • disconnect

      public void disconnect() throws IOException
      Description copied from interface: Server
      Disconnected from the Cmake server.
      Specified by:
      disconnect in interface Server
      Throws:
      IOException - I/O failure
    • isConnected

      public boolean isConnected()
      Description copied from interface: Server
      Returns the connection status to the Cmake server
      Specified by:
      isConnected in interface Server
      Returns:
      true if connected Cmake server
    • getSupportedVersion

      @Nullable public List<ProtocolVersion> getSupportedVersion()
      Description copied from interface: Server
      Cmake server returns a list of supported versions when a connection is established (via the HelloResult). This function returns the supported version to be sent for handshake.
      Specified by:
      getSupportedVersion in interface Server
      Returns:
      list of protocol versions supported by the server. The list is empty if the server does not support the Cmake server.
    • handshake

      @NonNull public HandshakeResult handshake(@NonNull HandshakeRequest handshakeRequest) throws IOException
      Description copied from interface: Server
      One of the first request a client may send to the Cmake server.
      Specified by:
      handshake in interface Server
      Parameters:
      handshakeRequest - - a valid handshake request
      Returns:
      HandshakeResult
      Throws:
      IOException - I/O failure
    • configure

      @NonNull public ConfigureCommandResult configure(@NonNull String... cacheArguments) throws IOException
      Description copied from interface: Server
      Configures our project for build.
      Specified by:
      configure in interface Server
      Parameters:
      cacheArguments - list of strings to configure via the cache argument keys. These string are interpreted similar to cmake command line client.
      Returns:
      ConfigureCommandResult - this object holds the ConfigureResult and interactive messages returned by Cmake when configuring the project.
      Throws:
      IOException - I/O failure
    • compute

      @NonNull public ComputeResult compute() throws IOException
      Description copied from interface: Server
      Computes, i.e., generates the build system files in the build directory. Ideally, this function should be called only if configure succeeds.
      Specified by:
      compute in interface Server
      Returns:
      ComputeResult
      Throws:
      IOException - I/O failure
    • codemodel

      @NonNull public CodeModel codemodel() throws IOException
      Description copied from interface: Server
      Requests the project's code model once its configured successfully.
      Specified by:
      codemodel in interface Server
      Returns:
      CodeModel
      Throws:
      IOException - I/O failure
    • cache

      @NonNull public CacheResult cache() throws IOException
      Description copied from interface: Server
      Lists the cached configuration values after the project is configured.
      Specified by:
      cache in interface Server
      Returns:
      CacheResult
      Throws:
      IOException - I/O failure
    • globalSettings

      @NonNull public GlobalSettings globalSettings() throws IOException
      Description copied from interface: Server
      Request to get the state of Cmake (after a successful handshake).
      Specified by:
      globalSettings in interface Server
      Returns:
      global settings of Cmake's state
      Throws:
      IOException - I/O failure
    • cmakeInputs

      @NonNull public CmakeInputsResult cmakeInputs() throws IOException
      Description copied from interface: Server
      Requests files used by CMake as part of the build system itself.
      Specified by:
      cmakeInputs in interface Server
      Returns:
      CmakeInputsResult
      Throws:
      IOException - I/O failure
    • getCCompilerExecutable

      @NonNull public String getCCompilerExecutable()
      Description copied from interface: Server
      Returns the compiler executable used C files.
      Specified by:
      getCCompilerExecutable in interface Server
      Returns:
      full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
    • getCppCompilerExecutable

      @NonNull public String getCppCompilerExecutable()
      Description copied from interface: Server
      Returns the compiler executable used Cpp files.
      Specified by:
      getCppCompilerExecutable in interface Server
      Returns:
      full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
    • getCmakePath

      @NonNull public String getCmakePath()
      Description copied from interface: Server
      Returns to the path of the Cmake executable.
      Specified by:
      getCmakePath in interface Server
    • getHelloResult

      @NonNull public HelloResult getHelloResult()