Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
feat: Added intg lib dependency information
Browse files Browse the repository at this point in the history
The file dependencies.cfg contains the required version of the
integrations.library as a Git branch or tag name.

Part of YIO-Remote/remote-software#424
  • Loading branch information
zehnm committed Apr 13, 2020
1 parent f95f967 commit b033df0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
6 changes: 6 additions & 0 deletions dependencies.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Required dependencies of this project
# Each line specifies one dependency: <name><separator><version>
# name: dependency name
# separator: colon + optional white space
# version: git branch or tag
integrations.library: v0.2.0
18 changes: 12 additions & 6 deletions openhab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ isEmpty(INTG_LIB_PATH) {
error( "Cannot find the yio-plugin-lib.pri file!" )
}

# verify integrations.library version
unix {
INTG_LIB_VERSION = $$system(cat $$PWD/dependencies.cfg | awk '/^integrations.library:/$$system_quote("{print $2}")')
INTG_GIT_VERSION = "$$system(cd $$INTG_LIB_PATH && git describe --match "v[0-9]*" --tags HEAD --always)"
message("Required integrations.library version: $$INTG_LIB_VERSION Local version: $$INTG_GIT_VERSION")
# this is a simple check but qmake only provides limited tests and 'versionAtLeast' doesn't work with 'v' prefix.
!contains(INTG_GIT_VERSION, $$re_escape($${INTG_LIB_VERSION}).*) {
error("Invalid integrations.library version: \"$$INTG_GIT_VERSION\". Please check out required version \"$$INTG_LIB_VERSION\"")
}
}

QMAKE_SUBSTITUTES += openhab.json.in version.txt.in
# output path must be included for the output file from QMAKE_SUBSTITUTES
INCLUDEPATH += $$OUT_PWD
Expand All @@ -53,13 +64,8 @@ MOC_DIR = $$PWD/build/$$DESTINATION_PATH/moc
RCC_DIR = $$PWD/build/$$DESTINATION_PATH/qrc
UI_DIR = $$PWD/build/$$DESTINATION_PATH/ui

# install
unix {
target.path = /usr/lib
INSTALLS += target
}

DISTFILES += \
dependencies.cfg \
openhab.json.in \
version.txt.in \
README.md

0 comments on commit b033df0

Please sign in to comment.