Interface Server

  • 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 Detail

      • connect

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

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

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

        @Nullable
        java.util.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 java.io.IOException
        One of the first request a client may send to the Cmake server.
        Parameters:
        handshakeRequest - - a valid handshake request
        Returns:
        HandshakeResult
        Throws:
        java.io.IOException - I/O failure
      • configure

        @NonNull
        ConfigureCommandResult configure​(@NonNull
                                         java.lang.String... cacheArguments)
                                  throws java.io.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:
        java.io.IOException - I/O failure
      • compute

        @NonNull
        ComputeResult compute()
                       throws java.io.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:
        java.io.IOException - I/O failure
      • codemodel

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

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

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

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

        @NonNull
        java.lang.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
        java.lang.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
        java.lang.String getCmakePath()
        Returns to the path of the Cmake executable.