diff --git a/debian/man/guh-generateplugininfo.1 b/debian/man/guh-generateplugininfo.1 index be974fd2..c60664b8 100644 --- a/debian/man/guh-generateplugininfo.1 +++ b/debian/man/guh-generateplugininfo.1 @@ -1,6 +1,6 @@ .\" Manpage for guh-generateplugininfo. .\" Contact simon.stuerz@guh.io to correct errors or typos. -.TH man 1 "September 2016" "1.0" "guh-generateplugininfo man page" +.TH man 1 "March 2017" "1.0.1" "guh-generateplugininfo man page" .SH NAME guh-generateplugininfo \- A precompiler for building guh plugins. .SH SYNOPSIS @@ -18,6 +18,9 @@ Displays this help. \fB\-v\fR, \fB\-\-version\fR Displays version information. .TP +\fB\-f\fR, \fB\-\-filetype\fR, \fB{e, i}\fR +The file type to generate: e = extern infofile, i = infofile. +.TP \fB\-j\fR, \fB\-\-jsonfile\fR, \fB\\fR The JSON input file name with the plugin description. .TP @@ -42,7 +45,7 @@ How to report bugs: .SH AUTHOR Written by Simon Stürz .SH COPYRIGHT -Copyright \(co 2014-2016 guh GmbH. +Copyright \(co 2014-2017 guh GmbH. .br License GPLv2: GNU GPL version 2 . diff --git a/debian/man/guhd.1 b/debian/man/guhd.1 index 1604efaf..eddbfbaa 100644 --- a/debian/man/guhd.1 +++ b/debian/man/guhd.1 @@ -1,6 +1,6 @@ .\" Manpage for guhd. .\" Contact simon.stuerz@guh.io to correct errors or typos. -.TH man 1 "June 2016" "1.7" "guhd man page" +.TH man 1 "March 2017" "1.8" "guhd man page" .SH NAME guhd \- An open source IoT (Internet of Things) server .SH SYNOPSIS @@ -106,7 +106,7 @@ How to report bugs: .SH AUTHOR Written by Simon Stürz and Michael Zanetti .SH COPYRIGHT -Copyright \(co 2014-2016 guh GmbH. +Copyright \(co 2014-2017 guh GmbH. .br License GPLv2: GNU GPL version 2 . diff --git a/plugins/deviceplugins/mock/devicepluginmock.cpp b/plugins/deviceplugins/mock/devicepluginmock.cpp index 3a63f0cf..a7119873 100644 --- a/plugins/deviceplugins/mock/devicepluginmock.cpp +++ b/plugins/deviceplugins/mock/devicepluginmock.cpp @@ -256,7 +256,7 @@ DeviceManager::DeviceError DevicePluginMock::executeAction(Device *device, const device->setStateValue(doubleStateTypeId, action.param(doubleStateParamTypeId).value().toDouble()); return DeviceManager::DeviceErrorNoError; } else if (action.actionTypeId() == boolActionTypeId) { - device->setStateValue(boolStateTypeId, action.param(boolStateParamTypeId).value().toBool()); + device->setStateValue(boolValueStateTypeId, action.param(boolValueStateParamTypeId).value().toBool()); return DeviceManager::DeviceErrorNoError; } else if (action.actionTypeId() == timeoutActionTypeId) { return DeviceManager::DeviceErrorAsync; diff --git a/plugins/deviceplugins/mock/devicepluginmock.json b/plugins/deviceplugins/mock/devicepluginmock.json index 57fe9e8a..a8f1fa61 100644 --- a/plugins/deviceplugins/mock/devicepluginmock.json +++ b/plugins/deviceplugins/mock/devicepluginmock.json @@ -91,7 +91,7 @@ }, { "id": "9dd6a97c-dfd1-43dc-acbd-367932742310", - "idName": "bool", + "idName": "boolValue", "name": "Dummy bool state", "eventTypeName": "Dummy bool state changed", "index": 1, @@ -223,7 +223,7 @@ }, { "id": "9dd6a97c-dfd1-43dc-acbd-367932742310", - "idName": "bool", + "idName": "boolValue", "name": "Dummy bool state", "eventTypeName": "Dummy bool state changed", "index": 1, diff --git a/plugins/deviceplugins/mock/translations/de_DE.ts b/plugins/deviceplugins/mock/translations/de_DE.ts index bea45b03..86350719 100644 --- a/plugins/deviceplugins/mock/translations/de_DE.ts +++ b/plugins/deviceplugins/mock/translations/de_DE.ts @@ -4,7 +4,7 @@ DevicePluginMock - + Display pin!! The pin is 243681 Pin anzeigen!! Der pin lautet 243581 @@ -12,230 +12,230 @@ MockDevice - + guh The name of the vendor (2062d64d-3232-433c-88bc-0d33c0ba2ba6) guh - + Mock Device The name of the DeviceClass (753f0d32-0468-4d08-82ed-1964aab03298) Mock Gerät - + http port The name of the paramType (d4f06047-125e-4479-9810-b54c189917f5) of Mock Device HTTP Port - + Mock Action 3 (async) The name of the ActionType fbae06d3-7666-483e-a39e-ec50fe89054e of deviceClass Mock Device Mock Aktion 3 (async) - + Mock Action 4 (broken) The name of the ActionType df3cf33d-26d5-4577-9132-9823bd33fad0 of deviceClass Mock Device Mock Aktion 4 (kaputt) - + Mock Action 5 (async, broken) The name of the ActionType bfe89a1d-3497-4121-8318-e77c37537219 of deviceClass Mock Device Mock Aktion 5 (async, kaputt) - + Mock Device (Auto created) The name of the DeviceClass (ab4257b3-7548-47ee-9bd4-7dc3004fd197) Mock Gerät (Auto erstellt) - + Mock Device (Push Button) The name of the DeviceClass (9e03144c-e436-4eea-82d9-ccb33ef778db) Mock Gerät (Drückknopf) - + Wait 3 second before you continue, the push button will be pressed automatically. The pairing info of deviceClass Mock Device (Push Button) Warte 3 Sekunden bevor du fortfährst, the Knopf wird automatisch gerückt. - + configParamInt The name of the paramType (e1f72121-a426-45e2-b475-8262b5cdf103) of Mock Devices configParamInt - + configParamBool The name of the paramType (c75723b6-ea4f-4982-9751-6c5e39c88145) of Mock Devices configParamBool - + async The name of the paramType (f2977061-4dd0-4ef5-85aa-3b7134743be3) of Mock Device async - + broken The name of the paramType (ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4) of Mock Device kaputt - + resultCount The name of the paramType (d222adb4-2f9c-4c3f-8655-76400d0fb6ce) of Mock Device Resultat Anzahl - + Dummy int state changed The name of the autocreated EventType (80baec19-54de-4948-ac46-31eabfaceb83) Int Zustand verändert - + Dummy int state The name of the ParamType of StateType (80baec19-54de-4948-ac46-31eabfaceb83) of DeviceClass Mock Device Dummy Int Zustand - + Dummy bool state changed The name of the autocreated EventType (9dd6a97c-dfd1-43dc-acbd-367932742310) Bool Zustand verändert - + Dummy bool state The name of the ParamType of StateType (9dd6a97c-dfd1-43dc-acbd-367932742310) of DeviceClass Mock Device Dummy Bool Zustand - + Mock Action 1 (with params) The name of the ActionType dea0f4e1-65e3-4981-8eaa-2701c53a9185 of deviceClass Mock Device Mock Aktion 1 (Mit Parametern) - + mockActionParam1 The name of the paramType (a2d3a256-a551-4712-a65b-ecd5a436a1cb) of Mock Device mockActionParam1 - + mockActionParam2 The name of the paramType (304a4899-18be-4e3b-94f4-d03be52f3233) of Mock Device mockActionParam2 - + Mock Action 2 (without params) The name of the ActionType defd3ed6-1a0d-400b-8879-a0202cf39935 of deviceClass Mock Device Mock Aktion (ohne Parameter - + mockParamInt The name of the paramType (0550e16d-60b9-4ba5-83f4-4d3cee656121) of Mock Device mockParamInt - + Mock Event 1 The name of the EventType 45bf3752-0fc6-46b9-89fd-ffd878b5b22b of deviceClass Mock Device (Auto created) Mock Event 1 - + Mock Event 2 The name of the EventType 863d5920-b1cf-4eb9-88bd-8f7b8583b1cf of deviceClass Mock Device (Auto created) Mock Event 2 - + color changed The name of the autocreated EventType (20dc7c22-c50e-42db-837c-2bbced939f8e) Farbe geändert - + color The name of the ParamType of StateType (20dc7c22-c50e-42db-837c-2bbced939f8e) of DeviceClass Mock Device (Push Button) Farbe - + Set color The name of the autocreated ActionType (20dc7c22-c50e-42db-837c-2bbced939f8e) Setze Farbe - + percentage changed The name of the autocreated EventType (72981c04-267a-4ba0-a59e-9921d2f3af9c) Prozent gändert - + percentage The name of the ParamType of StateType (72981c04-267a-4ba0-a59e-9921d2f3af9c) of DeviceClass Mock Device (Push Button) Prozent - + Set percentage The name of the autocreated ActionType (72981c04-267a-4ba0-a59e-9921d2f3af9c) Setze Prozentwert - + allowed values changed The name of the autocreated EventType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) Erlaubter Wert geändert - + allowed values The name of the ParamType of StateType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) of DeviceClass Mock Device (Push Button) Erlaubte Werte - + Set allowed values The name of the autocreated ActionType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) Setze erlaubten Wert - + double value changed The name of the autocreated EventType (53cd7c55-49b7-441b-b970-9048f20f0e2c) Double Wert geändert - + double value The name of the ParamType of StateType (53cd7c55-49b7-441b-b970-9048f20f0e2c) of DeviceClass Mock Device (Push Button) Double Wert - + Set double value The name of the autocreated ActionType (53cd7c55-49b7-441b-b970-9048f20f0e2c) Setze double Wert - - + + Set bool value The name of the autocreated ActionType (e680f7a4-b39e-46da-be41-fa3170fe3768) ---------- @@ -243,121 +243,127 @@ The name of the autocreated ActionType (d24ede5f-4064-4898-bb84-cfb533b1fbc0)Setze boll Wert - + Timeout action The name of the ActionType 54646e7c-bc54-4895-81a2-590d72d120f9 of deviceClass Mock Device (Push Button) Timeout Aktion - + Mock Device (Display Pin) The name of the DeviceClass (296f1fd4-e893-46b2-8a42-50d1bceb8730) Mock Gerät (Pin anzeigen) - + + bool value changed - The name of the autocreated EventType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) + The name of the autocreated EventType (e680f7a4-b39e-46da-be41-fa3170fe3768) +---------- +The name of the autocreated EventType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) Bool Wert geändert - + + bool value - The name of the ParamType of StateType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) of DeviceClass Mock Device (Parent) + The name of the ParamType of StateType (e680f7a4-b39e-46da-be41-fa3170fe3768) of DeviceClass Mock Device (Push Button) +---------- +The name of the ParamType of StateType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) of DeviceClass Mock Device (Parent) Bool Wert - + Text line The name of the paramType (e6acf0c7-4b8e-4296-ac62-855d20deb816) of Mock Device (InputTypes) Textzeile - + Text area The name of the paramType (716f0994-bc01-42b0-b64d-59236f7320d2) of Mock Device (InputTypes) Textfeld - + Password text The name of the paramType (e5c0d14b-c9f1-4aca-a56e-85bfa6977150) of Mock Device (InputTypes) Passwort Text - + Search text The name of the paramType (22add8c9-ee4f-43ad-8931-58e999313ac3) of Mock Device (InputTypes) Suchtext - + Mail address The name of the paramType (a8494faf-3a0f-4cf3-84b7-4b39148a838d) of Mock Device (InputTypes) Mail Adresse - + IPv4 address The name of the paramType (9e5f86a0-4bb3-4892-bff8-3fc4032af6e2) of Mock Device (InputTypes) IPv4 Adresse - + IPv6 address The name of the paramType (43bf3832-dd48-4090-a836-656e8b60216e) of Mock Device (InputTypes) IPv6 Adresse - + URL The name of the paramType (fa67229f-fcef-496f-b671-59a4b48f3ab5) of Mock Device (InputTypes) URL - + Mac address The name of the paramType (e93db587-7919-48f3-8c88-1651de63c765) of Mock Device (InputTypes) Mac Adresse - + Please enter the secret which normaly will be displayed on the device. For the mockdevice the pin is 243681. The pairing info of deviceClass Mock Device (Display Pin) Bitte geben sie den Pincode ein der normalerweise auf dem Gerät angezeit werden würde. In diesem fall lautet der Pincode 243681. - + Mock Devices The name of the plugin Mock Devices (727a4a9a-c187-446f-aadf-f1b2220607d1) Mock Gerät - + pin The name of the paramType (da820e07-22dc-4173-9c07-2f49a4e265f9) of Mock Device (Display Pin) Pin - + Mock Device (Parent) The name of the DeviceClass (a71fbde9-9a38-4bf8-beab-c8aade2608ba) Mock Gerät (Elternteil) - + Mock Device (Child) The name of the DeviceClass (40893c9f-bc47-40c1-8bf7-b390c7c1b4fc) Mock Gerät (Kind) - + parent uuid The name of the paramType (104b5288-404e-42d3-bf38-e40682e75681) of Mock Device (Child) Elternteil Uuid - + Mock Device (InputTypes) The name of the DeviceClass (515ffdf1-55e5-498d-9abc-4e2fe768f3a9) Mock Gerät (Eingabemethoden) diff --git a/plugins/deviceplugins/mock/translations/en_US.ts b/plugins/deviceplugins/mock/translations/en_US.ts index 8901b2d6..2ace7842 100644 --- a/plugins/deviceplugins/mock/translations/en_US.ts +++ b/plugins/deviceplugins/mock/translations/en_US.ts @@ -4,7 +4,7 @@ DevicePluginMock - + Display pin!! The pin is 243681 @@ -12,230 +12,230 @@ MockDevice - + guh The name of the vendor (2062d64d-3232-433c-88bc-0d33c0ba2ba6) - + Mock Device The name of the DeviceClass (753f0d32-0468-4d08-82ed-1964aab03298) - + http port The name of the paramType (d4f06047-125e-4479-9810-b54c189917f5) of Mock Device - + Mock Action 3 (async) The name of the ActionType fbae06d3-7666-483e-a39e-ec50fe89054e of deviceClass Mock Device - + Mock Action 4 (broken) The name of the ActionType df3cf33d-26d5-4577-9132-9823bd33fad0 of deviceClass Mock Device - + Mock Action 5 (async, broken) The name of the ActionType bfe89a1d-3497-4121-8318-e77c37537219 of deviceClass Mock Device - + Mock Device (Auto created) The name of the DeviceClass (ab4257b3-7548-47ee-9bd4-7dc3004fd197) - + Mock Device (Push Button) The name of the DeviceClass (9e03144c-e436-4eea-82d9-ccb33ef778db) - + Wait 3 second before you continue, the push button will be pressed automatically. The pairing info of deviceClass Mock Device (Push Button) - + configParamInt The name of the paramType (e1f72121-a426-45e2-b475-8262b5cdf103) of Mock Devices - + configParamBool The name of the paramType (c75723b6-ea4f-4982-9751-6c5e39c88145) of Mock Devices - + async The name of the paramType (f2977061-4dd0-4ef5-85aa-3b7134743be3) of Mock Device - + broken The name of the paramType (ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4) of Mock Device - + resultCount The name of the paramType (d222adb4-2f9c-4c3f-8655-76400d0fb6ce) of Mock Device - + Dummy int state changed The name of the autocreated EventType (80baec19-54de-4948-ac46-31eabfaceb83) - + Dummy int state The name of the ParamType of StateType (80baec19-54de-4948-ac46-31eabfaceb83) of DeviceClass Mock Device - + Dummy bool state changed The name of the autocreated EventType (9dd6a97c-dfd1-43dc-acbd-367932742310) - + Dummy bool state The name of the ParamType of StateType (9dd6a97c-dfd1-43dc-acbd-367932742310) of DeviceClass Mock Device - + Mock Action 1 (with params) The name of the ActionType dea0f4e1-65e3-4981-8eaa-2701c53a9185 of deviceClass Mock Device - + mockActionParam1 The name of the paramType (a2d3a256-a551-4712-a65b-ecd5a436a1cb) of Mock Device - + mockActionParam2 The name of the paramType (304a4899-18be-4e3b-94f4-d03be52f3233) of Mock Device - + Mock Action 2 (without params) The name of the ActionType defd3ed6-1a0d-400b-8879-a0202cf39935 of deviceClass Mock Device - + mockParamInt The name of the paramType (0550e16d-60b9-4ba5-83f4-4d3cee656121) of Mock Device - + Mock Event 1 The name of the EventType 45bf3752-0fc6-46b9-89fd-ffd878b5b22b of deviceClass Mock Device (Auto created) - + Mock Event 2 The name of the EventType 863d5920-b1cf-4eb9-88bd-8f7b8583b1cf of deviceClass Mock Device (Auto created) - + color changed The name of the autocreated EventType (20dc7c22-c50e-42db-837c-2bbced939f8e) - + color The name of the ParamType of StateType (20dc7c22-c50e-42db-837c-2bbced939f8e) of DeviceClass Mock Device (Push Button) - + Set color The name of the autocreated ActionType (20dc7c22-c50e-42db-837c-2bbced939f8e) - + percentage changed The name of the autocreated EventType (72981c04-267a-4ba0-a59e-9921d2f3af9c) - + percentage The name of the ParamType of StateType (72981c04-267a-4ba0-a59e-9921d2f3af9c) of DeviceClass Mock Device (Push Button) - + Set percentage The name of the autocreated ActionType (72981c04-267a-4ba0-a59e-9921d2f3af9c) - + allowed values changed The name of the autocreated EventType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) - + allowed values The name of the ParamType of StateType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) of DeviceClass Mock Device (Push Button) - + Set allowed values The name of the autocreated ActionType (05f63f9c-f61e-4dcf-ad55-3f13fde2765b) - + double value changed The name of the autocreated EventType (53cd7c55-49b7-441b-b970-9048f20f0e2c) - + double value The name of the ParamType of StateType (53cd7c55-49b7-441b-b970-9048f20f0e2c) of DeviceClass Mock Device (Push Button) - + Set double value The name of the autocreated ActionType (53cd7c55-49b7-441b-b970-9048f20f0e2c) - - + + Set bool value The name of the autocreated ActionType (e680f7a4-b39e-46da-be41-fa3170fe3768) ---------- @@ -243,121 +243,127 @@ The name of the autocreated ActionType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) - + Timeout action The name of the ActionType 54646e7c-bc54-4895-81a2-590d72d120f9 of deviceClass Mock Device (Push Button) - + Mock Device (Display Pin) The name of the DeviceClass (296f1fd4-e893-46b2-8a42-50d1bceb8730) - + + bool value changed - The name of the autocreated EventType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) + The name of the autocreated EventType (e680f7a4-b39e-46da-be41-fa3170fe3768) +---------- +The name of the autocreated EventType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) - + + bool value - The name of the ParamType of StateType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) of DeviceClass Mock Device (Parent) + The name of the ParamType of StateType (e680f7a4-b39e-46da-be41-fa3170fe3768) of DeviceClass Mock Device (Push Button) +---------- +The name of the ParamType of StateType (d24ede5f-4064-4898-bb84-cfb533b1fbc0) of DeviceClass Mock Device (Parent) - + Text line The name of the paramType (e6acf0c7-4b8e-4296-ac62-855d20deb816) of Mock Device (InputTypes) - + Text area The name of the paramType (716f0994-bc01-42b0-b64d-59236f7320d2) of Mock Device (InputTypes) - + Password text The name of the paramType (e5c0d14b-c9f1-4aca-a56e-85bfa6977150) of Mock Device (InputTypes) - + Search text The name of the paramType (22add8c9-ee4f-43ad-8931-58e999313ac3) of Mock Device (InputTypes) - + Mail address The name of the paramType (a8494faf-3a0f-4cf3-84b7-4b39148a838d) of Mock Device (InputTypes) - + IPv4 address The name of the paramType (9e5f86a0-4bb3-4892-bff8-3fc4032af6e2) of Mock Device (InputTypes) - + IPv6 address The name of the paramType (43bf3832-dd48-4090-a836-656e8b60216e) of Mock Device (InputTypes) - + URL The name of the paramType (fa67229f-fcef-496f-b671-59a4b48f3ab5) of Mock Device (InputTypes) - + Mac address The name of the paramType (e93db587-7919-48f3-8c88-1651de63c765) of Mock Device (InputTypes) - + Please enter the secret which normaly will be displayed on the device. For the mockdevice the pin is 243681. The pairing info of deviceClass Mock Device (Display Pin) - + Mock Devices The name of the plugin Mock Devices (727a4a9a-c187-446f-aadf-f1b2220607d1) - + pin The name of the paramType (da820e07-22dc-4173-9c07-2f49a4e265f9) of Mock Device (Display Pin) - + Mock Device (Parent) The name of the DeviceClass (a71fbde9-9a38-4bf8-beab-c8aade2608ba) - + Mock Device (Child) The name of the DeviceClass (40893c9f-bc47-40c1-8bf7-b390c7c1b4fc) - + parent uuid The name of the paramType (104b5288-404e-42d3-bf38-e40682e75681) of Mock Device (Child) - + Mock Device (InputTypes) The name of the DeviceClass (515ffdf1-55e5-498d-9abc-4e2fe768f3a9) diff --git a/plugins/guh-generateplugininfo b/plugins/guh-generateplugininfo index 6b688693..5d1b81a3 100755 --- a/plugins/guh-generateplugininfo +++ b/plugins/guh-generateplugininfo @@ -4,7 +4,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# Copyright (C) 2015-2016 Simon Stuerz # +# Copyright (C) 2015-2017 Simon Stuerz # # Copyright (C) 2014 Michael Zanetti # # # # This file is part of guh. # @@ -27,148 +27,132 @@ import argparse import traceback import json import os -import subprocess +import subprocess -__version__='1.0.0' - -# Argument parser -parser = argparse.ArgumentParser(description='The guh-generateplugininfo is a precompiler for building plugins. This precompiler will create a plugininfo.h containing the uuid definitions from the plugin json file and creates the translations for the plugin.') -parser.add_argument('-j', '--jsonfile', help='The JSON input file name with the plugin description', metavar='jsonfile') -parser.add_argument('-b', '--builddir', help='The path to the build directory of the plugin where the plugininfo.h file can be found.', metavar='buildpath') -parser.add_argument('-o', '--output', help='The plugininfo.h outputFile with the uuid declarations', metavar='output') -parser.add_argument('-t', '--translations', help='The translation files for the plugin.', nargs='*', type=str, metavar='*.ts') -parser.add_argument('-v', '--version', action='version', version=__version__) -args = parser.parse_args() - -# Get the source directors -sourceDir = os.path.dirname(os.path.abspath(args.jsonfile)) - -print 'Json file: %s' % args.jsonfile -print 'Output: %s/%s' % (args.builddir, args.output) -print 'Build directory: %s' % args.builddir -print 'Source directory: %s' % sourceDir -print 'Translations: %s' % args.translations - -# Tuple ('string to translate', 'comment for translater') -translationStrings = [] - -variableNames = [] -externDefinitions = [] - - -# Open files -inputFile = open(args.jsonfile, 'r') -outputFile = open(args.builddir + '/' + args.output, 'w') -outputFileExtern = open(args.builddir + '/' + 'extern-' + args.output, 'w') - -# Read json file -try: - pluginMap = json.loads(inputFile.read()) - inputFile.close() -except ValueError as error: - print ' --> Error loading input file \"%s\"' % (args.input) - print ' %s' % (error) - inputFile.close() - exit -1 +__version__='1.0.1' ################################################################################################################## # Methods -def writePluginInfo(line): +#----------------------------------------------------------------------------------------------------------------- +def printInfo(info): + if args.filetype is 'i': + print(info) + + +#----------------------------------------------------------------------------------------------------------------- +def printWarning(warning): + if args.filetype is 'i': + print("Warning:" + warning) + + +#----------------------------------------------------------------------------------------------------------------- +def printError(error): + if args.filetype is 'i': + print('Error:' + error) + + +#----------------------------------------------------------------------------------------------------------------- +def writeToFile(line): outputFile.write('%s\n' % line) -def writeExternPluginInfo(line): - outputFileExtern.write('%s\n' % line) - - +#----------------------------------------------------------------------------------------------------------------- def extractPlugin(pluginMap): variableName = 'pluginId' if not variableName in variableNames: variableNames.append(variableName) - print('Define PluginId pluginId = %s' % (pluginMap['id'])) - writePluginInfo('PluginId pluginId = PluginId(\"%s\");' % (pluginMap['id'])) + printInfo('Define PluginId pluginId = %s' % (pluginMap['id'])) + if args.filetype is 'i': + writeToFile('PluginId pluginId = PluginId(\"%s\");' % (pluginMap['id'])) addTranslationString(pluginMap['name'], 'The name of the plugin %s (%s)' % (pluginMap['name'], pluginMap['id'])) createExternDefinition('PluginId', variableName) - + if 'paramTypes' in pluginMap: extractParamTypes(pluginMap['paramTypes'], pluginMap['name']) - + if 'vendors' in pluginMap: extractVendors(pluginMap['vendors']) +#----------------------------------------------------------------------------------------------------------------- def extractParamTypes(paramTypes, contextName): for paramType in paramTypes: try: variableName = '%sParamTypeId' % (paramType['idName']) if not variableName in variableNames: variableNames.append(variableName) - print('Define ParamTypeId %s = %s' % (variableName, paramType['id'])) - writePluginInfo('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, paramType['id'])) + printInfo('Define ParamTypeId %s = %s' % (variableName, paramType['id'])) + if args.filetype is 'i': + writeToFile('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, paramType['id'])) addTranslationString(paramType['name'], 'The name of the paramType (%s) of %s' % (paramType['id'], contextName)) createExternDefinition('ParamTypeId', variableName) else: - print('Duplicated variable name \"%s\" for ParamTypeId %s -> skipping') % (variableName, paramType['id']) + printWarning('Duplicated variable name \"%s\" for ParamTypeId %s -> skipping') % (variableName, paramType['id']) except: pass +#----------------------------------------------------------------------------------------------------------------- def extractVendors(vendors): for vendor in vendors: try: variableName = '%sVendorId' % (vendor['idName']) if not variableName in variableNames: variableNames.append(variableName) - print('Define VendorId %s = %s' % (variableName, vendor['id'])) - writePluginInfo('VendorId %s = VendorId(\"%s\");' % (variableName, vendor['id'])) + printInfo('Define VendorId %s = %s' % (variableName, vendor['id'])) + if args.filetype is 'i': + writeToFile('VendorId %s = VendorId(\"%s\");' % (variableName, vendor['id'])) addTranslationString(vendor['name'], 'The name of the vendor (%s)' % vendor['id']) createExternDefinition('VendorId', variableName) else: - print('Duplicated variable name \"%s\" for VendorId %s -> skipping') % (variableName, param['id']) + printWarning('Duplicated variable name \"%s\" for VendorId %s -> skipping') % (variableName, param['id']) except: pass - + if 'deviceClasses' in vendor: - extractDeviceClasses(vendor['deviceClasses']) + extractDeviceClasses(vendor['deviceClasses']) +#----------------------------------------------------------------------------------------------------------------- def extractDeviceClasses(deviceClasses): for deviceClass in deviceClasses: try: variableName = '%sDeviceClassId' % (deviceClass['idName']) - + if 'pairingInfo' in deviceClass: addTranslationString(deviceClass['pairingInfo'], 'The pairing info of deviceClass %s' % deviceClass['name']) - + if not variableName in variableNames: variableNames.append(variableName) - print('Define DeviceClassId %s = %s' % (variableName, deviceClass['id'])) - writePluginInfo('DeviceClassId %s = DeviceClassId(\"%s\");' % (variableName, deviceClass['id'])) + printInfo('Define DeviceClassId %s = %s' % (variableName, deviceClass['id'])) + if args.filetype is 'i': + writeToFile('DeviceClassId %s = DeviceClassId(\"%s\");' % (variableName, deviceClass['id'])) addTranslationString(deviceClass['name'], 'The name of the DeviceClass (%s)' %(deviceClass['id'])) createExternDefinition('DeviceClassId', variableName) else: - print('Duplicated variable name \"%s\" for DeviceClassId %s -> skipping') % (variableName, deviceClass['deviceClassId']) - + printWarning('Duplicated variable name \"%s\" for DeviceClassId %s -> skipping') % (variableName, deviceClass['deviceClassId']) + except: pass if 'paramTypes' in deviceClass: extractParamTypes(deviceClass['paramTypes'], deviceClass['name']) - + if 'discoveryParamTypes' in deviceClass: extractParamTypes(deviceClass['discoveryParamTypes'], deviceClass['name']) if 'stateTypes' in deviceClass: extractStateTypes(deviceClass['stateTypes'], deviceClass['name']) - + if 'actionTypes' in deviceClass: extractActionTypes(deviceClass['actionTypes'], deviceClass['name']) - + if 'eventTypes' in deviceClass: extractEventTypes(deviceClass['eventTypes'], deviceClass['name']) +#----------------------------------------------------------------------------------------------------------------- def extractStateTypes(stateTypes, deviceClassName): for stateType in stateTypes: try: @@ -177,51 +161,55 @@ def extractStateTypes(stateTypes, deviceClassName): #addTranslationString(stateType['name'], 'The name of the stateType (%s) of DeviceClass %s' % (stateType['id'], deviceClassName)) if not variableName in variableNames: variableNames.append(variableName) - print('Define StateTypeId %s = %s' % (variableName, stateType['id'])) - writePluginInfo('StateTypeId %s = StateTypeId(\"%s\");' % (variableName, stateType['id'])) + printInfo('Define StateTypeId %s = %s' % (variableName, stateType['id'])) + if args.filetype is 'i': + writeToFile('StateTypeId %s = StateTypeId(\"%s\");' % (variableName, stateType['id'])) createExternDefinition('StateTypeId', variableName) else: - print('Duplicated variable name \"%s\" for StateTypeId %s -> skipping') % (variableName, stateType['id']) - + printWarning('Duplicated variable name \"%s\" for StateTypeId %s -> skipping') % (variableName, stateType['id']) + # Create EventTypeId for this state variableName = '%sEventTypeId' % (stateType['idName']) if not variableName in variableNames: addTranslationString(stateType['eventTypeName'], 'The name of the autocreated EventType (%s)' % stateType['id']) variableNames.append(variableName) - print('Define EventTypeId %s = %s' % (variableName, stateType['id'])) - writePluginInfo('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, stateType['id'])) + printInfo('Define EventTypeId %s = %s' % (variableName, stateType['id'])) + if args.filetype is 'i': + writeToFile('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, stateType['id'])) createExternDefinition('EventTypeId', variableName) else: - print('Duplicated variable name \"%s\" for autocreated EventTypeId %s -> skipping') % (variableName, stateType['id']) - + printWarning('Duplicated variable name \"%s\" for autocreated EventTypeId %s -> skipping') % (variableName, stateType['id']) + #ParamType for EventType/ActionType - variableName = '%sStateParamTypeId' % (stateType['idName']) + variableName = '%sStateParamTypeId' % (stateType['idName']) if not variableName in variableNames: variableNames.append(variableName) - print('Define ParamTypeId %s for StateType %s = %s' % (variableName, variableName, stateType['id'])) - writePluginInfo('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, stateType['id'])) + printInfo('Define ParamTypeId %s for StateType %s = %s' % (variableName, variableName, stateType['id'])) + if args.filetype is 'i': + writeToFile('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, stateType['id'])) createExternDefinition('ParamTypeId', variableName) addTranslationString(stateType['name'], 'The name of the ParamType of StateType (%s) of DeviceClass %s' % (stateType['id'], deviceClassName)) else: - print('duplicated variable name \"%s\" for ParamTypeId %s -> skipping') % (variableName, stateType['id']) - + printWarning('duplicated variable name \"%s\" for ParamTypeId %s -> skipping') % (variableName, stateType['id']) + # Create ActionTypeId if the state is writable if 'writable' in stateType and stateType['writable']: - variableName = '%sActionTypeId' % (stateType['idName']) + variableName = '%sActionTypeId' % (stateType['idName']) if not variableName in variableNames: variableNames.append(variableName) - print('Define ActionTypeId for writable StateType %s = %s' % (variableName, stateType['id'])) + printInfo('Define ActionTypeId for writable StateType %s = %s' % (variableName, stateType['id'])) addTranslationString(stateType['actionTypeName'], 'The name of the autocreated ActionType (%s)' % stateType['id']) - writePluginInfo('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, stateType['id'])) + if args.filetype is 'i': + writeToFile('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, stateType['id'])) createExternDefinition('ActionTypeId', variableName) else: - print('Duplicated variable name \"%s\" for autocreated ActionTypeId %s -> skipping') % (variableName, stateType['id']) - + printWarning('Duplicated variable name \"%s\" for autocreated ActionTypeId %s -> skipping') % (variableName, stateType['id']) + except: pass - +#----------------------------------------------------------------------------------------------------------------- def extractActionTypes(actionTypes, deviceClassName): for actionType in actionTypes: try: @@ -230,19 +218,21 @@ def extractActionTypes(actionTypes, deviceClassName): if not variableName in variableNames: variableNames.append(variableName) addTranslationString(actionType['name'], 'The name of the ActionType %s of deviceClass %s' % (actionType['id'], deviceClassName)) - writePluginInfo('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, actionType['id'])) + if args.filetype is 'i': + writeToFile('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, actionType['id'])) createExternDefinition('ActionTypeId', variableName) else: - print('Duplicated variable name \"%s\" for ActionTypeId %s -> skipping') % (variableName, actionType['id']) + printWarning('Duplicated variable name \"%s\" for ActionTypeId %s -> skipping') % (variableName, actionType['id']) except: pass - + # Define paramTypes of this ActionType if 'paramTypes' in actionType: extractParamTypes(actionType['paramTypes'], deviceClassName) +#----------------------------------------------------------------------------------------------------------------- def extractEventTypes(eventTypes, deviceClassName): for eventType in eventTypes: try: @@ -251,10 +241,11 @@ def extractEventTypes(eventTypes, deviceClassName): if not variableName in variableNames: variableNames.append(variableName) addTranslationString(eventType['name'], 'The name of the EventType %s of deviceClass %s' % (eventType['id'], deviceClassName)) - writePluginInfo('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, eventType['id'])) - createExternDefinition('EventTypeId', variableName) + if args.filetype is 'i': + writeToFile('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, eventType['id'])) + createExternDefinition('EventTypeId', variableName) else: - print('Duplicated variable name \"%s\" for EventTypeId %s -> skipping') % (variableName, eventType['id']) + printWarning('Duplicated variable name \"%s\" for EventTypeId %s -> skipping') % (variableName, eventType['id']) except: pass @@ -263,6 +254,7 @@ def extractEventTypes(eventTypes, deviceClassName): extractParamTypes(eventType['paramTypes'], deviceClassName) +#----------------------------------------------------------------------------------------------------------------- def createExternDefinition(type, name): definition = {} definition['type'] = type @@ -270,120 +262,185 @@ def createExternDefinition(type, name): externDefinitions.append(definition) +#----------------------------------------------------------------------------------------------------------------- def addTranslationString(string, comment): translationStrings.append([string, comment]) - + +#----------------------------------------------------------------------------------------------------------------- def writeTranslationStrings(): if len(args.translations) is 0: return if len(translationStrings) is not 0: - writePluginInfo('// Translation strings') - writePluginInfo('const QString translations[] {') + writeToFile('// Translation strings') + writeToFile('const QString translations[] {') for index, value in enumerate(translationStrings): - writePluginInfo(' //: %s' % value[1]) + writeToFile(' //: %s' % value[1]) if index != len(translationStrings) - 1: - writePluginInfo(' QT_TRANSLATE_NOOP(\"%s\", \"%s\"), \n' % (pluginMap['idName'], value[0])) + writeToFile(' QT_TRANSLATE_NOOP(\"%s\", \"%s\"), \n' % (pluginMap['idName'], value[0])) else: - writePluginInfo(' QT_TRANSLATE_NOOP(\"%s\", \"%s\")' % (pluginMap['idName'], value[0])) + writeToFile(' QT_TRANSLATE_NOOP(\"%s\", \"%s\")' % (pluginMap['idName'], value[0])) - writePluginInfo('};') - + writeToFile('};') + +#----------------------------------------------------------------------------------------------------------------- def createTranslationFiles(): for translation in args.translations: translationFile = (sourceDir + '/' + translation) path, fileName = os.path.split(translationFile) translationOutput = (path + '/' + pluginMap['id'] + '-' + os.path.splitext(fileName)[0] + '.qm') - print(' --> Translation update %s' % translationFile) - print(subprocess.check_output(['mkdir', '-p', path])) - print(subprocess.check_output(['lupdate', '-recursive', '-no-obsolete', sourceDir, (args.builddir + '/' + args.output), '-ts', translationFile])) - print(' --> Translation release %s' % translationOutput) - print(subprocess.check_output(['lrelease', translationFile, '-qm', translationOutput])) - print(' --> Copy translation files to build dir %s' % args.builddir + '/translations/') + printInfo(' --> Translation update %s' % translationFile) + printInfo(subprocess.check_output(['mkdir', '-p', path])) + printInfo(subprocess.check_output(['lupdate', '-recursive', '-no-obsolete', sourceDir, (args.builddir + '/' + args.output), '-ts', translationFile])) + printInfo(' --> Translation release %s' % translationOutput) + printInfo(subprocess.check_output(['lrelease', translationFile, '-qm', translationOutput])) + printInfo(' --> Copy translation files to build dir %s' % args.builddir + '/translations/') subprocess.check_output(['rsync', '-a', translationOutput, args.builddir + '/translations/']) -################################################################################################################## -# write plugininfo.h +#----------------------------------------------------------------------------------------------------------------- +def writePluginInfoFile(): + printInfo(' --> generate plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id'])) -print ' --> generate plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id']) - -writePluginInfo('/* This file is generated by the guh build system. Any changes to this file will') -writePluginInfo(' * be lost.') -writePluginInfo(' *') -writePluginInfo(' * If you want to change this file, edit the plugin\'s json file.') -writePluginInfo(' */') -writePluginInfo('') -writePluginInfo('#ifndef PLUGININFO_H') -writePluginInfo('#define PLUGININFO_H') -writePluginInfo('') -writePluginInfo('#include ') -writePluginInfo('#include ') -writePluginInfo('') -writePluginInfo('#include \"typeutils.h\"') -writePluginInfo('') -writePluginInfo('// Id definitions') + writeToFile('/* This file is generated by the guh build system. Any changes to this file will') + writeToFile(' * be lost.') + writeToFile(' *') + writeToFile(' * If you want to change this file, edit the plugin\'s json file.') + writeToFile(' */') + writeToFile('') + writeToFile('#ifndef PLUGININFO_H') + writeToFile('#define PLUGININFO_H') + writeToFile('') + writeToFile('#include ') + writeToFile('#include ') + writeToFile('') + writeToFile('#include \"typeutils.h\"') + writeToFile('') + writeToFile('// Id definitions') + extractPlugin(pluginMap) + writeToFile('') + writeToFile('// Logging category') -extractPlugin(pluginMap) + if 'idName' in pluginMap: + writeToFile('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % pluginMap['idName']) + writeToFile('Q_LOGGING_CATEGORY(dc%s, \"%s\")' % (pluginMap['idName'], pluginMap['idName'])) + printInfo('Define logging category: \'dc%s\'' % pluginMap['idName']) -writePluginInfo('') -writePluginInfo('// Logging category') + writeToFile('') -if 'idName' in pluginMap: - writePluginInfo('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % pluginMap['idName']) - writePluginInfo('Q_LOGGING_CATEGORY(dc%s, \"%s\")' % (pluginMap['idName'], pluginMap['idName'])) - print 'define logging category: \'dc%s\'' % pluginMap['idName'] - -writePluginInfo('') + # Write translation strings + writeTranslationStrings() -# Write translation strings -writeTranslationStrings() + writeToFile('') + writeToFile('#endif // PLUGININFO_H') + outputFile.close() + printInfo(' --> generated successfully \"%s\"' % (args.output)) + + # Translate + if len(translationStrings) is not 0: + createTranslationFiles() + + +#----------------------------------------------------------------------------------------------------------------- +def writeExternPluginInfoFile(): + printInfo(' --> generate extern-plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id'])) + extractPlugin(pluginMap) + writeToFile('/* This file is generated by the guh build system. Any changes to this file will') + writeToFile(' * be lost.') + writeToFile(' *') + writeToFile(' * If you want to change this file, edit the plugin\'s json file and add') + writeToFile(' * idName tags where appropriate.') + writeToFile(' */') + writeToFile('') + writeToFile('#ifndef EXTERNPLUGININFO_H') + writeToFile('#define EXTERNPLUGININFO_H') + writeToFile('#include \"typeutils.h\"') + writeToFile('#include ') + writeToFile('') + writeToFile('// Id definitions') + + for externDefinition in externDefinitions: + writeToFile('extern %s %s;' % (externDefinition['type'], externDefinition['variable'])) + + writeToFile('') + writeToFile('// Logging category definition') + + if 'idName' in pluginMap: + writeToFile('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % pluginMap['idName']) + + writeToFile('') + writeToFile('#endif // EXTERNPLUGININFO_H') + outputFile.close() + printInfo(' --> generated successfully \'%s\'' % (args.output)) -writePluginInfo('') -writePluginInfo('#endif // PLUGININFO_H') -outputFile.close() -print ' --> generated successfully \"%s\"' % (args.output) ################################################################################################################## -# Write extern-plugininfo.h - -print ' --> generate extern-plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id']) - -writeExternPluginInfo('/* This file is generated by the guh build system. Any changes to this file will') -writeExternPluginInfo(' * be lost.') -writeExternPluginInfo(' *') -writeExternPluginInfo(' * If you want to change this file, edit the plugin\'s json file and add') -writeExternPluginInfo(' * idName tags where appropriate.') -writeExternPluginInfo(' */') -writeExternPluginInfo('') -writeExternPluginInfo('#ifndef EXTERNPLUGININFO_H') -writeExternPluginInfo('#define EXTERNPLUGININFO_H') -writeExternPluginInfo('#include \"typeutils.h\"') -writeExternPluginInfo('#include ') -writeExternPluginInfo('') -writeExternPluginInfo('// Id definitions') - -for externDefinition in externDefinitions: - writeExternPluginInfo('extern %s %s;' % (externDefinition['type'], externDefinition['variable'])) - -writeExternPluginInfo('') -writeExternPluginInfo('// Logging category definition') - -if 'idName' in pluginMap: - writeExternPluginInfo('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % pluginMap['idName']) - -writeExternPluginInfo('') -writeExternPluginInfo('#endif // EXTERNPLUGININFO_H') -outputFileExtern.close() -print ' --> generated successfully \'extern-%s\'' % (args.output) - +# Main ################################################################################################################## -# Translate -if len(translationStrings) is not 0: - createTranslationFiles() + +if __name__ == '__main__': + # Argument parser + parser = argparse.ArgumentParser(description='The guh-generateplugininfo is a precompiler for building plugins. This precompiler will create a plugininfo.h containing the uuid definitions from the plugin json file and creates the translations for the plugin.') + parser.add_argument('-j', '--jsonfile', help='The JSON input file name with the plugin description', metavar='jsonfile', required=True) + parser.add_argument('-b', '--builddir', help='The path to the build directory of the plugin where the plugininfo.h file can be found.', metavar='buildpath', required=True) + parser.add_argument('-f', '--filetype', help='The file type to generate: e = extern infofile, i = infofile', action='store', choices=['e', 'i'], default='i') + parser.add_argument('-o', '--output', help='The plugininfo.h outputFile with the uuid declarations', metavar='output') + parser.add_argument('-t', '--translations', help='The translation files for the plugin.', nargs='*', type=str, metavar='*.ts') + parser.add_argument('-v', '--version', action='version', version=__version__) + args = parser.parse_args() + + # Get the source directors + sourceDir = os.path.dirname(os.path.abspath(args.jsonfile)) + + # Print build information for debugging + printInfo('Json file: %s' % args.jsonfile) + printInfo('Output: %s/%s' % (args.builddir, args.output)) + printInfo('Build directory: %s' % args.builddir) + printInfo('Source directory: %s' % sourceDir) + printInfo('Translations: %s' % args.translations) + printInfo('FileType: %s' % args.filetype) + + # Tuple ('string to translate', 'comment for translater') + translationStrings = [] + + variableNames = [] + externDefinitions = [] + + # Open files + try: + inputFile = open(args.jsonfile, 'r') + except: + printError('Could not open file \"%s\"' % (args.jsonfile)) + exit -1 + + try: + outputFile = open(args.builddir + '/' + args.output, 'w') + except: + printError('Could not open file \"%s\"' % (args.jsonfile)) + exit -1 + + # Read json file + try: + pluginMap = json.loads(inputFile.read()) + inputFile.close() + except ValueError as error: + printError(' --> Could not load json input file \"%s\"' % (args.input)) + printError(' %s' % (error)) + inputFile.close() + exit -1 + + # Write files + if args.filetype is 'i': + writePluginInfoFile() + else: + writeExternPluginInfoFile() + + + + diff --git a/plugins/plugins.pri b/plugins/plugins.pri index f8cdff75..d3814ae4 100644 --- a/plugins/plugins.pri +++ b/plugins/plugins.pri @@ -14,19 +14,34 @@ INCLUDEPATH += $$top_srcdir/libguh LIBS += -L../../../libguh -lguh # Create plugininfo file -infofile.output = plugininfo.h -infofile.depends = $$top_srcdir/plugins/guh-generateplugininfo -infofile.CONFIG = no_link JSONFILES = deviceplugin"$$TARGET".json -infofile.input = JSONFILES -infofile.commands = $$top_srcdir/plugins/guh-generateplugininfo -j ${QMAKE_FILE_NAME} \ - -o ${QMAKE_FILE_OUT} \ - -b $$OUT_PWD \ - -t $$TRANSLATIONS; \ - rsync -a "$$OUT_PWD"/translations/*.qm $$top_builddir/translations/; +plugininfo.target = plugininfo.h +plugininfo.output = plugininfo.h +plugininfo.CONFIG = no_link +plugininfo.input = JSONFILES +plugininfo.commands = touch ${QMAKE_FILE_OUT}; $$top_srcdir/plugins/guh-generateplugininfo \ + --filetype i \ + --jsonfile ${QMAKE_FILE_NAME} \ + --output ${QMAKE_FILE_OUT} \ + --builddir $$OUT_PWD \ + --translations $$TRANSLATIONS; \ + rsync -a "$$OUT_PWD"/translations/*.qm $$top_builddir/translations/; +PRE_TARGETDEPS += +QMAKE_EXTRA_COMPILERS += + +externplugininfo.target = extern-plugininfo.h +externplugininfo.output = extern-plugininfo.h +externplugininfo.CONFIG = no_link +externplugininfo.input = JSONFILES +externplugininfo.commands = touch ${QMAKE_FILE_OUT}; $$top_srcdir/plugins/guh-generateplugininfo \ + --filetype e \ + --jsonfile ${QMAKE_FILE_NAME} \ + --output ${QMAKE_FILE_OUT} \ + --builddir $$OUT_PWD \ + --translations $$TRANSLATIONS; +PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_all +QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo -QMAKE_EXTRA_COMPILERS += infofile -PRE_TARGETDEPS += compiler_infofile_make_all # Install translation files translations.path = /usr/share/guh/translations