From 2373630c2f9339cc3eaab96c51d8db2ad1126049 Mon Sep 17 00:00:00 2001 From: Sharad Binjola Date: Fri, 12 Apr 2024 14:29:29 -0700 Subject: [PATCH] Fixing build --- .../dry_run_android-arm64-chip-tool.txt | 2 + src/controller/java/BUILD.gn | 38 +++++-------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt index 8ff2afd8d8bb76..051f4dfbc9e42d 100644 --- a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt +++ b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt @@ -25,6 +25,8 @@ cp {out}/android-arm64-chip-tool/lib/jni/arm64-v8a/libc++_shared.so {root}/examp cp {out}/android-arm64-chip-tool/lib/src/controller/java/CHIPController.jar {root}/examples/android/CHIPTool/app/libs/CHIPController.jar +cp {out}/android-arm64-chip-tool/lib/src/controller/java/CHIPInteractionModel.jar {root}/examples/android/CHIPTool/app/libs/CHIPInteractionModel.jar + cp {out}/android-arm64-chip-tool/lib/src/controller/java/OnboardingPayload.jar {root}/examples/android/CHIPTool/app/libs/OnboardingPayload.jar cp {out}/android-arm64-chip-tool/lib/src/platform/android/AndroidPlatform.jar {root}/examples/android/CHIPTool/app/libs/AndroidPlatform.jar diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 4cbaf26b81c183..df9e5318e3b94d 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -72,7 +72,16 @@ source_set("android_chip_im_jni") { deps = [ "${chip_root}/src/lib", "${chip_root}/src/lib/support/jsontlv", + "${chip_root}/src/platform", ] + + if (current_os == "mac") { + ldflags = [ "-Wl,-dead_strip" ] + } else { + ldflags = [ "-Wl,--gc-sections" ] + } + + public_configs = [ "${chip_root}/src:includes" ] } shared_library("jni") { @@ -124,16 +133,6 @@ shared_library("jni") { "${chip_root}/src/platform", ] - if (matter_enable_tlv_decoder_api) { - defines += [ "USE_JAVA_TLV_ENCODE_DECODE" ] - - sources += [ - "CHIPTLVValueDecoder-JNI.cpp", - "zap-generated/CHIPAttributeTLVValueDecoder.cpp", - "zap-generated/CHIPEventTLVValueDecoder.cpp", - ] - } - if (chip_build_controller_dynamic_server) { sources += [ "BdxOTASender.cpp", @@ -197,6 +196,7 @@ if (chip_link_tests) { public_configs = [ "${chip_root}/src:includes" ] deps = [ + ":android_chip_im_jni", ":jni", "${chip_root}/src/messaging/tests:helpers", ] @@ -632,24 +632,6 @@ android_library("java") { sources += [ "src/chip/devicecontroller/ChipTLVValueDecoder.java" ] } - if (matter_enable_java_generated_api) { - sources += [ - "generated/java/chip/devicecontroller/ChipClusters.java", - "generated/java/chip/devicecontroller/ChipEventStructs.java", - "generated/java/chip/devicecontroller/ChipStructs.java", - "generated/java/chip/devicecontroller/ClusterInfoMapping.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/ChipTLVType.java", - ] - } - if (matter_enable_java_compilation) { deps += [ "${chip_root}/third_party/java_deps:json",