Skip to content

Commit

Permalink
Decouple Java generated API
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo committed Jul 5, 2023
1 parent a9773c9 commit d907dad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
2 changes: 2 additions & 0 deletions build/chip/java/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
java_path = getenv("JAVA_PATH")
declare_args() {
java_matter_controller_dependent_paths = []
matter_enable_java_generated_api = true
matter_enable_java_compilation = false
if (java_path != "" && current_os == "linux") {
java_matter_controller_dependent_paths += [ "${java_path}/include/" ]
Expand All @@ -27,6 +28,7 @@ declare_args() {
[ "${java_path}/include/linux/" ]
}

matter_enable_java_generated_api = false
matter_enable_java_compilation = true
}
}
45 changes: 28 additions & 17 deletions src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,35 @@ shared_library("jni") {
"AttestationTrustStoreBridge.h",
"BaseCHIPCluster-JNI.cpp",
"CHIPAttributeTLVValueDecoder.h",
"CHIPDefaultCallbacks.cpp",
"CHIPDefaultCallbacks.h",
"CHIPDeviceController-JNI.cpp",
"DeviceAttestationDelegateBridge.cpp",
"DeviceAttestationDelegateBridge.h",
"zap-generated/CHIPAttributeTLVValueDecoder.cpp",
"zap-generated/CHIPClustersWrite-JNI.cpp",
"zap-generated/CHIPEventTLVValueDecoder.cpp",
"zap-generated/CHIPInvokeCallbacks.cpp",
"zap-generated/CHIPInvokeCallbacks.h",
"zap-generated/CHIPReadCallbacks.cpp",
]

deps = [
"${chip_root}/src/controller/data_model",
"${chip_root}/src/controller/data_model:java-jni-sources",
"${chip_root}/src/credentials:default_attestation_verifier",
"${chip_root}/src/inet",
"${chip_root}/src/lib",
"${chip_root}/src/lib/support/jsontlv",
"${chip_root}/src/platform",
]

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",
]

deps += [ "${chip_root}/src/controller/data_model:java-jni-sources" ]
}

if (matter_enable_java_compilation) {
defines = [ "JAVA_MATTER_CONTROLLER_TEST" ]

Expand Down Expand Up @@ -297,14 +303,6 @@ android_library("java") {

sources = [
"generated/java/chip/devicecontroller/ClusterIDMapping.java",
"generated/java/chip/devicecontroller/ClusterReadMapping.java",
"generated/java/chip/devicecontroller/ClusterWriteMapping.java",
"src/chip/clusterinfo/ClusterCommandCallback.java",
"src/chip/clusterinfo/ClusterInfo.java",
"src/chip/clusterinfo/CommandParameterInfo.java",
"src/chip/clusterinfo/CommandResponseInfo.java",
"src/chip/clusterinfo/DelegatedClusterCallback.java",
"src/chip/clusterinfo/InteractionInfo.java",
"src/chip/devicecontroller/AttestationInfo.java",
"src/chip/devicecontroller/AttestationTrustStoreDelegate.java",
"src/chip/devicecontroller/CSRInfo.java",
Expand Down Expand Up @@ -344,12 +342,25 @@ android_library("java") {
"src/chip/devicecontroller/model/EventState.java",
"src/chip/devicecontroller/model/InvokeElement.java",
"src/chip/devicecontroller/model/NodeState.java",
"zap-generated/chip/devicecontroller/ChipClusters.java",
"zap-generated/chip/devicecontroller/ChipEventStructs.java",
"zap-generated/chip/devicecontroller/ChipStructs.java",
"zap-generated/chip/devicecontroller/ClusterInfoMapping.java",
]

if (matter_enable_java_generated_api) {
sources += [
"generated/java/chip/devicecontroller/ClusterReadMapping.java",
"generated/java/chip/devicecontroller/ClusterWriteMapping.java",
"src/chip/clusterinfo/ClusterCommandCallback.java",
"src/chip/clusterinfo/ClusterInfo.java",
"src/chip/clusterinfo/CommandParameterInfo.java",
"src/chip/clusterinfo/CommandResponseInfo.java",
"src/chip/clusterinfo/DelegatedClusterCallback.java",
"src/chip/clusterinfo/InteractionInfo.java",
"zap-generated/chip/devicecontroller/ChipClusters.java",
"zap-generated/chip/devicecontroller/ClusterInfoMapping.java",
]
}

if (matter_enable_java_compilation) {
deps += [
"${chip_root}/third_party/java_deps:json",
Expand Down

0 comments on commit d907dad

Please sign in to comment.