1. # More information: https://wiki.ubuntu.com/Touch/Testing
  2. #
  3. # Notes for autopilot tests:
  4. # ---------------------------------------------------------------
  5. # In order to run autopilot tests:
  6. # sudo apt-add-repository ppa:autopilot/ppa
  7. # sudo apt-get update
  8. # sudo apt-get install python-autopilot autopilot-qt
  9. #
  10. # Notes for translations:
  11. # ---------------------------------------------------------------
  12. # In order to create translation files manually:
  13. # 1) run make once to create and update the po/%ProjectName:l%.pot
  14. # 2) copy the template file and set the name to the language you want to
  15. # translate to: cp po/%ProjectName:l%.pot po/en.po
  16. # 3) edit the po file
  17. # 4) run make build-translations to build the translation files
  18. #
  19. # Steps 1) and 4) are automatically executed by QtCreator
  20. #################################################################
  21. #APP_ID needs to match the "name" field of the click manifest
  22. APP_ID=%ProjectName:l%.%ClickDomain:l%
  23. #provides a way for the IDE to set a specific target folder for the translations
  24. TRANSLATION_ROOT=.
  25. MO_FILES=$(shell for infile in `find po -name "*.po"`; do basename -s .po $$infile | awk '{print "$(TRANSLATION_ROOT)/share/locale/" $$0 "/LC_MESSAGES/$(APP_ID).mo";}' ; done)
  26. QMLJS_FILES=$(shell find . -name "*.qml" -o -name "*.js" | grep -v ./tests)
  27. all: po/%ProjectName:l%.pot
  28. autopilot:
  29. chmod +x tests/autopilot/run
  30. tests/autopilot/run
  31. check:
  32. qmltestrunner -input tests/qml
  33. #translation targets
  34. build-translations: $(MO_FILES)
  35. po/%ProjectName:l%.pot: $(QMLJS_FILES)
  36. mkdir -p $(CURDIR)/po && xgettext -o po/%ProjectName:l%.pot --qt --c++ --add-comments=TRANSLATORS --keyword=tr --keyword=tr:1,2 $(QMLJS_FILES) --from-code=UTF-8
  37. $(TRANSLATION_ROOT)/share/locale/%/LC_MESSAGES/$(APP_ID).mo: po/%.po
  38. mkdir -p $(TRANSLATION_ROOT)/share/locale/$*/LC_MESSAGES && msgfmt -o $(@) $(<)