Class ServerProtocolV1
java.lang.Object
com.android.build.gradle.external.cmake.server.ServerProtocolV1
- All Implemented Interfaces:
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncache()Lists the cached configuration values after the project is configured.Requests files used by CMake as part of the build system itself.Requests the project's code model once its configured successfully.compute()Computes, i.e., generates the build system files in the build directory.Configures our project for build.booleanconnect()Starts and connects to a Cmake server and sends a HelloRequest.voidDisconnected from the Cmake server.voidfinalize()Returns the compiler executable used C files.Returns to the path of the Cmake executable.Returns the compiler executable used Cpp files.Cmake server returns a list of supported versions when a connection is established (via the HelloResult).Request to get the state of Cmake (after a successful handshake).handshake(HandshakeRequest handshakeRequest) One of the first request a client may send to the Cmake server.booleanReturns the connection status to the Cmake server
-
Field Details
-
CMAKE_SERVER_HEADER_MSG
- See Also:
-
CMAKE_SERVER_FOOTER_MSG
- See Also:
-
CMAKE_SERVER_C_COMPILER_PREFIX
- See Also:
-
CMAKE_SERVER_CXX_COMPILER_PREFIX
- See Also:
-
CMAKE_SERVER_C_COMPILER_SUFFIX
- See Also:
-
-
Method Details
-
finalize
public void finalize() -
connect
Description copied from interface:ServerStarts and connects to a Cmake server and sends a HelloRequest.- Specified by:
connectin interfaceServer- Returns:
- true if connected successfully to Cmake server
- Throws:
IOException- I/O failure
-
disconnect
Description copied from interface:ServerDisconnected from the Cmake server.- Specified by:
disconnectin interfaceServer- Throws:
IOException- I/O failure
-
isConnected
public boolean isConnected()Description copied from interface:ServerReturns the connection status to the Cmake server- Specified by:
isConnectedin interfaceServer- Returns:
- true if connected Cmake server
-
getSupportedVersion
Description copied from interface:ServerCmake 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:
getSupportedVersionin interfaceServer- 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:ServerOne of the first request a client may send to the Cmake server.- Specified by:
handshakein interfaceServer- 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:ServerConfigures our project for build.- Specified by:
configurein interfaceServer- 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
Description copied from interface:ServerComputes, i.e., generates the build system files in the build directory. Ideally, this function should be called only if configure succeeds.- Specified by:
computein interfaceServer- Returns:
- ComputeResult
- Throws:
IOException- I/O failure
-
codemodel
Description copied from interface:ServerRequests the project's code model once its configured successfully.- Specified by:
codemodelin interfaceServer- Returns:
- CodeModel
- Throws:
IOException- I/O failure
-
cache
Description copied from interface:ServerLists the cached configuration values after the project is configured.- Specified by:
cachein interfaceServer- Returns:
- CacheResult
- Throws:
IOException- I/O failure
-
globalSettings
Description copied from interface:ServerRequest to get the state of Cmake (after a successful handshake).- Specified by:
globalSettingsin interfaceServer- Returns:
- global settings of Cmake's state
- Throws:
IOException- I/O failure
-
cmakeInputs
Description copied from interface:ServerRequests files used by CMake as part of the build system itself.- Specified by:
cmakeInputsin interfaceServer- Returns:
- CmakeInputsResult
- Throws:
IOException- I/O failure
-
getCCompilerExecutable
Description copied from interface:ServerReturns the compiler executable used C files.- Specified by:
getCCompilerExecutablein interfaceServer- Returns:
- full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
-
getCppCompilerExecutable
Description copied from interface:ServerReturns the compiler executable used Cpp files.- Specified by:
getCppCompilerExecutablein interfaceServer- Returns:
- full path to the compiler and compiler executable. If compiler executable is not found this function returns null.
-
getCmakePath
Description copied from interface:ServerReturns to the path of the Cmake executable.- Specified by:
getCmakePathin interfaceServer
-
getHelloResult
-