diff --git a/BUILD.gn b/BUILD.gn index cc3a1e8ce045f047afa83ee05e05563989fe1eca..d0e4d285e6305573c2ec2e587a4a91c2c4dc434f 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -17,7 +17,8 @@ import("//build/ohos.gni") config("appspawn_config") { visibility = [ ":*" ] include_dirs = [ - "include", + "src/include", + "interfaces/innerkits/include", "//utils/native/base/include", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/appmgr", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", @@ -46,7 +47,7 @@ ohos_executable("appspawn") { part_name = "${part_name}" } -ohos_shared_library("appspawn_server") { +ohos_static_library("appspawn_server") { sources = [ "${appspawn_path}/src/appspawn_msg_peer.cpp", "${appspawn_path}/src/appspawn_server.cpp", @@ -69,19 +70,6 @@ ohos_shared_library("appspawn_server") { part_name = "${part_name}" } -ohos_shared_library("appspawn_socket_client") { - sources = [ - "${appspawn_path}/src/socket/appspawn_socket.cpp", - "${appspawn_path}/src/socket/client_socket.cpp", - ] - configs = [ ":appspawn_config" ] - deps = [ "//utils/native/base:utils" ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] - - subsystem_name = "${subsystem_name}" - part_name = "${part_name}" -} - ohos_prebuilt_etc("appspawn.rc") { if (use_musl) { source = "appspawn.cfg" diff --git a/appspawn.gni b/appspawn.gni index 0fdd4880a0f84e27d0c83d8ef2908d614243a4ae..f5be4ce05599bff8f6d8c0c0edf5e47a896c08ed 100644 --- a/appspawn.gni +++ b/appspawn.gni @@ -17,5 +17,5 @@ aafwk_path = "//foundation/aafwk/standard" communication_path = "//foundation/communication/ipc" distributedschedule_path = "//foundation/distributedschedule/dmsfwk" subsystem_name = "startup" -part_name = "startup_l2" +part_name = "appspawn" module_output_path = "${part_name}/appspawn_l2" diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..8e7b6ebd222c908af7b35b79e33ff2cf3dfaed8a --- /dev/null +++ b/interfaces/innerkits/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//base/startup/appspawn_standard/appspawn.gni") +import("//build/ohos.gni") + +config("exported_header_files") { + visibility = [ ":*" ] + include_dirs = [ "include/" ] +} + +ohos_static_library("appspawn_socket_client") { + sources = [ + "${appspawn_path}/src/socket/appspawn_socket.cpp", + "${appspawn_path}/src/socket/client_socket.cpp", + ] + include_dirs = [ "${appspawn_path}/include" ] + public_configs = [ ":exported_header_files" ] + deps = [ "//utils/native/base:utils" ] + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + + subsystem_name = "${subsystem_name}" + part_name = "${part_name}" +} diff --git a/include/appspawn_socket.h b/interfaces/innerkits/include/appspawn_socket.h similarity index 100% rename from include/appspawn_socket.h rename to interfaces/innerkits/include/appspawn_socket.h diff --git a/include/client_socket.h b/interfaces/innerkits/include/client_socket.h similarity index 100% rename from include/client_socket.h rename to interfaces/innerkits/include/client_socket.h diff --git a/ohos.build b/ohos.build index 4c373889e8f46b9bf93fa2581b0d16b2cb28c984..32e33bfebb69a0b0ed15c3b380df0b4954f88c96 100644 --- a/ohos.build +++ b/ohos.build @@ -1,33 +1,27 @@ { "subsystem": "startup", "parts": { - "startup_l2": { + "appspawn": { "module_list": [ - "//base/startup/syspara_lite:appspawn_group", - "//base/startup/syspara_lite:syspara_group" + "//base/startup/appspawn_standard:appspawn", + "//base/startup/appspawn_standard:appspawn.rc", + "//base/startup/appspawn_standard:appspawn_server", + "//base/startup/appspawn_standard/interfaces/innerkits:appspawn_socket_client" ], - "inner_kits": [ - { - "header": { - "header_files": [ - "parameter.h" - ], - "header_base": "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include/" - }, - "name": "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara" + "inner_kits": [{ + "header": { + "header_files": [ + "appspawn_socket.h", + "client_socket.h" + ], + "header_base": "//base/startup/appspawn_standard/interfaces/innerkits/include/" }, - { - "header": { - "header_files": [ - "parameter.h" - ], - "header_base": "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include/" - }, - "name": "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara_watchagent" - } + "name": "//base/startup/appspawn_standard/interfaces/innerkits:appspawn_socket_client" + } ], "test_list": [ - "//base/startup/syspara_lite:appspawn_test" + "//base/startup/appspawn_standard/test:moduletest", + "//base/startup/appspawn_standard/test:unittest" ] } } diff --git a/include/appspawn_msg_peer.h b/src/include/appspawn_msg_peer.h similarity index 90% rename from include/appspawn_msg_peer.h rename to src/include/appspawn_msg_peer.h index 83b04c11988549b6688f5e0e24252abc5ceeb675..0aa10c1999737cfaadcc2e180e890e8f6074e0be 100644 --- a/include/appspawn_msg_peer.h +++ b/src/include/appspawn_msg_peer.h @@ -52,8 +52,8 @@ public: ClientSocket::AppProperty *GetMsg() const; /** - * Returns the PID of the application process in the response sent to the AMS service after AppSpawn forks the - * application process. + * Returns the PID of the application process in the response sent to the ability manager service + * after AppSpawn forks the application process. * * @param pid Indicates the PID of the application process. */ @@ -65,7 +65,7 @@ public: int MsgPeer(); /** - * Gets the connection file description used by the AMS service to connect to AppSpawn. + * Gets the connection file description used by the ability manager service to connect to AppSpawn. */ int GetConnectFd() const; diff --git a/include/appspawn_server.h b/src/include/appspawn_server.h similarity index 97% rename from include/appspawn_server.h rename to src/include/appspawn_server.h index 281eb5a3535e00e6162bee753ba5ed5470ce59b4..8ec6190925d897d93f5b51a65a0151b358933617 100644 --- a/include/appspawn_server.h +++ b/src/include/appspawn_server.h @@ -48,7 +48,7 @@ public: DISALLOW_COPY_AND_MOVE(AppSpawnServer); /** - * Provides the AppSpawn core function for the server to receive messages from AMS service. + * Provides the AppSpawn core function for the server to receive messages from ability manager service. * * @param longProcName Indicates the long process name. * @param longProcNameLen Indicates the length of long process name. @@ -92,7 +92,7 @@ private: * * @param longProcName Indicates the length of long process name. * @param longProcNameLen Indicates the long process name. - * @param processName Indicates the process name from the AMS service. + * @param processName Indicates the process name from the ability manager service. * @param len Indicates the size of processName. */ int32_t SetProcessName(char *longProcName, int64_t longProcNameLen, const char *processName, int32_t len); diff --git a/include/server_socket.h b/src/include/server_socket.h similarity index 100% rename from include/server_socket.h rename to src/include/server_socket.h diff --git a/test/BUILD.gn b/test/BUILD.gn index 9ee47cd3a0731c6247f7a81d762588992ac6fc23..34a84a882c98340c00afd36d177933e7291d133a 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -39,7 +39,8 @@ config("appspawn_test_config") { include_dirs = [ "${appspawn_path}/test/mock/include", - "${appspawn_path}/include", + "${appspawn_path}/src/include", + "${appspawn_path}/interfaces/innerkits/include", ] } diff --git a/test/moduletest/BUILD.gn b/test/moduletest/BUILD.gn index 6a8bd078ca4114f0cfed122b530d4d49de3e75ee..61100c5944bb98f9c520ba59b4569f84cccb4b67 100644 --- a/test/moduletest/BUILD.gn +++ b/test/moduletest/BUILD.gn @@ -34,7 +34,7 @@ ohos_moduletest("AppSpawnModuleTest") { deps = [ "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", "${appexecfwk_path}/services/appmgr:libams", - "${appspawn_path}:appspawn_socket_client", + "${appspawn_path}/interfaces/innerkits:appspawn_socket_client", "//third_party/googletest:gtest_main", "//utils/native/base:utils", ]