diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index a6f2186da6e1e7..b5d2f1834c5ddb 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -97,6 +97,8 @@ def AppGnArgs(self): gn_args["chip_config_network_layer_ble"] = False elif self == AndroidApp.VIRTUAL_DEVICE_APP: gn_args["chip_config_network_layer_ble"] = True + elif self == AndroidApp.CHIP_TOOL: + gn_args["chip_build_controller_dynamic_server"] = True return gn_args def ExampleName(self): diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index efffda6fed4735..5cc4586e78e800 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -15,6 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/nlio.gni") import("${chip_root}/build/chip/buildconfig_header.gni") +import("${chip_root}/src/lib/core/core.gni") import("${chip_root}/src/platform/device.gni") import("common_flags.gni") import("icd/icd.gni") @@ -211,9 +212,9 @@ static_library("app") { } if (chip_build_controller_dynamic_server) { - defines = [ + defines = [ "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", - "CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=1", + "CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=1" ] sources += [ "clusters/ota-provider/ota-provider.cpp", diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 7490e395eec930..609ffbc9e11bc5 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -15,7 +15,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("${chip_root}/build/chip/chip_codegen.gni") -import("${chip_root}/src/lib/core/core.gni") +import("${chip_root}/src/app/common_flags.gni") import("${chip_root}/src/platform/python.gni") _app_root = get_path_info(".", "abspath") @@ -94,7 +94,7 @@ template("chip_data_model") { # is this during app compile but not others? I am unclear what # zap_pregenerated_dir is supposed to convey. Existence of a directory # does not obviously map to "need command handler cpp compiled in"). - if (defined(invoker.zap_pregenerated_dir)) { + if (defined(invoker.zap_pregenerated_dir) && !chip_build_controller_dynamic_server) { outputs += [ "zap-generated/IMClusterCommandHandler.cpp" ] } else { if (defined(prune_outputs)) { @@ -165,20 +165,25 @@ template("chip_data_model") { "${_app_root}/clusters/scenes-server/SceneTable.h", "${_app_root}/clusters/scenes-server/SceneTableImpl.h", "${_app_root}/clusters/scenes-server/scenes-server.h", - "${_app_root}/util/DataModelHandler.cpp", - "${_app_root}/util/attribute-size-util.cpp", - "${_app_root}/util/attribute-storage.cpp", - "${_app_root}/util/attribute-table.cpp", "${_app_root}/util/binding-table.cpp", "${_app_root}/util/binding-table.h", - "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/generic-callback-stubs.cpp", "${_app_root}/util/message.cpp", "${_app_root}/util/privilege-storage.cpp", - "${_app_root}/util/util.cpp", "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp", ] + if (!chip_build_controller_dynamic_server) { + sources += [ + "${_app_root}/util/DataModelHandler.cpp", + "${_app_root}/util/ember-compatibility-functions.cpp", + "${_app_root}/util/attribute-size-util.cpp", + "${_app_root}/util/attribute-storage.cpp", + "${_app_root}/util/attribute-table.cpp", + "${_app_root}/util/util.cpp", + ] + } + if (defined(invoker.zap_file)) { _zap_file = rebase_path(invoker.zap_file, root_build_dir) _script_args = [ diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 122e87bc550ffb..86ffc80ba28463 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -136,7 +136,6 @@ chip_test_suite_using_nltest("tests") { "TestEventLoggingNoUTCTime.cpp", "TestEventOverflow.cpp", "TestEventPathParams.cpp", - "TestExtensionFieldSets.cpp", "TestFabricScopedEventLogging.cpp", "TestICDManager.cpp", "TestICDMonitoringTable.cpp", @@ -148,7 +147,6 @@ chip_test_suite_using_nltest("tests") { "TestPowerSourceCluster.cpp", "TestReadInteraction.cpp", "TestReportingEngine.cpp", - "TestSceneTable.cpp", "TestStatusIB.cpp", "TestStatusResponseMessage.cpp", "TestTimeSyncDataProvider.cpp", @@ -196,8 +194,6 @@ chip_test_suite_using_nltest("tests") { ":binding-test-srcs", ":operational-state-test-srcs", ":ota-requestor-test-srcs", - ":power-cluster-test-srcs", - ":scenes-table-test-srcs", ":time-sync-data-provider-test-srcs", "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", @@ -209,6 +205,17 @@ chip_test_suite_using_nltest("tests") { "${nlunit_test_root}:nlunit-test", ] + if (chip_device_platform != "android") { + test_sources += [ + "TestExtensionFieldSets.cpp", + "TestSceneTable.cpp", + ] + public_deps += [ + ":power-cluster-test-srcs", + ":scenes-table-test-srcs", + ] + } + # Do not run TestCommissionManager when running ICD specific unit tests. # ICDManager has a dependency on the Accessors.h file which causes a link error # when building the TestCommissionManager diff --git a/src/app/util/BUILD.gn b/src/app/util/BUILD.gn index 7c7ec66b7e709c..e4cab1951ff950 100644 --- a/src/app/util/BUILD.gn +++ b/src/app/util/BUILD.gn @@ -13,3 +13,4 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("${chip_root}/src/platform/device.gni") \ No newline at end of file diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 6f32414226c315..cf9fc4bb347621 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -63,7 +63,6 @@ shared_library("jni") { ] deps = [ - "${chip_root}/src/controller/data_model", "${chip_root}/src/credentials:default_attestation_verifier", "${chip_root}/src/inet", "${chip_root}/src/lib", @@ -91,11 +90,14 @@ shared_library("jni") { "zap-generated/CHIPReadCallbacks.cpp", ] - deps += [ "${chip_root}/src/controller/data_model:java-jni-sources" ] + deps += [ + "${chip_root}/src/controller/data_model", + "${chip_root}/src/controller/data_model:java-jni-sources" ] } if (chip_build_controller_dynamic_server) { defines += [ "CHIP_DEVICE_CONFIG_DYNAMIC_SERVER" ] + deps += [ "${chip_root}/src/controller:nodatamodel" ] } if (matter_enable_java_compilation) {