Organize and filesets sections problem

Hi
I have problem with organize and filesets sections. Correct me if I am wrong, but my understanding is:

  • at first I have to define filesets - files which I want to include in to snap
  • in organize I rename them in order to be correctly recognized by my app

But in my case some thing went wrong. I got error:

Failed to generate snap metadata: The path '/root/prime/usr/share/Textprofan2/Txt/Textprofan2.desktop' set for 'desktop' in 'textprofan2' does not exist. Make sure that the files are in the `prime` directory.

I checked /root/prime/usr/share dir and I not found even Textprofan2 dir! (no mention about its subdirs).
My snapcraft.yaml is as follow:


name: textprofan2
version: '2.6'
summary: Textprofan2 is a simple programmer text editor
description: |
    Textprofan2 is a simple programmer text editor writen in Qt in monolithic style.
icon: Images/Textprofan3Logo.svg
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
base: core18

apps:
    textprofan2:
        command: desktop-launch $SNAP/bin/Textprofan2
        desktop: usr/share/Textprofan2/Txt/Textprofan2.desktop
        environment:
            LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib
parts:
    energo-kod-tools:
        plugin: cmake
        source: ./Libs/EnergoKodTools
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        after: [desktop-qt5]

    energo-kod-editor1:
        plugin: cmake
        source: ./Libs/EnergoKodEditor1
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        after: [desktop-qt5, energo-kod-tools, extra-cmake-modules, kf5-syntax-highlighting, qtcsv, hunspell]

    extra-cmake-modules:
        plugin: cmake
        source: ./Libs/3rdparty/KSyntaxHighlighter/extra-cmake-modules
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        after: [desktop-qt5]

    kf5-syntax-highlighting:
        after: [extra-cmake-modules]
        plugin: cmake
        source: ./Libs/3rdparty/KSyntaxHighlighter/syntax-highlighting
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        after: [desktop-qt5]
        configflags:
        - -DCMAKE_PREFIX_PATH=/root/parts/extra-cmake-modules/install/share/ECM/cmake/
#        - -DCMAKE_PREFIX_PATH=$SNAPCRAFT_STAGE/share/ECM

    qtcsv:
        plugin: cmake
        source: ./Libs/3rdparty/qtcsv
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        after: [desktop-qt5]

    hunspell:
        plugin: cmake
        source: ./Libs/3rdparty/Hunspell
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev

    desktop-qt5:
      source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
      source-subdir: qt
      plugin: make
      make-parameters: ["FLAVOR=qt5"]
      build-packages:
        - qtbase5-dev
        - dpkg-dev
      stage-packages:
        - libxkbcommon0
        - ttf-ubuntu-font-family
        - dmz-cursor-theme
        - light-themes
        - adwaita-icon-theme
        - gnome-themes-standard
        - shared-mime-info
        - libqt5gui5
        - libgdk-pixbuf2.0-0
        - libqt5svg5 # for loading icon themes which are svg
        - try: [appmenu-qt5] # not available on core18
        - locales-all

    textprofan2:
        after: [desktop-qt5, energo-kod-tools, energo-kod-editor1, extra-cmake-modules, kf5-syntax-highlighting, qtcsv, hunspell]
        plugin: cmake
        source: .
        source-type: local
        build-packages:
        - build-essential
        - qttools5-dev
        override-build: |
          snapcraftctl build
          pwd
          cp ./Textprofan2 $SNAPCRAFT_PART_INSTALL/bin/.
        stage-packages:
        - libqt5core5a
        - libqt5network5
        - libqt5printsupport5
        - libxcomposite1
        - libxcursor1
        - libxinerama1
        - libxrandr2
        - libatk1.0-0
        - libgtk2.0-0
        filesets:
            resources:
            - Csv/*
            - Dictionaries/*
            - Images/*
            - Txt/*
        organize:
            Csv/*: usr/share/Textprofan2/Csv
            Dictionaries/*: usr/share/Textprofan2/Dictionaries
            Images/*: usr/share/Textprofan2/Images
            Txt/*: usr/share/Textprofan2/Txt
        prime:
            - $resources
        stage:
            - $resources

I think essentinal is:


        filesets:
            resources:
            - Csv/*
            - Dictionaries/*
            - Images/*
            - Txt/*
        organize:
            Csv/*: usr/share/Textprofan2/Csv
            Dictionaries/*: usr/share/Textprofan2/Dictionaries
            Images/*: usr/share/Textprofan2/Images
            Txt/*: usr/share/Textprofan2/Txt
        prime:
            - $resources
        stage:
            - $resources

Any body can help me to correct my filesets and/or organize section?