CQtDeployer icon indicating copy to clipboard operation
CQtDeployer copied to clipboard

Add more functionality to the extraData option

Open kartaris opened this issue 4 years ago • 19 comments

Problem:

For now there is no direct way to copy extra files(plugin libs in my case) into the special folder. And it copies files and folders into the target directory's root. I copy using qmake into the special folder and add path to it into extraData. Like this:

COPIES += myPlugins
myPlugins.files = $$files($$OUT_PWD/lib*.so*)
myPlugins.path = $$files($$OUT_PWD/plugins/myPlugins)

...

cqtdeployer -extraData $$OUT_PWD/plugins/myPlugins ....

My project tree:

buildFolder
    |- application
    |- plugins -> copy into  $$PWD/packages/application.package/data/application/myPlugins
        |- (*.so, *.a, *.lib, *.dll)
        |- (other build files not needed in installer)
    |- morePlugins -> copy into $$PWD/packages/application.package/data/application/myPlugins
        |- (*.so, *.a, *.lib, *.dll)
        |- (other build files not needed in installer)
rootFolder
    |- installer
        |- packages
            |- application.package
                |- data
                    |- application
                        |- myPlugins
                            |- (*.so, *.a, *.lib, *.dll)
                |- meta

Suggestion

Expand extraData with the syntax below: -extraData {$$OUT_PWD/plugins/libPluginName.so,myPlugins/libPluginNewName.so},{$$OUT_PWD/plugins/libSecondPluginName.so,myPlugins/libSecondPluginNewName.so},{$$OUT_PWD/plugins/libThirdPluginName.so}

kartaris avatar Apr 28 '21 14:04 kartaris

Did I understand you correctly? Do you want cqtdeployer to add not all files to the myPlugins folder, but only with the extensions you need

EndrII avatar Apr 28 '21 14:04 EndrII

Did I understand you correctly? Do you want cqtdeployer to add not all files to the myPlugins folder, but only with the extensions you need

No, not only filtering file extensions. Also I need to copy them into the folder myPlugins in package's data folder. I will add more information to the issue now.

kartaris avatar Apr 28 '21 15:04 kartaris

@EndrII think it's OK now

kartaris avatar Apr 29 '21 06:04 kartaris

hm you need to collect all plug-ins files (*.so, *.a, *.lib, *.dll) into one custom folder without save structure of the input directory ? right?

EndrII avatar Apr 29 '21 07:04 EndrII

hm you need to collect all plug-ins files (*.so, *.a, *.lib, *.dll) into one custom folder without save structure of the input directory ? right?

Yeah. I want to collect them into one custom folder in component's folder. For now I first copy all files into one folder using qmake and after copying I call cqtdeployer with giving it path to folder and it copies it to the data folder. I just want to avoid excess file copying in my projects.

kartaris avatar Apr 29 '21 13:04 kartaris

Of course, It can be avoided by changing DESTDIR in .pro files for plugins but it adds dependencies to subprojects so that they cannot be freely used in other projects.

kartaris avatar Apr 29 '21 13:04 kartaris

try the extraDataOut option. This option sets relative path to an output directory of an extra data

cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins

EndrII avatar Apr 29 '21 14:04 EndrII

@kartaris the fact is that I do not yet know how to make cqtdeployer make a selection for certain files. Here I would like to introduce a new concept "Selector" and it will take a lot of time to implement.

EndrII avatar Apr 29 '21 15:04 EndrII

I can try to add it myself)

kartaris avatar Apr 29 '21 16:04 kartaris

I can try to add it myself)

you can try to do it yourself, but the option that you suggested introducing the new syntax into the arguments, I'm afraid it will take a lot of time and can break a lot.

EndrII avatar Apr 29 '21 16:04 EndrII

try the extraDataOut option. This option sets relative path to an output directory of an extra data

cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins

@kartaris it looks very similar to what you are suggesting, why doesn't it suit you?

EndrII avatar Apr 29 '21 16:04 EndrII

try the extraDataOut option.

This option sets relative path to an output directory of an extra data


cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins

It puts all extraData into one folder. I have other files to be added into the root folder and another folders there.

