chore: Avoiding binary conflicts with existing AM
Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
parent
3df26e4fc2
commit
0896f845a6
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(dde-session-shell
|
project(dde-application-manager
|
||||||
VERSION 0.1.0
|
VERSION 0.1.0
|
||||||
DESCRIPTION "deepin applicaion manager"
|
DESCRIPTION "deepin applicaion manager"
|
||||||
HOMEPAGE_URL "https://github.com/linuxdeepin/dde-application-manager"
|
HOMEPAGE_URL "https://github.com/linuxdeepin/dde-application-manager"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
set(BIN_NAME dde-application-manager)
|
set(BIN_NAME dde-application-manager-reborn)
|
||||||
|
|
||||||
add_executable(${BIN_NAME} main.cpp utils.cpp)
|
add_executable(${BIN_NAME} main.cpp utils.cpp)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ bool registerObjectToDBus(QObject *o, const QString &path, const QString &interf
|
|||||||
if (!con.registerObject(path, interface, o, QDBusConnection::RegisterOption::ExportAdaptors)) {
|
if (!con.registerObject(path, interface, o, QDBusConnection::RegisterOption::ExportAdaptors)) {
|
||||||
qCritical() << "register object failed:" << path << interface << con.lastError();
|
qCritical() << "register object failed:" << path << interface << con.lastError();
|
||||||
} else {
|
} else {
|
||||||
qInfo() << "register object:" << path << interface;
|
qDebug() << "register object:" << path << interface;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -19,5 +19,5 @@ void unregisterObjectFromDBus(const QString &path)
|
|||||||
{
|
{
|
||||||
auto &con = ApplicationManager1DBus::instance().globalServerBus();
|
auto &con = ApplicationManager1DBus::instance().globalServerBus();
|
||||||
con.unregisterObject(path);
|
con.unregisterObject(path);
|
||||||
qInfo() << "unregister object:" << path;
|
qDebug() << "unregister object:" << path;
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,13 @@ include(GNUInstallDirs)
|
|||||||
|
|
||||||
# # systemd service
|
# # systemd service
|
||||||
configure_file(
|
configure_file(
|
||||||
systemd/user/org.deepin.dde.ApplicationManager.service.in
|
systemd/user/org.deepin.dde.ApplicationManager1.service.in
|
||||||
systemd/user/org.deepin.dde.ApplicationManager.service
|
systemd/user/org.deepin.dde.ApplicationManager1.service
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SYSTEMD_USER_FILE
|
set(SYSTEMD_USER_FILE
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/systemd/user/org.deepin.dde.ApplicationManager.service
|
${CMAKE_CURRENT_BINARY_DIR}/systemd/user/org.deepin.dde.ApplicationManager1.service
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES ${SYSTEMD_USER_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/)
|
install(FILES ${SYSTEMD_USER_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/)
|
||||||
|
@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
[D-BUS Service]
|
[D-BUS Service]
|
||||||
Name=org.deepin.dde.ApplicationManager1
|
Name=org.deepin.dde.ApplicationManager1
|
||||||
Exec=@CMAKE_INSTALL_FULL_BINDIR@/dde-application-manager
|
Exec=@CMAKE_INSTALL_FULL_BINDIR@/dde-application-manager-reborn
|
||||||
SystemdService=org.deepin.dde.ApplicationManager1.service
|
SystemdService=org.deepin.dde.ApplicationManager1.service
|
||||||
|
@ -8,5 +8,6 @@ Description=Deepin Application Manager
|
|||||||
[Service]
|
[Service]
|
||||||
Type=dbus
|
Type=dbus
|
||||||
BusName=org.deepin.dde.ApplicationManager1
|
BusName=org.deepin.dde.ApplicationManager1
|
||||||
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/dde-application-manager
|
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/dde-application-manager-reborn
|
||||||
Restart=always
|
Restart=always
|
||||||
|
Environment=QT_LOGGING_RULES="*.debug=false"
|
@ -27,6 +27,9 @@ class TestApplicationManager : public testing::Test
|
|||||||
public:
|
public:
|
||||||
static void SetUpTestCase()
|
static void SetUpTestCase()
|
||||||
{
|
{
|
||||||
|
if (!QDBusConnection::sessionBus().isConnected()) {
|
||||||
|
GTEST_SKIP() << "skip for now.";
|
||||||
|
}
|
||||||
auto &bus = ApplicationManager1DBus::instance();
|
auto &bus = ApplicationManager1DBus::instance();
|
||||||
bus.initGlobalServerBus(DBusType::Session);
|
bus.initGlobalServerBus(DBusType::Session);
|
||||||
bus.setDestBus();
|
bus.setDestBus();
|
||||||
@ -51,6 +54,9 @@ public:
|
|||||||
|
|
||||||
TEST_F(TestApplicationManager, identifyService)
|
TEST_F(TestApplicationManager, identifyService)
|
||||||
{
|
{
|
||||||
|
if (m_am == nullptr) {
|
||||||
|
GTEST_SKIP() << "skip for now...";
|
||||||
|
}
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
// for service unit
|
// for service unit
|
||||||
auto workingDir = QDir::cleanPath(QDir::current().absolutePath() + QDir::separator() + ".." + QDir::separator() + "tools");
|
auto workingDir = QDir::cleanPath(QDir::current().absolutePath() + QDir::separator() + ".." + QDir::separator() + "tools");
|
||||||
@ -73,7 +79,7 @@ TEST_F(TestApplicationManager, identifyService)
|
|||||||
GTEST_SKIP() << "invoke systemd-run failed.";
|
GTEST_SKIP() << "invoke systemd-run failed.";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(100ms);
|
std::this_thread::sleep_for(500ms);
|
||||||
|
|
||||||
auto success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
|
auto success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
|
||||||
EXPECT_TRUE(success);
|
EXPECT_TRUE(success);
|
||||||
@ -113,7 +119,7 @@ TEST_F(TestApplicationManager, identifyService)
|
|||||||
{"Scope"}},
|
{"Scope"}},
|
||||||
workingDir));
|
workingDir));
|
||||||
|
|
||||||
std::this_thread::sleep_for(100ms);
|
std::this_thread::sleep_for(500ms);
|
||||||
|
|
||||||
success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
|
success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
|
||||||
EXPECT_TRUE(success);
|
EXPECT_TRUE(success);
|
||||||
|
Loading…
Reference in New Issue
Block a user