From 2a1e0c32d551d568bbf9ea77db42198261833d2e Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Sun, 16 Aug 2020 18:19:18 -0400 Subject: [PATCH] Reformat GN build files gn format $(git ls-files HEAD '*.gn' '*.gni') git add $(git ls-files HEAD '*.gn' '*.gni') We should add this to restyled, filed #2191 --- BUILD.gn | 4 +-- examples/lighting-app/nrf5/BUILD.gn | 32 +++++++++++----------- examples/lock-app/efr32/BUILD.gn | 11 ++++---- examples/lock-app/nrf5/BUILD.gn | 28 ++++++++++---------- examples/platform/nrf528xx/args.gni | 3 +-- src/app/BUILD.gn | 4 +-- src/controller/BUILD.gn | 2 +- src/crypto/tests/BUILD.gn | 6 ++--- src/lib/message/BUILD.gn | 38 +++++++++++++-------------- src/platform/BUILD.gn | 2 +- src/platform/device.gni | 5 ++-- third_party/efr32_sdk/efr32_board.gni | 1 - third_party/ot-br-posix/BUILD.gn | 3 +-- 13 files changed, 68 insertions(+), 71 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 5910d13a79dc66..8e9f673e386a7c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -58,9 +58,9 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") { if (chip_build_tools) { deps += [ + "${chip_root}/examples/shell", "${chip_root}/src/qrcodetool", "${chip_root}/src/setup_payload", - "${chip_root}/examples/shell", ] } } @@ -74,8 +74,8 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") { "${chip_root}/src/crypto/tests", "${chip_root}/src/inet/tests", "${chip_root}/src/lib/core/tests", - "${chip_root}/src/lib/support/tests", "${chip_root}/src/lib/shell/tests", + "${chip_root}/src/lib/support/tests", "${chip_root}/src/lwip/tests", "${chip_root}/src/platform/tests", "${chip_root}/src/setup_payload/tests", diff --git a/examples/lighting-app/nrf5/BUILD.gn b/examples/lighting-app/nrf5/BUILD.gn index 998438996e2558..5fcf9d6662f7b5 100644 --- a/examples/lighting-app/nrf5/BUILD.gn +++ b/examples/lighting-app/nrf5/BUILD.gn @@ -54,6 +54,17 @@ executable("lighting_app") { output_name = "chip-nrf52840-lighting-example" sources = [ + "${chip_root}/src/app/clusters/on-off-server/on-off.c", + "${chip_root}/src/app/util/attribute-size.c", + "${chip_root}/src/app/util/attribute-storage.c", + "${chip_root}/src/app/util/attribute-table.c", + "${chip_root}/src/app/util/chip-response.cpp", + "${chip_root}/src/app/util/client-api.c", + "${chip_root}/src/app/util/ember-print.cpp", + "${chip_root}/src/app/util/message.c", + "${chip_root}/src/app/util/process-cluster-message.c", + "${chip_root}/src/app/util/process-global-message.c", + "${chip_root}/src/app/util/util.c", "${nrf5_platform_dir}/app/Server.cpp", "${nrf5_platform_dir}/app/chipinit.cpp", "${nrf5_platform_dir}/app/include/Server.h", @@ -65,25 +76,14 @@ executable("lighting_app") { "main/AppTask.cpp", "main/DataModelHandler.cpp", "main/LightingManager.cpp", + "main/gen/call-command-handler.c", + "main/gen/callback-stub.c", + "main/gen/znet-bookkeeping.c", "main/include/AppEvent.h", "main/include/AppTask.h", "main/include/DataModelHandler.h", "main/include/LightingManager.h", "main/main.cpp", - "main/gen/call-command-handler.c", - "main/gen/callback-stub.c", - "main/gen/znet-bookkeeping.c", - "${chip_root}/src/app/util/attribute-size.c", - "${chip_root}/src/app/util/attribute-storage.c", - "${chip_root}/src/app/util/attribute-table.c", - "${chip_root}/src/app/util/chip-response.cpp", - "${chip_root}/src/app/util/client-api.c", - "${chip_root}/src/app/util/ember-print.cpp", - "${chip_root}/src/app/util/message.c", - "${chip_root}/src/app/util/process-cluster-message.c", - "${chip_root}/src/app/util/process-global-message.c", - "${chip_root}/src/app/util/util.c", - "${chip_root}/src/app/clusters/on-off-server/on-off.c", ] deps = [ @@ -91,10 +91,10 @@ executable("lighting_app") { "${chip_root}/src/lib", "${chip_root}/third_party/openthread/platforms/nrf528xx:libnordicsemi_nrf52840_radio_driver_softdevice", "${chip_root}/third_party/openthread/platforms/nrf528xx:libopenthread-nrf52840-softdevice-sdk", - "${openthread_root}:libopenthread-cli-ftd", - "${openthread_root}:libopenthread-ftd", "${nrf5_platform_dir}/app/support:freertos_newlib_lock_support", "${nrf5_platform_dir}/app/support:freertos_newlib_lock_support_test", + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", ] output_dir = root_out_dir diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index f4841cc9717a1f..36629739dfcb82 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -42,9 +42,10 @@ efr32_sdk("sdk") { defines += [ "BUILD_RELEASE=1" ] } - defines += [ "USE_APP_CONFIG", - "${efr32_board}=1", - "BOARD_ID=${efr32_board}", + defines += [ + "USE_APP_CONFIG", + "${efr32_board}=1", + "BOARD_ID=${efr32_board}", ] } @@ -64,10 +65,10 @@ executable("lock_app") { "src/AppTask.cpp", "src/ButtonHandler.cpp", "src/LEDWidget.cpp", + "src/main.cpp", + "src/platform/${efr32_family}/${efr32_board}/hal-config.h", "src/platform/${efr32_family}/${efr32_board}/init_board.c", "src/platform/${efr32_family}/${efr32_board}/init_mcu.c", - "src/platform/${efr32_family}/${efr32_board}/hal-config.h", - "src/main.cpp", ] output_dir = root_out_dir diff --git a/examples/lock-app/nrf5/BUILD.gn b/examples/lock-app/nrf5/BUILD.gn index dd7555bdf22745..85c24521b86ee7 100644 --- a/examples/lock-app/nrf5/BUILD.gn +++ b/examples/lock-app/nrf5/BUILD.gn @@ -55,6 +55,17 @@ executable("lock_app") { output_name = "chip-nrf52840-lock-example" sources = [ + "${chip_root}/src/app/clusters/on-off-server/on-off.c", + "${chip_root}/src/app/util/attribute-size.c", + "${chip_root}/src/app/util/attribute-storage.c", + "${chip_root}/src/app/util/attribute-table.c", + "${chip_root}/src/app/util/chip-response.cpp", + "${chip_root}/src/app/util/client-api.c", + "${chip_root}/src/app/util/ember-print.cpp", + "${chip_root}/src/app/util/message.c", + "${chip_root}/src/app/util/process-cluster-message.c", + "${chip_root}/src/app/util/process-global-message.c", + "${chip_root}/src/app/util/util.c", "${nrf5_platform_dir}/app/Server.cpp", "${nrf5_platform_dir}/app/chipinit.cpp", "${nrf5_platform_dir}/app/include/Server.h", @@ -66,25 +77,14 @@ executable("lock_app") { "main/AppTask.cpp", "main/BoltLockManager.cpp", "main/DataModelHandler.cpp", + "main/gen/call-command-handler.c", + "main/gen/callback-stub.c", + "main/gen/znet-bookkeeping.c", "main/include/AppEvent.h", "main/include/AppTask.h", "main/include/BoltLockManager.h", "main/include/DataModelHandler.h", "main/main.cpp", - "main/gen/call-command-handler.c", - "main/gen/callback-stub.c", - "main/gen/znet-bookkeeping.c", - "${chip_root}/src/app/util/attribute-size.c", - "${chip_root}/src/app/util/attribute-storage.c", - "${chip_root}/src/app/util/attribute-table.c", - "${chip_root}/src/app/util/chip-response.cpp", - "${chip_root}/src/app/util/client-api.c", - "${chip_root}/src/app/util/ember-print.cpp", - "${chip_root}/src/app/util/message.c", - "${chip_root}/src/app/util/process-cluster-message.c", - "${chip_root}/src/app/util/process-global-message.c", - "${chip_root}/src/app/util/util.c", - "${chip_root}/src/app/clusters/on-off-server/on-off.c", ] deps = [ diff --git a/examples/platform/nrf528xx/args.gni b/examples/platform/nrf528xx/args.gni index 684d2227d9acf4..3ee4ee21803912 100644 --- a/examples/platform/nrf528xx/args.gni +++ b/examples/platform/nrf528xx/args.gni @@ -23,8 +23,7 @@ arm_fpu = "fpv4-sp-d16" openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [] -openthread_core_config_deps = - [ "${chip_root}/examples/platform/nrf528xx:openthread_core_config_nrf52840_chip_examples" ] +openthread_core_config_deps = [ "${chip_root}/examples/platform/nrf528xx:openthread_core_config_nrf52840_chip_examples" ] chip_ble_project_config_include = "" chip_device_project_config_include = "" diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index cf583008a0604d..397bc2da40ac64 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -27,14 +27,14 @@ static_library("common") { output_name = "libCHIPDataModelCommon" sources = [ - "chip-zcl-zpro/command-encoder/encoder.c", "chip-zcl-zpro/command-encoder/decoder.c", + "chip-zcl-zpro/command-encoder/encoder.c", ] public_deps = [ + ":codec_headers", "${chip_root}/src/lib/support", "${chip_root}/src/system", - ":codec_headers", ] public_configs = [ ":app_config" ] diff --git a/src/controller/BUILD.gn b/src/controller/BUILD.gn index a064e85ced37c1..78a0c529063b9b 100644 --- a/src/controller/BUILD.gn +++ b/src/controller/BUILD.gn @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") # FIXME: remove after actual key exchange is implemented config("controller_wno_deprecate") { - cflags = ["-Wno-deprecated-declarations"] + cflags = [ "-Wno-deprecated-declarations" ] } static_library("controller") { diff --git a/src/crypto/tests/BUILD.gn b/src/crypto/tests/BUILD.gn index 5c4d8b0cca4d7a..80eb35a1b222c1 100644 --- a/src/crypto/tests/BUILD.gn +++ b/src/crypto/tests/BUILD.gn @@ -28,16 +28,16 @@ chip_test_suite("tests") { "HKDF_SHA256_test_vectors.h", "Hash_SHA256_test_vectors.h", "PBKDF2_SHA256_test_vectors.h", - "TestCryptoLayer.h", + "PBKDF2_SHA256_test_vectors.h", + "SPAKE2P_FE_MUL_test_vectors.h", "SPAKE2P_FE_RW_test_vectors.h", "SPAKE2P_HMAC_test_vectors.h", "SPAKE2P_POINT_MUL_ADD_test_vectors.h", "SPAKE2P_POINT_MUL_test_vectors.h", "SPAKE2P_POINT_RW_test_vectors.h", - "PBKDF2_SHA256_test_vectors.h", "SPAKE2P_POINT_VALID_test_vectors.h", - "SPAKE2P_FE_MUL_test_vectors.h", "SPAKE2P_RFC_test_vectors.h", + "TestCryptoLayer.h", ] public_deps = [ diff --git a/src/lib/message/BUILD.gn b/src/lib/message/BUILD.gn index d715b620302873..f742950bb3f986 100644 --- a/src/lib/message/BUILD.gn +++ b/src/lib/message/BUILD.gn @@ -26,30 +26,30 @@ static_library("message") { output_name = "libChipMessage" sources = [ - "CHIPBinding.cpp", - "CHIPBinding.h", - "CHIPConnection.cpp", - "CHIPExchangeMgr.cpp", - "CHIPExchangeMgr.h", - "CHIPFabricState.cpp", - "CHIPFabricState.h", - "CHIPMessageLayer.cpp", - "CHIPMessageLayer.h", - "CHIPSecurityMgr.h", - "CHIPSecurityMgr.cpp", - "CHIPServerBase.h", - "CHIPServerBase.cpp", - "CHIPRMPConfig.h", - "HostPortList.h", - "HostPortList.cpp", + "CHIPBinding.cpp", + "CHIPBinding.h", + "CHIPConnection.cpp", + "CHIPExchangeMgr.cpp", + "CHIPExchangeMgr.h", + "CHIPFabricState.cpp", + "CHIPFabricState.h", + "CHIPMessageLayer.cpp", + "CHIPMessageLayer.h", + "CHIPRMPConfig.h", + "CHIPSecurityMgr.cpp", + "CHIPSecurityMgr.h", + "CHIPServerBase.cpp", + "CHIPServerBase.h", + "HostPortList.cpp", + "HostPortList.h", ] public_deps = [ "${chip_root}/src/ble", "${chip_root}/src/ble:ble_config_header", "${chip_root}/src/crypto", - "${chip_root}/src/inet:inet_config_header", "${chip_root}/src/inet", + "${chip_root}/src/inet:inet_config_header", "${chip_root}/src/lib/core", "${chip_root}/src/lib/core:chip_config_header", "${chip_root}/src/lib/support", @@ -58,7 +58,5 @@ static_library("message") { "${nlio_root}:nlio", ] - public_configs = [ - ":includes", - ] + public_configs = [ ":includes" ] } diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index fa51d9f495b67c..485a60b4849689 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build/config/linux/pkg_config.gni") import("//build_overrides/chip.gni") import("//build_overrides/nlio.gni") -import("//build/config/linux/pkg_config.gni") import("device.gni") diff --git a/src/platform/device.gni b/src/platform/device.gni index 11f2da488d40be..09452b4011e653 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -31,10 +31,11 @@ if (chip_device_platform == "auto") { declare_args() { # Enable openthread support. - chip_enable_openthread = (chip_device_platform == "linux" || chip_device_platform == "nrf5") + chip_enable_openthread = + chip_device_platform == "linux" || chip_device_platform == "nrf5" # Enable wifi support. - chip_enable_wifi = chip_device_platform == "linux" + chip_enable_wifi = chip_device_platform == "linux" } _chip_device_layer = "none" diff --git a/third_party/efr32_sdk/efr32_board.gni b/third_party/efr32_sdk/efr32_board.gni index 5208df0aee99af..fcd711bd6692ea 100644 --- a/third_party/efr32_sdk/efr32_board.gni +++ b/third_party/efr32_sdk/efr32_board.gni @@ -50,4 +50,3 @@ if (efr32_board == "BRD4304A") { "Please provide a valid value for EFR32_BOARD env variable (currently supported BRD4304A, BRD4161A, BRD4166A, BRD4170A or BRD4180A)") assert(false, "The board ${efr32_board} is unsupported as for now.") } - diff --git a/third_party/ot-br-posix/BUILD.gn b/third_party/ot-br-posix/BUILD.gn index b2f048c6e390d7..6cd2c53c6451ec 100644 --- a/third_party/ot-br-posix/BUILD.gn +++ b/third_party/ot-br-posix/BUILD.gn @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build_overrides/chip.gni") import("//build/config/linux/pkg_config.gni") - +import("//build_overrides/chip.gni") config("ot_br_client_config") { include_dirs = [