kartaris avatar Apr 29 '21 16:04 kartaris

use the separate packages for solve this issue.

cqtdeployer  -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""

  • This we create a two packages extraDataPackage1 and extraDataPackage2 -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5

  • This we set for created packages custom out directories
    -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2

  • This we reset prefixes of new packages because by default is equals a package name -prefix extraDataPackage1;"",extraDataPackage2;""

EndrII avatar Apr 29 '21 16:04 EndrII

or use a config file

{
    "targetPackage": [
        [ "extraDataPackage1" ], [ "extraDataPackage2" ]
    ],
    "extraData": [
        [
            "extraDataPackage1",
            "MyExtraData1",
            "MyExtraData2",
            "MyExtraData3"
        ],
        [
            "extraDataPackage2",
            "MyExtraData4",
            "MyExtraData5"
        ]
    ],

    "prefix": [
        [ "extraDataPackage1", "" ],
        [ "extraDataPackage2", "" ]
    ],

    "extraDataOut": [
        [ "extraDataPackage1", "MyExtraDir1" ],
        [ "extraDataPackage2", "MyExtraDir2" ]
    ]

}

EndrII avatar Apr 29 '21 16:04 EndrII

use the separate packages for solve this issue.

cqtdeployer  -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""
* This we create a two packages extraDataPackage1 and extraDataPackage2
  **-extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5**

* This we set for created packages custom out directories
  **-extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2**

* This we reset prefixes of new packages because by default is equals   a package name
  **-prefix extraDataPackage1;"",extraDataPackage2;""**

in this case, you may also need to initialize the packages before adding extraData for them

cqtdeployer  -targetPackage extraDataPackage1,extraDataPackage2 -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""

EndrII avatar Apr 29 '21 16:04 EndrII

I'm sorry, but these examples are not working due to minor inaccuracies i prepare example for you with deploy script and extra data files.

check this please

cqtdeployer -targetPacakge "extraDataPackage1,extraDataPackage2" -extraData "extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5" -extraDataOut "extraDataPackage1;MyEstraDir1,extraDataPackage2;MyEstraDir2" -prefix "extraDataPackage1;/,extraDataPackage2;/" allowEmptyPackages

example.zip

EndrII avatar Apr 29 '21 16:04 EndrII

I'm sorry, but these examples are not working due to minor inaccuracies

i prepare example for you with deploy script and extra data files.

check this please


cqtdeployer -targetPacakge "extraDataPackage1,extraDataPackage2" -extraData "extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5" -extraDataOut "extraDataPackage1;MyEstraDir1,extraDataPackage2;MyEstraDir2" -prefix "extraDataPackage1;/,extraDataPackage2;/" allowEmptyPackages



example.zip

Thanks. I will try, maybe it's something what I need.

kartaris avatar Apr 29 '21 18:04 kartaris

@kartaris my suggestion help you? if yes please close this issue.

EndrII avatar May 01 '21 08:05 EndrII

@kartaris I Think than you suggestion is very good. i want to add more functionality for the extraData option and remove the extraDataOut option. Example:

{
"extraData": ["myTarget/path:releative/put/path"]
}

EndrII avatar May 18 '21 14:05 EndrII

Hello Endrll, unfortunately I still struggle with these options. According to your suggestion it is possible to create a separate (deb) package for the extra data but it means that one need to install it separately. Also I defined 2 extra data packages but only one of them created. It is also not allowed to copy to system directories only to /opt -> -prefix "extraDataPackage1;/" will copy package to /opt directory.

What I would like to achieve is

  1. configurable target location of different extra data, folders or files without the need of installing multiple deb packages
  2. be able to place specific files to system dirs : eg. /etc/udev/rules.d/

What do you suggest?

thanks

lzalanyi avatar Mar 16 '23 14:03 lzalanyi

@lzalanyi you can use the extraData and extraDataOut options

cqtdeployer -extraData "path/to/extra/data/folder" -extraDataOut "releative/path/of/your/package/root/dir"

extraDataOut can contain ".." Dir, but it can work only for deb packages.

EndrII avatar Aug 15 '23 07:08 EndrII