build: mv linglong/api/v1/dbus/{interfaces,}

Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
black-desk 2023-08-14 18:20:59 +08:00
parent 4a2e28aedd
commit 5ec0ebf3fc
No known key found for this signature in database
GPG Key ID: 761EE6143999AE8B
27 changed files with 172 additions and 160 deletions

View File

@ -3,7 +3,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
add_executable(ll-cli main.cpp)
target_link_libraries(
ll-cli
PRIVATE linglong
)
target_link_libraries(ll-cli PRIVATE linglong)

View File

@ -4,8 +4,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "linglong/api/v1/dbus/interfaces/app_manager.h"
#include "linglong/api/v1/dbus/interfaces/package_manager.h"
#include "linglong/api/v1/dbus/app_manager.h"
#include "linglong/api/v1/dbus/package_manager.h"
#include "linglong/package/package.h"
#include "linglong/package_manager/package_manager.h"
#include "linglong/service/app_manager.h"

View File

@ -7,6 +7,12 @@ set(LINGLONG_FILESET_BASEDIRS ${PROJECT_SOURCE_DIR}/src
)
function(linglong_add_library target)
string(
REPLACE "_"
""
target
${target}
)
set(LINGLONG_LIB_NAME ${LINGLONG_LIB_PREFIX}${target})
set(LINGLONG_LIB_PREFIX ${LINGLONG_LIB_NAME}_)
@ -40,7 +46,12 @@ function(linglong_add_library target)
foreach(LINGLONG_ADD_LIBRARY_SUBDIR ${LINGLONG_ADD_LIBRARY_PARSED_SUBDIRS})
add_subdirectory(${LINGLONG_ADD_LIBRARY_SUBDIR})
string(REPLACE "_" "" LINGLONG_ADD_LIBRARY_SUBDIR ${LINGLONG_ADD_LIBRARY_SUBDIR})
string(
REPLACE "_"
""
LINGLONG_ADD_LIBRARY_SUBDIR
${LINGLONG_ADD_LIBRARY_SUBDIR}
)
target_link_libraries(
${LINGLONG_LIB_NAME}
${LINGLONG_ADD_LIBRARY_SUBDIR_LINKTYPE}

View File

@ -43,7 +43,7 @@ linglong_add_dbus_adaptor(
linglong_add_dbus_adaptor(
linglong_JobManager_adaptor
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.JobManager.xml
linglong/package_manager/job_manager.h
linglong/job_manager/job_manager.h
JobManager
JobManagerAdaptor
)
@ -51,7 +51,7 @@ linglong_add_dbus_adaptor(
linglong_add_dbus_adaptor(
linglong_Job_adaptor
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.Job.xml
linglong/package_manager/job.h
linglong/job_manager/job.h
Job
JobAdaptor
)

View File

@ -10,6 +10,7 @@ linglong_add_library(
dbus_ipc
package
repo
job_manager
runtime
util
builder

View File

@ -1,5 +1,67 @@
linglong_add_library(
dbus
SUBDIRS
interfaces
SOURCES
app_manager.cpp
filesystem_helper.cpp
package_manager_helper.cpp
HEADERS
app_manager.h
filesystem_helper.h
package_manager_helper.h
DEPENDENCIES
linglong_dbusipc
linglong_api_v1_types
)
target_include_directories(
${LINGLONG_LIB_PREFIX}dbus PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
function(
linglong_add_dbus_interface
xml
basename
)
set_source_files_properties(
${xml}
NO_NAMESPACE
ON
)
set(INTERFACE_SOURCES)
qt5_add_dbus_interface(
INTERFACE_SOURCES
${xml}
${basename}
)
target_sources(${LINGLONG_LIB_PREFIX}dbus PRIVATE ${INTERFACE_SOURCES})
endfunction()
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManagerHelper.xml
gen_org_deepin_linglong_packagemanagerhelper
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.FilesystemHelper.xml
gen_org_deepin_linglong_filesystemhelper
)
set_source_files_properties(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.AppManager.xml
PROPERTIES INCLUDE linglong/dbus_ipc/workaround.h
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.AppManager.xml
gen_org_deepin_linglong_appmanager
)
set_source_files_properties(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManager.xml
PROPERTIES INCLUDE linglong/dbus_ipc/workaround.h
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManager.xml
gen_org_deepin_linglong_packagemanager
)

View File

@ -4,4 +4,4 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "linglong/api/v1/dbus/interfaces/app_manager.h"
#include "linglong/api/v1/dbus/app_manager.h"

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_APPMANAGER_H_
#define LINGLONG_AIP_V1_DBUS_APPMANAGER_H_
#include "linglong/api/v1/dbus/gen_org_deepin_linglong_appmanager.h"
namespace linglong::api::v1::dbus {
using AppManagerHelper = OrgDeepinLinglongAppManager1Interface;
}
#endif

View File

@ -4,4 +4,4 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "linglong/api/v1/dbus/interfaces/filesystem_helper.h"
#include "linglong/api/v1/dbus/filesystem_helper.h"

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_FILESYSTEMHELPER_H_
#define LINGLONG_AIP_V1_DBUS_FILESYSTEMHELPER_H_
#include "linglong/api/v1/dbus/gen_org_deepin_linglong_filesystemhelper.h"
namespace linglong::api::v1::dbus {
using PackageManagerHelper = OrgDeepinLinglongFilesystemHelper1Interface;
}
#endif

View File

@ -1,67 +0,0 @@
linglong_add_library(
interfaces
SOURCES
app_manager.cpp
filesystem_helper.cpp
package_manager_helper.cpp
HEADERS
app_manager.h
filesystem_helper.h
package_manager_helper.h
DEPENDENCIES
linglong_dbusipc
linglong_api_v1_types
)
target_include_directories(
${LINGLONG_LIB_PREFIX}interfaces PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
function(
linglong_add_dbus_interface
xml
basename
)
set_source_files_properties(
${xml}
NO_NAMESPACE
ON
)
set(INTERFACE_SOURCES)
qt5_add_dbus_interface(
INTERFACE_SOURCES
${xml}
${basename}
)
target_sources(${LINGLONG_LIB_PREFIX}interfaces PRIVATE ${INTERFACE_SOURCES})
endfunction()
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManagerHelper.xml
gen_org_deepin_linglong_packagemanagerhelper
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.FilesystemHelper.xml
gen_org_deepin_linglong_filesystemhelper
)
set_source_files_properties(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.AppManager.xml
PROPERTIES INCLUDE linglong/dbus_ipc/workaround.h
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.AppManager.xml
gen_org_deepin_linglong_appmanager
)
set_source_files_properties(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManager.xml
PROPERTIES INCLUDE linglong/dbus_ipc/workaround.h
)
linglong_add_dbus_interface(
${PROJECT_SOURCE_DIR}/api/dbus/org.deepin.linglong.PackageManager.xml
gen_org_deepin_linglong_packagemanager
)

View File

@ -1,16 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_INTERFACES_APPMANAGER_H_
#define LINGLONG_AIP_V1_DBUS_INTERFACES_APPMANAGER_H_
#include "linglong/api/v1/dbus/interfaces/gen_org_deepin_linglong_appmanager.h"
namespace linglong::api::v1::dbus::interfaces {
using AppManagerHelper = OrgDeepinLinglongAppManager1Interface;
}
#endif

View File

@ -1,16 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_INTERFACES_FILESYSTEMHELPER_H_
#define LINGLONG_AIP_V1_DBUS_INTERFACES_FILESYSTEMHELPER_H_
#include "linglong/api/v1/dbus/interfaces/gen_org_deepin_linglong_filesystemhelper.h"
namespace linglong::api::v1::dbus::interfaces {
using PackageManagerHelper = OrgDeepinLinglongFilesystemHelper1Interface;
}
#endif

View File

@ -1,16 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_INTERFACES_PACKAGEMANAGER_H_
#define LINGLONG_AIP_V1_DBUS_INTERFACES_PACKAGEMANAGER_H_
#include "linglong/api/v1/dbus/interfaces/gen_org_deepin_linglong_packagemanager.h"
namespace linglong::api::v1::dbus::interfaces {
using PackageManagerHelper = OrgDeepinLinglongPackageManager1Interface;
}
#endif

View File

@ -1,16 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_INTERFACES_PACKAGEMANAGERHELPER_H_
#define LINGLONG_AIP_V1_DBUS_INTERFACES_PACKAGEMANAGERHELPER_H_
#include "linglong/api/v1/dbus/interfaces/gen_org_deepin_linglong_packagemanagerhelper.h"
namespace linglong::api::v1::dbus::interfaces {
using PackageManagerHelper = OrgDeepinLinglongPackageManagerHelper1Interface;
}
#endif

View File

@ -4,4 +4,4 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "linglong/api/v1/dbus/interfaces/package_manager.h"
#include "linglong/api/v1/dbus/package_manager.h"

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_PACKAGEMANAGER_H_
#define LINGLONG_AIP_V1_DBUS_PACKAGEMANAGER_H_
#include "linglong/api/v1/dbus/gen_org_deepin_linglong_packagemanager.h"
namespace linglong::api::v1::dbus {
using PackageManagerHelper = OrgDeepinLinglongPackageManager1Interface;
}
#endif

View File

@ -4,4 +4,4 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "linglong/api/v1/dbus/interfaces/package_manager_helper.h"
#include "linglong/api/v1/dbus/package_manager_helper.h"

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef LINGLONG_AIP_V1_DBUS_PACKAGEMANAGERHELPER_H_
#define LINGLONG_AIP_V1_DBUS_PACKAGEMANAGERHELPER_H_
#include "linglong/api/v1/dbus/gen_org_deepin_linglong_packagemanagerhelper.h"
namespace linglong::api::v1::dbus {
using PackageManagerHelper = OrgDeepinLinglongPackageManagerHelper1Interface;
}
#endif

View File

@ -0,0 +1,14 @@
linglong_add_library(
jobmanager
SOURCES
job.cpp
job_manager.cpp
HEADERS
job.h
job_manager.h
DEPENDENCIES
Qt::Core
linglong_repo
linglong_JobManager_adaptor
linglong_Job_adaptor
)

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "job.h"
#include "linglong/job_manager/job.h"
class JobPrivate
{

View File

@ -4,9 +4,9 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "job_manager.h"
#include "linglong/job_manager/job_manager.h"
#include "job.h"
#include "linglong/job_manager/job.h"
#include "linglong/repo/ostree_repohelper.h"
#include <QDBusConnection>

View File

@ -5,21 +5,15 @@
linglong_add_library(
packagemanager
SOURCES
job.cpp
job_manager.cpp
package_manager.cpp
HEADERS
job.h
job_manager.h
package_manager.h
package_manager_p.h
DEPENDENCIES
linglong_runtime
linglong_util
linglong_repo
linglong_jobmanager
linglong_dbusipc
linglong_package
linglong_PackageManager_adaptor
linglong_JobManager_adaptor
linglong_Job_adaptor
)

View File

@ -7,7 +7,7 @@
#ifndef LINGLONG_SRC_PACKAGE_MANAGER_PACKAGE_MANAGER_P_H_
#define LINGLONG_SRC_PACKAGE_MANAGER_PACKAGE_MANAGER_P_H_
#include "linglong/api/v1/dbus/interfaces/package_manager_helper.h"
#include "linglong/api/v1/dbus/package_manager_helper.h"
#include "linglong/dbus_ipc/package_manager_param.h"
#include "linglong/dbus_ipc/param_option.h"
#include "linglong/dbus_ipc/reply.h"
@ -209,7 +209,7 @@ private:
bool noDBusMode = false;
api::v1::dbus::interfaces::PackageManagerHelper packageManagerHelperInterface;
api::v1::dbus::PackageManagerHelper packageManagerHelperInterface;
public:
PackageManager *const q_ptr;

View File

@ -6,7 +6,7 @@
#include "erofs.h"
#include "linglong/api/v1/dbus/interfaces/filesystem_helper.h"
#include "linglong/api/v1/dbus/filesystem_helper.h"
#include "linglong/dbus_ipc/dbus_system_helper_common.h"
#include "runner.h"
@ -20,7 +20,7 @@ util::Error mount(const QString &src, const QString &mountPoint)
return util::Exec("erofsfuse", { src, mountPoint });
}
api::v1::dbus::interfaces::PackageManagerHelper ifc(SystemHelperDBusServiceName,
api::v1::dbus::PackageManagerHelper ifc(SystemHelperDBusServiceName,
FilesystemHelperDBusPath,
QDBusConnection::systemBus());