Skip to content

Commit

Permalink
[Android] Add 'matter_enable_tlv_decoder_api' (project-chip#28977)
Browse files Browse the repository at this point in the history
* Divide android build feature

* restyle
  • Loading branch information
joonhaengHeo authored Sep 22, 2023
1 parent 59d2b7e commit 6612760
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions build/chip/java/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ declare_args() {

# The class of each cluster created by ZAP is added to the library. (e.g., ChipClusters)
matter_enable_java_generated_api = true

# The API of TLV decoder created by ZAP is added to the library.
# If the 'matter_enable_java_generated_api' feature is enabled, this feature must be enabled.
matter_enable_tlv_decoder_api = true

matter_enable_java_compilation = false
if (java_path != "" && current_os == "linux") {
java_matter_controller_dependent_paths += [ "${java_path}/include/" ]
Expand All @@ -31,6 +36,7 @@ declare_args() {
}

matter_enable_java_generated_api = false
matter_enable_tlv_decoder_api = false
matter_enable_java_compilation = true
}
}
18 changes: 13 additions & 5 deletions src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,21 @@ shared_library("jni") {
"${chip_root}/src/platform",
]

if (matter_enable_java_generated_api) {
if (matter_enable_tlv_decoder_api) {
defines += [ "USE_JAVA_TLV_ENCODE_DECODE" ]

sources += [
"CHIPDefaultCallbacks.cpp",
"CHIPDefaultCallbacks.h",
"CHIPTLVValueDecoder-JNI.cpp",
"zap-generated/CHIPAttributeTLVValueDecoder.cpp",
"zap-generated/CHIPClustersWrite-JNI.cpp",
"zap-generated/CHIPEventTLVValueDecoder.cpp",
]
}

if (matter_enable_java_generated_api) {
sources += [
"CHIPDefaultCallbacks.cpp",
"CHIPDefaultCallbacks.h",
"zap-generated/CHIPClustersWrite-JNI.cpp",
"zap-generated/CHIPInvokeCallbacks.cpp",
"zap-generated/CHIPInvokeCallbacks.h",
"zap-generated/CHIPReadCallbacks.cpp",
Expand Down Expand Up @@ -426,6 +431,10 @@ android_library("java") {
"src/chip/devicecontroller/model/NodeState.java",
]

if (matter_enable_tlv_decoder_api) {
sources += [ "src/chip/devicecontroller/ChipTLVValueDecoder.java" ]
}

if (matter_enable_java_generated_api) {
sources += [
"generated/java/chip/devicecontroller/ClusterReadMapping.java",
Expand All @@ -436,7 +445,6 @@ android_library("java") {
"src/chip/clusterinfo/CommandResponseInfo.java",
"src/chip/clusterinfo/DelegatedClusterCallback.java",
"src/chip/clusterinfo/InteractionInfo.java",
"src/chip/devicecontroller/ChipTLVValueDecoder.java",
"zap-generated/chip/devicecontroller/ChipClusters.java",
"zap-generated/chip/devicecontroller/ChipEventStructs.java",
"zap-generated/chip/devicecontroller/ChipStructs.java",
Expand Down

0 comments on commit 6612760

Please sign in to comment.