Class ServerProtocolV1
- java.lang.Object
-
- com.android.build.gradle.external.cmake.server.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 Summary
Fields Modifier and Type Field Description static java.lang.StringCMAKE_SERVER_C_COMPILER_PREFIXstatic java.lang.StringCMAKE_SERVER_C_COMPILER_SUFFIXstatic java.lang.StringCMAKE_SERVER_CXX_COMPILER_PREFIXstatic java.lang.StringCMAKE_SERVER_FOOTER_MSGstatic java.lang.StringCMAKE_SERVER_HEADER_MSG
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheResultcache()Lists the cached configuration values after the project is configured.CmakeInputsResultcmakeInputs()Requests files used by CMake as part of the build system itself.CodeModelcodemodel()Requests the project's code model once its configured successfully.ComputeResultcompute()Computes, i.e., generates the build system files in the build directory.ConfigureCommandResultconfigure(java.lang.String... cacheArguments)Configures our project for build.booleanconnect()Starts and connects to a Cmake server and sends a HelloRequest.voiddisconnect()Disconnected from the Cmake server.voidfinalize()java.lang.StringgetCCompilerExecutable()Returns the compiler executable used C files.java.lang.StringgetCmakePath()Returns to the path of the Cmake executable.java.lang.StringgetCppCompilerExecutable()Returns the compiler executable used Cpp files.HelloResultgetHelloResult()java.util.List<ProtocolVersion>getSupportedVersion()Cmake server returns a list of supported versions when a connection is established (via the HelloResult).GlobalSettingsglobalSettings()Request to get the state of Cmake (after a successful handshake).HandshakeResulthandshake(HandshakeRequest handshakeRequest)One of the first request a client may send to the Cmake server.booleanisConnected()Returns the connection status to the Cmake server
-
-
-
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:
finalizein classjava.lang.Object
-
connect
public boolean connect() throws java.io.IOExceptionDescription copied from interface:ServerStarts and connects to a Cmake server and sends a HelloRequest.
-
disconnect
public void disconnect() throws java.io.IOExceptionDescription copied from interface:ServerDisconnected from the Cmake server.- Specified by:
disconnectin interfaceServer- Throws:
java.io.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
@Nullable public java.util.List<ProtocolVersion> 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 java.io.IOException
Description copied from interface:ServerOne of the first request a client may send to the Cmake server.
-
configure
@NonNull public ConfigureCommandResult configure(@NonNull java.lang.String... cacheArguments) throws java.io.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:
java.io.IOException- I/O failure
-
compute
@NonNull public ComputeResult compute() throws java.io.IOException
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.
-
codemodel
@NonNull public CodeModel codemodel() throws java.io.IOException
Description copied from interface:ServerRequests the project's code model once its configured successfully.
-
cache
@NonNull public CacheResult cache() throws java.io.IOException
Description copied from interface:ServerLists the cached configuration values after the project is configured.
-
globalSettings
@NonNull public GlobalSettings globalSettings() throws java.io.IOException
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:
java.io.IOException- I/O failure
-
cmakeInputs
@NonNull public CmakeInputsResult cmakeInputs() throws java.io.IOException
Description copied from interface:ServerRequests files used by CMake as part of the build system itself.- Specified by:
cmakeInputsin interfaceServer- Returns:
- CmakeInputsResult
- Throws:
java.io.IOException- I/O failure
-
getCCompilerExecutable
@NonNull public java.lang.String 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
@NonNull public java.lang.String 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
@NonNull public java.lang.String getCmakePath()
Description copied from interface:ServerReturns to the path of the Cmake executable.- Specified by:
getCmakePathin interfaceServer
-
getHelloResult
@NonNull public HelloResult getHelloResult()
-
-