From 62430df4691ae37b5d49255c8fbef1f45fac287b Mon Sep 17 00:00:00 2001 From: chenming Date: Mon, 17 Jan 2022 16:10:25 +0800 Subject: [PATCH 1/2] gn change Signed-off-by: chenming --- interfaces/kits/js/BUILD.gn | 48 +++++++++++++++---------------------- services/BUILD.gn | 12 +--------- test/constanttest/BUILD.gn | 12 ++++------ utils/BUILD.gn | 9 ++++--- 4 files changed, 28 insertions(+), 53 deletions(-) diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 76b188e..5312a47 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -15,19 +15,6 @@ import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") -config("worksched_private_config") { - include_dirs = [ - "//utils/system/safwk/native/include", - "${worksched_native_innerkits_path}/native/include", - ] -} - -config("worksched_public_config") { - include_dirs = [ - "${worksched_root_path}/interfaces/kits/js/napi/include", - ] -} - js_declaration("workscheduler_js") { part_name = "${worksched_native_part_name}" sources = [ @@ -45,23 +32,26 @@ ohos_copy("worksched_declaration") { } ohos_shared_library("workscheduler") { - configs = [ - ":worksched_private_config", - ] + include_dirs = [ + "${worksched_native_innerkits_path}/native/include", + "${worksched_root_path}/interfaces/kits/js/napi/include", + ] - public_configs = [ ":worksched_public_config" ] + sources = [ + "${worksched_root_path}/interfaces/kits/js/napi/src/workscheduler_napi.cpp", + ] - sources = [ - "${worksched_root_path}/interfaces/kits/js/napi/src/workscheduler_napi.cpp", - ] + deps = [ + "${worksched_utils_path}:workschedutils", + ] - deps = [ - "//foundation/ace/napi:ace_napi", - "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", - "${worksched_utils_path}:workschedutils", - ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + "napi:ace_napi", + "safwk:system_ability_fwk", + ] - relative_install_dir = "module" - part_name = "${worksched_native_part_name}" - subsystem_name = "resourceschedule" -} + relative_install_dir = "module" + part_name = "${worksched_native_part_name}" + subsystem_name = "resourceschedule" +} \ No newline at end of file diff --git a/services/BUILD.gn b/services/BUILD.gn index 7a322c4..86d254c 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -13,12 +13,6 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") -config("worksched_private_config") { - include_dirs = [ - "//utils/native/base/include" - ] -} - config("worksched_public_config") { include_dirs = [ "native/include" @@ -30,14 +24,9 @@ ohos_shared_library("workschedservice") { "native/src/work_scheduler_service.cpp" ] - configs = [ - ":worksched_private_config", - ] - public_configs = [ ":worksched_public_config" ] deps = [ - "//utils/native/base:utils", "${worksched_utils_path}:workschedutils", ] @@ -46,6 +35,7 @@ ohos_shared_library("workschedservice") { "ipc:ipc_core", "samgr_standard:samgr_proxy", "hiviewdfx_hilog_native:libhilog", + "utils_base:utils", ] part_name = "${worksched_native_part_name}" diff --git a/test/constanttest/BUILD.gn b/test/constanttest/BUILD.gn index 7287403..b739e56 100644 --- a/test/constanttest/BUILD.gn +++ b/test/constanttest/BUILD.gn @@ -14,12 +14,6 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") import("//build/test.gni") -config("system_test_config") { - include_dirs = [ "//third_party/json/include" ] - - configs = [] -} - module_output_path = "work_scheduler/constanttest" ohos_systemtest("WorkSchedulerConstantTest") { module_out_path = module_output_path @@ -27,7 +21,6 @@ ohos_systemtest("WorkSchedulerConstantTest") { sources = [ "constant_test.cpp" ] include_dirs = [ - "//utils/native/base/include", "${worksched_native_innerkits_path}/native/include", ] @@ -39,7 +32,10 @@ ohos_systemtest("WorkSchedulerConstantTest") { deps = [ "//third_party/googletest:gtest_main", - "//utils/native/base:utils", + ] + + external_deps = [ + "utils_base:utils", ] } diff --git a/utils/BUILD.gn b/utils/BUILD.gn index a250dc8..7883224 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -15,8 +15,7 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") config("utils_config") { include_dirs = [ - "native/include", - "//utils/native/base/include" + "native/include" ] } @@ -27,12 +26,12 @@ ohos_source_set("workschedutils") { public_configs = [ ":utils_config" ] deps = [ - "//utils/native/base:utils" ] external_deps = [ - "hiviewdfx_hilog_native:libhilog" + "hiviewdfx_hilog_native:libhilog", + "utils_base:utils", ] part_name = "${worksched_native_part_name}" -} +} \ No newline at end of file -- Gitee From 2322250b82b64198171caf0960356acdb22611d6 Mon Sep 17 00:00:00 2001 From: chenming Date: Mon, 17 Jan 2022 17:32:44 +0800 Subject: [PATCH 2/2] gn format Signed-off-by: chenming --- interfaces/kits/js/BUILD.gn | 14 ++++---------- services/BUILD.gn | 18 ++++++------------ test/constanttest/BUILD.gn | 20 ++++++-------------- utils/BUILD.gn | 12 ++++-------- 4 files changed, 20 insertions(+), 44 deletions(-) diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 5312a47..ac4f3bd 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -17,15 +17,11 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") js_declaration("workscheduler_js") { part_name = "${worksched_native_part_name}" - sources = [ - "./@ohos.workscheduler.d.ts", - ] + sources = [ "./@ohos.workscheduler.d.ts" ] } ohos_copy("worksched_declaration") { - sources = [ - "./@ohos.workscheduler.d.ts", - ] + sources = [ "./@ohos.workscheduler.d.ts" ] outputs = [ target_out_dir + "/$target_name/" ] module_source_dir = target_out_dir + "/$target_name" module_install_name = "" @@ -41,9 +37,7 @@ ohos_shared_library("workscheduler") { "${worksched_root_path}/interfaces/kits/js/napi/src/workscheduler_napi.cpp", ] - deps = [ - "${worksched_utils_path}:workschedutils", - ] + deps = [ "${worksched_utils_path}:workschedutils" ] external_deps = [ "hiviewdfx_hilog_native:libhilog", @@ -54,4 +48,4 @@ ohos_shared_library("workscheduler") { relative_install_dir = "module" part_name = "${worksched_native_part_name}" subsystem_name = "resourceschedule" -} \ No newline at end of file +} diff --git a/services/BUILD.gn b/services/BUILD.gn index 86d254c..f80d5c7 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -14,29 +14,23 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") config("worksched_public_config") { - include_dirs = [ - "native/include" - ] + include_dirs = [ "native/include" ] } ohos_shared_library("workschedservice") { - sources = [ - "native/src/work_scheduler_service.cpp" - ] + sources = [ "native/src/work_scheduler_service.cpp" ] public_configs = [ ":worksched_public_config" ] - deps = [ - "${worksched_utils_path}:workschedutils", - ] + deps = [ "${worksched_utils_path}:workschedutils" ] external_deps = [ - "safwk:system_ability_fwk", + "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", - "hiviewdfx_hilog_native:libhilog", "utils_base:utils", ] part_name = "${worksched_native_part_name}" -} \ No newline at end of file +} diff --git a/test/constanttest/BUILD.gn b/test/constanttest/BUILD.gn index b739e56..427ff52 100644 --- a/test/constanttest/BUILD.gn +++ b/test/constanttest/BUILD.gn @@ -11,8 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") import("//build/test.gni") +import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") module_output_path = "work_scheduler/constanttest" ohos_systemtest("WorkSchedulerConstantTest") { @@ -20,9 +20,7 @@ ohos_systemtest("WorkSchedulerConstantTest") { sources = [ "constant_test.cpp" ] - include_dirs = [ - "${worksched_native_innerkits_path}/native/include", - ] + include_dirs = [ "${worksched_native_innerkits_path}/native/include" ] cflags = [] @@ -30,19 +28,13 @@ ohos_systemtest("WorkSchedulerConstantTest") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "//third_party/googletest:gtest_main", - ] + deps = [ "//third_party/googletest:gtest_main" ] - external_deps = [ - "utils_base:utils", - ] + external_deps = [ "utils_base:utils" ] } group("constanttest") { testonly = true - deps = [ - ":WorkSchedulerConstantTest" - ] -} \ No newline at end of file + deps = [ ":WorkSchedulerConstantTest" ] +} diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 7883224..8cf59f6 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -14,19 +14,15 @@ import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") config("utils_config") { - include_dirs = [ - "native/include" - ] + include_dirs = [ "native/include" ] } ohos_source_set("workschedutils") { - sources = [ - ] + sources = [] public_configs = [ ":utils_config" ] - deps = [ - ] + deps = [] external_deps = [ "hiviewdfx_hilog_native:libhilog", @@ -34,4 +30,4 @@ ohos_source_set("workschedutils") { ] part_name = "${worksched_native_part_name}" -} \ No newline at end of file +} -- Gitee