diff --git a/libnymea-core/libnymea-core.pro b/libnymea-core/libnymea-core.pro index ce08818f..79e322bd 100644 --- a/libnymea-core/libnymea-core.pro +++ b/libnymea-core/libnymea-core.pro @@ -3,7 +3,7 @@ TARGET = nymea-core include(../nymea.pri) -QT += sql qml +QT += bluetooth dbus qml sql websockets INCLUDEPATH += $$top_srcdir/libnymea $$top_builddir LIBS += -L$$top_builddir/libnymea/ -lnymea -lssl -lcrypto diff --git a/libnymea/integrations/pluginmetadata.cpp b/libnymea/integrations/pluginmetadata.cpp index c5285648..e63ad508 100644 --- a/libnymea/integrations/pluginmetadata.cpp +++ b/libnymea/integrations/pluginmetadata.cpp @@ -856,8 +856,6 @@ void PluginMetadata::parse(const QJsonObject &jsonObject) } if (!hasError) { m_isValid = true; - } else { - qCWarning(dcPluginMetadata()) << "Device metadata has errors."; } } @@ -880,7 +878,6 @@ QPair PluginMetadata::loadAndVerifyUnit(const QString &unitSt // inform the plugin developer about the error in the plugin json file if (enumValue == -1) { - qCWarning(dcPluginMetadata()) << QString("\"%1\" plugin:").arg(pluginName()).toLatin1().data() << QString("Invalid unit type \"%1\" in json file.").arg(unitString).toLatin1().data(); return QPair(false, Types::UnitNone); } @@ -970,7 +967,7 @@ QPair PluginMetadata::parseParamTypes(const QJsonArray &array) if (pt.contains("inputType")) { QPair inputTypeVerification = loadAndVerifyInputType(pt.value("inputType").toString()); if (!inputTypeVerification.first) { - qCWarning(dcPluginMetadata()) << pluginName() << QString("Invalid inputType for paramType") << pt; + m_validationErrors.append("Param type \"" + paramName + "\" has invalid inputType \"" + pt.value("type").toString() + "\""); hasErrors = true; } else { paramType.setInputType(inputTypeVerification.second); @@ -981,7 +978,7 @@ QPair PluginMetadata::parseParamTypes(const QJsonArray &array) if (pt.contains("unit")) { QPair unitVerification = loadAndVerifyUnit(pt.value("unit").toString()); if (!unitVerification.first) { - qCWarning(dcPluginMetadata()) << pluginName() << QString("Invalid unit type for paramType") << pt; + m_validationErrors.append("Param type \"" + paramName + "\" has invalid unit \"" + pt.value("type").toString() + "\""); hasErrors = true; } else { paramType.setUnit(unitVerification.second); @@ -1032,7 +1029,6 @@ QPair PluginMetadata::loadAndVerifyInputType(const QStri // inform the plugin developer about the error in the plugin json file if (enumValue == -1) { - qCWarning(dcPluginMetadata()) << QString("\"%1\" plugin:").arg(pluginName()).toLatin1().data() << QString("Invalid inputType \"%1\" in json file.").arg(inputType).toLatin1().data(); return QPair(false, Types::InputTypeNone); } @@ -1046,7 +1042,9 @@ bool PluginMetadata::verifyDuplicateUuid(const QUuid &uuid) if (m_strictRun) { return false; } else { - qCWarning(dcPluginMetadata()) << "THIS PLUGIN USES DUPLICATE UUID" << uuid.toString() << "! THIS IS NOT SUPPORTED AND MAY CAUSE RUNTIME ISSUES."; + // Using regular qWarning here as I'm struggling with making the nymea debug categories work in a pic only build + // This is only used in special cirumstances and it's probably ok that one cannot filter away this warning + qWarning() << "THIS PLUGIN USES DUPLICATE UUID" << uuid.toString() << "! THIS IS NOT SUPPORTED AND MAY CAUSE RUNTIME ISSUES."; } } if (m_currentScopUuids.contains(uuid)) { diff --git a/libnymea/loggingcategories.cpp b/libnymea/loggingcategories.cpp index 45906af3..dac6a8cd 100644 --- a/libnymea/loggingcategories.cpp +++ b/libnymea/loggingcategories.cpp @@ -37,7 +37,6 @@ QStringList s_nymeaLoggingCategories; // FIXME: Those should eventually disappear from here -NYMEA_LOGGING_CATEGORY(dcPluginMetadata, "PluginMetadata") NYMEA_LOGGING_CATEGORY(dcThing, "Thing") NYMEA_LOGGING_CATEGORY(dcThingManager, "ThingManager") NYMEA_LOGGING_CATEGORY(dcSystem, "System") diff --git a/libnymea/loggingcategories.h b/libnymea/loggingcategories.h index dfb88212..aa905163 100644 --- a/libnymea/loggingcategories.h +++ b/libnymea/loggingcategories.h @@ -49,7 +49,6 @@ extern QStringList s_nymeaLoggingCategories; } \ // FIXME: Those should eventually disappear from here -Q_DECLARE_LOGGING_CATEGORY(dcPluginMetadata) Q_DECLARE_LOGGING_CATEGORY(dcThing) Q_DECLARE_LOGGING_CATEGORY(dcThingManager) Q_DECLARE_LOGGING_CATEGORY(dcSystem) diff --git a/nymea.pri b/nymea.pri index d4924a5f..c04d020a 100644 --- a/nymea.pri +++ b/nymea.pri @@ -3,8 +3,6 @@ COPYRIGHT_YEAR_TO=2020 DEFINES += COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\" -QT *= network websockets bluetooth dbus - QMAKE_CXXFLAGS *= -Werror -std=c++11 -g QMAKE_LFLAGS *= -std=c++11 diff --git a/nymea.pro b/nymea.pro index d4af5d95..cecb7ecd 100644 --- a/nymea.pro +++ b/nymea.pro @@ -17,13 +17,14 @@ QMAKE_SUBSTITUTES += version.h.in TEMPLATE=subdirs -SUBDIRS += libnymea tools -tools.depends = libnymea - -minimal { +piconly { + message("Plugininfocompiler build. Only nymea-plugininfocompiler will be built.") + SUBDIRS += tools +} else:minimal { message("Minimal build. Only libraries required to build nymea-plugins will be built.") + SUBDIRS += libnymea tools } else { - SUBDIRS += server libnymea-core plugins + SUBDIRS += libnymea server libnymea-core plugins tools libnymea-core.depends = libnymea plugins.depends = libnymea tools server.depends = libnymea libnymea-core plugins diff --git a/server/server.pro b/server/server.pro index 9ea50407..123ec738 100644 --- a/server/server.pro +++ b/server/server.pro @@ -8,7 +8,7 @@ INCLUDEPATH += ../libnymea ../libnymea-core $$top_builddir target.path = /usr/bin INSTALLS += target -QT *= sql xml websockets bluetooth dbus network +QT += sql xml websockets bluetooth dbus network LIBS += -L$$top_builddir/libnymea/ -lnymea \ -L$$top_builddir/libnymea-core -lnymea-core \ diff --git a/tests/auto/autotests.pri b/tests/auto/autotests.pri index 1b516476..6b3a86b6 100644 --- a/tests/auto/autotests.pri +++ b/tests/auto/autotests.pri @@ -1,4 +1,4 @@ -QT += testlib network sql +QT += dbus testlib network sql websockets CONFIG += testcase INCLUDEPATH += $$top_srcdir/libnymea \ diff --git a/tests/testlib/testlib.pro b/tests/testlib/testlib.pro index 8c03d502..2c27f65e 100644 --- a/tests/testlib/testlib.pro +++ b/tests/testlib/testlib.pro @@ -3,7 +3,7 @@ TARGET = nymea-testlib include(../../nymea.pri) -QT += testlib network sql +QT += testlib dbus network sql websockets INCLUDEPATH += $$top_srcdir/libnymea \ $$top_srcdir/libnymea-core diff --git a/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro b/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro index d540aa8a..e900232b 100644 --- a/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro +++ b/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro @@ -4,14 +4,52 @@ CONFIG -= app_bundle include(../../nymea.pri) INCLUDEPATH += $$top_srcdir/libnymea $$top_builddir -LIBS += -L$$top_builddir/libnymea -lnymea + +# FIXME: Rebuilding types here so that we can build the nymea-plugininfocompiler +# without having to build the entire libnymea +# Libnymea needs to be split up into 2 parts, one with full hardaremanager support +# the other with something more minimalistic that doesn't pull in Bluetooth, ZigBee, +# MQTT and whatnot. SOURCES += \ - main.cpp \ - plugininfocompiler.cpp + main.cpp \ + plugininfocompiler.cpp \ + $$top_srcdir/libnymea/integrations/pluginmetadata.cpp \ + $$top_srcdir/libnymea/integrations/thingutils.cpp \ + $$top_srcdir/libnymea/types/paramtype.cpp \ + $$top_srcdir/libnymea/types/param.cpp \ + $$top_srcdir/libnymea/types/vendor.cpp \ + $$top_srcdir/libnymea/types/thingclass.cpp \ + $$top_srcdir/libnymea/types/statetype.cpp \ + $$top_srcdir/libnymea/types/eventtype.cpp \ + $$top_srcdir/libnymea/types/actiontype.cpp \ + $$top_srcdir/libnymea/types/interface.cpp \ + $$top_srcdir/libnymea/types/interfacestatetype.cpp \ + $$top_srcdir/libnymea/types/interfaceeventtype.cpp \ + $$top_srcdir/libnymea/types/interfaceactiontype.cpp \ + $$top_srcdir/libnymea/loggingcategories.cpp \ HEADERS += \ - plugininfocompiler.h + plugininfocompiler.h \ + $$top_srcdir/libnymea/typeutils.h \ + $$top_srcdir/libnymea/integrations/pluginmetadata.h \ + $$top_srcdir/libnymea/integrations/thingutils.h \ + $$top_srcdir/libnymea/types/paramtype.h \ + $$top_srcdir/libnymea/types/param.h \ + $$top_srcdir/libnymea/types/vendor.h \ + $$top_srcdir/libnymea/types/thingclass.h \ + $$top_srcdir/libnymea/types/statetype.h \ + $$top_srcdir/libnymea/types/eventtype.h \ + $$top_srcdir/libnymea/types/actiontype.h \ + $$top_srcdir/libnymea/types/interface.h \ + $$top_srcdir/libnymea/types/interfacestatetype.h \ + $$top_srcdir/libnymea/types/interfaceeventtype.h \ + $$top_srcdir/libnymea/types/interfaceactiontype.h \ + $$top_srcdir/libnymea/loggingcategories.h \ + +RESOURCES += \ + $$top_srcdir/libnymea/interfaces/interfaces.qrc + target.path = $$[QT_INSTALL_PREFIX]/bin INSTALLS += target