From a2fed9a56c651b4bb0ecdbaab61a0e8c0e5811a0 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Sat, 6 Nov 2021 11:55:58 +0800 Subject: [PATCH] chore(build): format all BUILD.gn files Signed-off-by: Caoruihong Change-Id: Ifd3bf13f53a27e0a0bbd051cf35662e7409e6ed0 --- apps/toybox/BUILD.gn | 5 ++++- apps/trace/BUILD.gn | 2 +- kernel/base/BUILD.gn | 2 +- kernel/extended/trace/BUILD.gn | 6 +++--- lib/libc/BUILD.gn | 4 ++-- liteos.gni | 6 ++++-- testsuites/unittest/BUILD.gn | 14 ++++++-------- testsuites/unittest/IPC/BUILD.gn | 3 +-- testsuites/unittest/drivers/hid/BUILD.gn | 9 +++------ testsuites/unittest/drivers/storage/BUILD.gn | 9 +++------ testsuites/unittest/dynload/BUILD.gn | 5 ++--- testsuites/unittest/exc/BUILD.gn | 6 ++---- testsuites/unittest/fs/proc/BUILD.gn | 5 ++--- testsuites/unittest/fs/vfat/BUILD.gn | 4 +--- testsuites/unittest/liteipc/BUILD.gn | 3 +-- testsuites/unittest/mem/shm/BUILD.gn | 4 +--- testsuites/unittest/mem/vm/BUILD.gn | 3 +-- testsuites/unittest/net/netdb/BUILD.gn | 4 ++-- testsuites/unittest/net/socket/BUILD.gn | 3 +-- testsuites/unittest/posix/mem/BUILD.gn | 3 +-- testsuites/unittest/process/mutex/BUILD.gn | 1 - testsuites/unittest/process/rwlock/BUILD.gn | 8 ++------ testsuites/unittest/process/spinlock/BUILD.gn | 7 ++----- testsuites/unittest/security/reugid/BUILD.gn | 7 ++----- testsuites/unittest/security/vid/BUILD.gn | 7 ++----- testsuites/unittest/signal/BUILD.gn | 3 +-- testsuites/unittest/time/timer/BUILD.gn | 3 +-- testsuites/unittest/trace/BUILD.gn | 3 +-- testsuites/unittest/util/BUILD.gn | 4 +--- 29 files changed, 54 insertions(+), 89 deletions(-) diff --git a/apps/toybox/BUILD.gn b/apps/toybox/BUILD.gn index f1d25054..c7b2f06f 100644 --- a/apps/toybox/BUILD.gn +++ b/apps/toybox/BUILD.gn @@ -46,7 +46,10 @@ copy("copy_toybox_config") { } build_ext_component("build_toybox") { - deps = [ ":copy_toybox_src", ":copy_toybox_config" ] + deps = [ + ":copy_toybox_config", + ":copy_toybox_src", + ] deps += [ "//prebuilts/lite/sysroot" ] exec_path = rebase_path("$target_out_dir/toybox_build") diff --git a/apps/trace/BUILD.gn b/apps/trace/BUILD.gn index d1427f16..e8afff91 100644 --- a/apps/trace/BUILD.gn +++ b/apps/trace/BUILD.gn @@ -31,4 +31,4 @@ import("//kernel/liteos_a/liteos.gni") executable("trace") { sources = [ "src/trace.c" ] -} \ No newline at end of file +} diff --git a/kernel/base/BUILD.gn b/kernel/base/BUILD.gn index a2ec0922..3bdcc06b 100644 --- a/kernel/base/BUILD.gn +++ b/kernel/base/BUILD.gn @@ -34,11 +34,11 @@ kernel_module(module_name) { sources = [ "core/los_bitmap.c", "core/los_process.c", + "core/los_smp.c", "core/los_swtmr.c", "core/los_sys.c", "core/los_task.c", "core/los_tick.c", - "core/los_smp.c", "ipc/los_event.c", "ipc/los_futex.c", "ipc/los_ipcdebug.c", diff --git a/kernel/extended/trace/BUILD.gn b/kernel/extended/trace/BUILD.gn index 5d1e4dcb..04cf9a5d 100644 --- a/kernel/extended/trace/BUILD.gn +++ b/kernel/extended/trace/BUILD.gn @@ -33,8 +33,8 @@ module_switch = defined(LOSCFG_KERNEL_TRACE) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = [ - "los_trace.c", "cnv/trace_cnv.c", + "los_trace.c", ] include_dirs = [ @@ -43,11 +43,11 @@ kernel_module(module_name) { "pipeline", ] - if (defined(LOSCFG_RECORDER_MODE_OFFLINE)){ + if (defined(LOSCFG_RECORDER_MODE_OFFLINE)) { sources += [ "trace_offline.c" ] } - if (defined(LOSCFG_RECORDER_MODE_ONLINE)){ + if (defined(LOSCFG_RECORDER_MODE_ONLINE)) { sources += [ "trace_online.c" ] } diff --git a/lib/libc/BUILD.gn b/lib/libc/BUILD.gn index 8169ff36..4937e5fe 100644 --- a/lib/libc/BUILD.gn +++ b/lib/libc/BUILD.gn @@ -69,13 +69,13 @@ kernel_module(module_name) { "-D__memchr_arm=memchr", ] sources += [ - "src/arch/arm/memset.S", "src/arch/arm/memcmp.S", + "src/arch/arm/memset.S", ] } else { sources += [ - "src/memset.c", "src/memcmp.c", + "src/memset.c", ] } diff --git a/liteos.gni b/liteos.gni index bfff15e5..25c1b404 100644 --- a/liteos.gni +++ b/liteos.gni @@ -45,7 +45,8 @@ template("kernel_module") { if (target_name != current_dir_name) { build_gn = rebase_path("BUILD.gn") cmd = "if grep -q '^\s*group\s*(\s*\"$current_dir_name\"\s*)\s*{\s*\$' $build_gn; then echo true; else echo false; fi" - has_current_dir_group = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + has_current_dir_group = + exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") if (!has_current_dir_group) { module_name = target_name group(current_dir_name) { @@ -66,7 +67,8 @@ template("kernel_module") { template("config") { config(target_name) { - if (defined(invoker.module_switch) && !invoker.module_switch && target_name == "public") { + if (defined(invoker.module_switch) && !invoker.module_switch && + target_name == "public") { not_needed(invoker, "*") forward_variables_from(invoker, [ "configs" ]) } else { diff --git a/testsuites/unittest/BUILD.gn b/testsuites/unittest/BUILD.gn index f2b0d7ed..92515714 100644 --- a/testsuites/unittest/BUILD.gn +++ b/testsuites/unittest/BUILD.gn @@ -36,14 +36,13 @@ local_flags = [ "-Wno-narrowing", "-fPIE", ] -if (LOSCFG_USER_TEST_SMP == "enable" || (LOSCFG_USER_TEST_SMP == "default" && board_name == "hispark_taurus")) { +if (LOSCFG_USER_TEST_SMP == "enable" || + (LOSCFG_USER_TEST_SMP == "default" && board_name == "hispark_taurus")) { local_flags += [ "-DLOSCFG_USER_TEST_SMP" ] } config("public_config_for_door") { - cflags = [ - "-DLOSCFG_USER_TEST_SMOKE", - ] + cflags = [ "-DLOSCFG_USER_TEST_SMOKE" ] cflags += local_flags cflags_cc = cflags } @@ -58,9 +57,7 @@ config("public_config_for_all") { } config("public_config_for_pressure") { - cflags = [ - "-DLOSCFG_USER_TEST_PRESSURE", - ] + cflags = [ "-DLOSCFG_USER_TEST_PRESSURE" ] cflags += local_flags cflags_cc = cflags } @@ -276,7 +273,8 @@ group("unittest") { } if (LOSCFG_USER_TEST_SECURITY_CAPABILITY == true) { if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - deps += [ "security/capability:liteos_a_security_capability_unittest_door" ] + deps += + [ "security/capability:liteos_a_security_capability_unittest_door" ] } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { deps += [ "security/capability:liteos_a_security_capability_unittest" ] diff --git a/testsuites/unittest/IPC/BUILD.gn b/testsuites/unittest/IPC/BUILD.gn index 701a3d08..7c7dbfa8 100644 --- a/testsuites/unittest/IPC/BUILD.gn +++ b/testsuites/unittest/IPC/BUILD.gn @@ -41,8 +41,7 @@ sources_entry = [ "ipc_test.cpp", ] -sources_smoke = [ -] +sources_smoke = [] sources_full = [ "full/IPC_test_mkfifoat_001.cpp", diff --git a/testsuites/unittest/drivers/hid/BUILD.gn b/testsuites/unittest/drivers/hid/BUILD.gn index 63290dd9..43efc9dc 100644 --- a/testsuites/unittest/drivers/hid/BUILD.gn +++ b/testsuites/unittest/drivers/hid/BUILD.gn @@ -41,12 +41,9 @@ sources_entry = [ "drivers_hid_test.cpp", ] -sources_smoke = [ - "smoke/hid_test_001.cpp", -] +sources_smoke = [ "smoke/hid_test_001.cpp" ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_drivers_hid_unittest_door") { @@ -73,4 +70,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { configs = [ "../..:public_config_for_all" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/drivers/storage/BUILD.gn b/testsuites/unittest/drivers/storage/BUILD.gn index 90007532..47e4193a 100644 --- a/testsuites/unittest/drivers/storage/BUILD.gn +++ b/testsuites/unittest/drivers/storage/BUILD.gn @@ -41,12 +41,9 @@ sources_entry = [ "drivers_storage_test.cpp", ] -sources_smoke = [ - "smoke/storage_test_001.cpp", -] +sources_smoke = [ "smoke/storage_test_001.cpp" ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_drivers_storage_unittest_door") { @@ -73,4 +70,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { configs = [ "../..:public_config_for_all" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/dynload/BUILD.gn b/testsuites/unittest/dynload/BUILD.gn index a984256d..0b0b4ed6 100644 --- a/testsuites/unittest/dynload/BUILD.gn +++ b/testsuites/unittest/dynload/BUILD.gn @@ -46,8 +46,7 @@ sources_smoke = [ "smoke/dynload_test_004.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_dynload_unittest_door") { @@ -74,4 +73,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { configs = [ "..:public_config_for_all" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/exc/BUILD.gn b/testsuites/unittest/exc/BUILD.gn index 3502cec1..331706ea 100644 --- a/testsuites/unittest/exc/BUILD.gn +++ b/testsuites/unittest/exc/BUILD.gn @@ -49,9 +49,7 @@ sources_smoke = [ "smoke/it_test_exc_005.cpp", ] -sources_full = [ - "full/it_test_fexecve_001.cpp", -] +sources_full = [ "full/it_test_fexecve_001.cpp" ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_exc_unittest_door") { @@ -78,4 +76,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { configs = [ "..:public_config_for_all" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/fs/proc/BUILD.gn b/testsuites/unittest/fs/proc/BUILD.gn index 9f3d7f88..4360c3d0 100644 --- a/testsuites/unittest/fs/proc/BUILD.gn +++ b/testsuites/unittest/fs/proc/BUILD.gn @@ -41,8 +41,7 @@ sources_entry = [ "It_vfs_proc.cpp", ] -sources_smoke = [ -] +sources_smoke = [] sources_full = [ "full/It_vfs_proc_001.cpp", @@ -78,4 +77,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { configs = [ "../..:public_config_for_all" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/fs/vfat/BUILD.gn b/testsuites/unittest/fs/vfat/BUILD.gn index cae4233e..be521447 100644 --- a/testsuites/unittest/fs/vfat/BUILD.gn +++ b/testsuites/unittest/fs/vfat/BUILD.gn @@ -42,9 +42,7 @@ sources_entry = [ "VfsFatTest.cpp", ] -sources_smoke = [ - "smoke/It_vfs_fat_026.cpp", -] +sources_smoke = [ "smoke/It_vfs_fat_026.cpp" ] sources_pressure = [ "pressure/It_fs_fat_performance_001.cpp", diff --git a/testsuites/unittest/liteipc/BUILD.gn b/testsuites/unittest/liteipc/BUILD.gn index 7a3f862c..0d6185cd 100644 --- a/testsuites/unittest/liteipc/BUILD.gn +++ b/testsuites/unittest/liteipc/BUILD.gn @@ -47,8 +47,7 @@ sources_smoke = [ "smoke/liteipc_test_002.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_liteipc_unittest_door") { diff --git a/testsuites/unittest/mem/shm/BUILD.gn b/testsuites/unittest/mem/shm/BUILD.gn index 0e677b46..449b0b29 100644 --- a/testsuites/unittest/mem/shm/BUILD.gn +++ b/testsuites/unittest/mem/shm/BUILD.gn @@ -41,9 +41,7 @@ sources_entry = [ "mem_shm_test.cpp", ] -sources_smoke = [ - "smoke/shm_test_011.cpp", -] +sources_smoke = [ "smoke/shm_test_011.cpp" ] sources_full = [ "full/shm_test_001.cpp", diff --git a/testsuites/unittest/mem/vm/BUILD.gn b/testsuites/unittest/mem/vm/BUILD.gn index d4253945..1bfeba6c 100644 --- a/testsuites/unittest/mem/vm/BUILD.gn +++ b/testsuites/unittest/mem/vm/BUILD.gn @@ -59,8 +59,7 @@ sources_smoke = [ "smoke/user_copy_test_001.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_mem_vm_unittest_door") { diff --git a/testsuites/unittest/net/netdb/BUILD.gn b/testsuites/unittest/net/netdb/BUILD.gn index c379af64..a2f423f6 100644 --- a/testsuites/unittest/net/netdb/BUILD.gn +++ b/testsuites/unittest/net/netdb/BUILD.gn @@ -44,8 +44,8 @@ common_include_dirs = [ ] sources_entry = [ - "../../common/osTest.cpp", - "net_netdb_test.cpp", + "../../common/osTest.cpp", + "net_netdb_test.cpp", ] sources_smoke = [ diff --git a/testsuites/unittest/net/socket/BUILD.gn b/testsuites/unittest/net/socket/BUILD.gn index f8402dbd..36cc66d7 100644 --- a/testsuites/unittest/net/socket/BUILD.gn +++ b/testsuites/unittest/net/socket/BUILD.gn @@ -64,8 +64,7 @@ sources_smoke = [ "smoke/net_socket_test_013.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_net_socket_unittest_door") { diff --git a/testsuites/unittest/posix/mem/BUILD.gn b/testsuites/unittest/posix/mem/BUILD.gn index bf7ea6d1..163ec961 100644 --- a/testsuites/unittest/posix/mem/BUILD.gn +++ b/testsuites/unittest/posix/mem/BUILD.gn @@ -46,8 +46,7 @@ sources_smoke = [ "smoke/It_posix_mem_003.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_posix_mem_unittest_door") { diff --git a/testsuites/unittest/process/mutex/BUILD.gn b/testsuites/unittest/process/mutex/BUILD.gn index ec9ce5ed..4ceb762d 100644 --- a/testsuites/unittest/process/mutex/BUILD.gn +++ b/testsuites/unittest/process/mutex/BUILD.gn @@ -70,7 +70,6 @@ sources_full = [ "full/pthread_mutex_test_023.cpp", "full/pthread_mutex_test_024.cpp", "full/pthread_mutex_test_025.cpp", - ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { diff --git a/testsuites/unittest/process/rwlock/BUILD.gn b/testsuites/unittest/process/rwlock/BUILD.gn index 4ed9394f..292fe0e2 100644 --- a/testsuites/unittest/process/rwlock/BUILD.gn +++ b/testsuites/unittest/process/rwlock/BUILD.gn @@ -41,13 +41,9 @@ sources_entry = [ "process_rwlock_test.cpp", ] -sources_smoke = [ - "smoke/pthread_rwlock_test_001.cpp", -] +sources_smoke = [ "smoke/pthread_rwlock_test_001.cpp" ] -sources_full = [ - "full/pthread_rwlock_test_002.cpp", -] +sources_full = [ "full/pthread_rwlock_test_002.cpp" ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_rwlock_unittest_door") { diff --git a/testsuites/unittest/process/spinlock/BUILD.gn b/testsuites/unittest/process/spinlock/BUILD.gn index d4134f1d..22e2061b 100644 --- a/testsuites/unittest/process/spinlock/BUILD.gn +++ b/testsuites/unittest/process/spinlock/BUILD.gn @@ -41,12 +41,9 @@ sources_entry = [ "process_spinlock_test.cpp", ] -sources_smoke = [ - "smoke/pthread_spinlock_test_001.cpp", -] +sources_smoke = [ "smoke/pthread_spinlock_test_001.cpp" ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_spinlock_unittest_door") { diff --git a/testsuites/unittest/security/reugid/BUILD.gn b/testsuites/unittest/security/reugid/BUILD.gn index 4c9cfb42..d0735590 100644 --- a/testsuites/unittest/security/reugid/BUILD.gn +++ b/testsuites/unittest/security/reugid/BUILD.gn @@ -41,12 +41,9 @@ sources_entry = [ "security_reugid_test.cpp", ] -sources_smoke = [ - "smoke/reugid_test_001.cpp", -] +sources_smoke = [ "smoke/reugid_test_001.cpp" ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_security_reugid_unittest_door") { diff --git a/testsuites/unittest/security/vid/BUILD.gn b/testsuites/unittest/security/vid/BUILD.gn index ad530683..da2f3d5b 100644 --- a/testsuites/unittest/security/vid/BUILD.gn +++ b/testsuites/unittest/security/vid/BUILD.gn @@ -41,12 +41,9 @@ sources_entry = [ "security_vid_test.cpp", ] -sources_smoke = [ - "smoke/vid_test_001.cpp", -] +sources_smoke = [ "smoke/vid_test_001.cpp" ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_security_vid_unittest_door") { diff --git a/testsuites/unittest/signal/BUILD.gn b/testsuites/unittest/signal/BUILD.gn index cf3c76dd..1bea9a96 100644 --- a/testsuites/unittest/signal/BUILD.gn +++ b/testsuites/unittest/signal/BUILD.gn @@ -51,7 +51,7 @@ sources_smoke = [ "smoke/mkfifo_test_002.cpp", "smoke/pipe_test_002.cpp", "smoke/pipe_test_004.cpp", - + "smoke/signal_test_002.cpp", "smoke/signal_test_009.cpp", "smoke/signal_test_013.cpp", @@ -109,7 +109,6 @@ sources_full = [ "full/pipe_test_003.cpp", "full/pipe_test_005.cpp", "full/pipe_test_006.cpp", - ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { diff --git a/testsuites/unittest/time/timer/BUILD.gn b/testsuites/unittest/time/timer/BUILD.gn index 12f75900..e046cd47 100644 --- a/testsuites/unittest/time/timer/BUILD.gn +++ b/testsuites/unittest/time/timer/BUILD.gn @@ -51,8 +51,7 @@ sources_smoke = [ "smoke/timer_test_tzset_002.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_time_timer_unittest_door") { diff --git a/testsuites/unittest/trace/BUILD.gn b/testsuites/unittest/trace/BUILD.gn index a9c6eebb..aecccb3b 100644 --- a/testsuites/unittest/trace/BUILD.gn +++ b/testsuites/unittest/trace/BUILD.gn @@ -48,8 +48,7 @@ sources_smoke = [ "smoke/trace_test_004.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_trace_unittest_door") { diff --git a/testsuites/unittest/util/BUILD.gn b/testsuites/unittest/util/BUILD.gn index cda816c0..0f99dc27 100644 --- a/testsuites/unittest/util/BUILD.gn +++ b/testsuites/unittest/util/BUILD.gn @@ -30,7 +30,6 @@ import("//build/lite/config/test.gni") import("../config.gni") - common_include_dirs = [ "//third_party/googletest/googletest/include", "../common/include", @@ -55,8 +54,7 @@ sources_smoke = [ "smoke/util_test_007.cpp", ] -sources_full = [ -] +sources_full = [] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { unittest("liteos_a_util_unittest_door") { -- GitLab