All Known Implementing Classes:
ServerProtocolV1

public interface Server
Interface that defines a Cmake server. Server interface is based off of https://cmake.org/cmake/help/v3.7/manual/cmake-server.7.html
  • Method Details

    • connect

      boolean connect() throws IOException
      Starts and connects to a Cmake server and sends a HelloRequest.
      Returns:
      true if connected successfully to Cmake server
      Throws:
      IOException - I/O failure
    • disconnect

      void disconnect() throws IOException
      Disconnected from the Cmake server.
      Throws:
      IOException - I/O failure
    • isConnected

      boolean isConnected()
      Returns the connection status to the Cmake server
      Returns:
      true if connected Cmake server
    • getSupportedVersion

      @Nullable List<ProtocolVersion> getSupportedVersion()
      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.
      Returns:
      list of protocol versions supported by the server. The list is empty if the server does not support the Cmake server.
    • handshake

      @NonNull HandshakeResult handshake(@NonNull HandshakeRequest handshakeRequest) throws IOException
      One of the first request a client may send to the Cmake server.
      Parameters:
      handshakeRequest - - a valid handshake request
      Returns:
      HandshakeResult
      Throws:
      IOException - I/O failure
    • configure

      @NonNull ConfigureCommandResult configure(@NonNull String... cacheArguments) throws IOException
      Configures our project for build.
      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 ComputeResult compute() throws IOException
      Computes, i.e., generates the build system files in the build directory. Ideally, this function should be called only if configure succeeds.
      Returns:
      ComputeResult
      Throws:
      IOException - I/O failure
    • codemodel

      @NonNull CodeModel codemodel() throws IOException
      Requests the project's code model once its configured successfully.
      Returns:
      CodeModel
      Throws:
      IOException - I/O failure
    • cache

      @NonNull CacheResult cache() throws IOException
      Lists the cached configuration values after the project is configured.
      Returns:
      CacheResult
      Throws:
      IOException - I/O failure
    • cmakeInputs

      @NonNull CmakeInputsResult cmakeInputs() throws IOException
      Requests files used by CMake as part of the build system itself.
      Returns:
      CmakeInputsResult
      Throws:
      IOException - I/O failure
    • globalSettings

      @NonNull GlobalSettings globalSettings() throws IOException
      Request to get the state of Cmake (after a successful handshake).
      Returns:
      global settings of Cmake's state
      Throws:
      IOException - I/O failure
    • getCCompilerExecutable

      @NonNull String getCCompilerExecutable()
      Returns the compiler executable used C files.
      Returns:
      full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
    • getCppCompilerExecutable

      @NonNull String getCppCompilerExecutable()
      Returns the compiler executable used Cpp files.
      Returns:
      full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
    • getCmakePath

      @NonNull String getCmakePath()
      Returns to the path of the Cmake executable.