Class ServerProtocolV1

  • All Implemented Interfaces:
    Server

    public class ServerProtocolV1
    extends java.lang.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 Detail

      • CMAKE_SERVER_HEADER_MSG

        public static final java.lang.String CMAKE_SERVER_HEADER_MSG
        See Also:
        Constant Field Values
      • CMAKE_SERVER_FOOTER_MSG

        public static final java.lang.String CMAKE_SERVER_FOOTER_MSG
        See Also:
        Constant Field Values
      • CMAKE_SERVER_C_COMPILER_PREFIX

        public static final java.lang.String CMAKE_SERVER_C_COMPILER_PREFIX
        See Also:
        Constant Field Values
      • CMAKE_SERVER_CXX_COMPILER_PREFIX

        public static final java.lang.String CMAKE_SERVER_CXX_COMPILER_PREFIX
        See Also:
        Constant Field Values
      • CMAKE_SERVER_C_COMPILER_SUFFIX

        public static final java.lang.String CMAKE_SERVER_C_COMPILER_SUFFIX
        See Also:
        Constant Field Values
    • Method Detail

      • finalize

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

        public boolean connect()
                        throws java.io.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:
        java.io.IOException - I/O failure
      • disconnect

        public void disconnect()
                        throws java.io.IOException
        Description copied from interface: Server
        Disconnected from the Cmake server.
        Specified by:
        disconnect in interface Server
        Throws:
        java.io.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 java.util.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 java.io.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:
        java.io.IOException - I/O failure
      • configure

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

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

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

        @NonNull
        public CacheResult cache()
                          throws java.io.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:
        java.io.IOException - I/O failure
      • globalSettings

        @NonNull
        public GlobalSettings globalSettings()
                                      throws java.io.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:
        java.io.IOException - I/O failure
      • cmakeInputs

        @NonNull
        public CmakeInputsResult cmakeInputs()
                                      throws java.io.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:
        java.io.IOException - I/O failure
      • getCCompilerExecutable

        @NonNull
        public java.lang.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 java.lang.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 java.lang.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()