Thread overview
DUB copyFiles for subPackages
Dec 17, 2019
Dmitriy
Dec 17, 2019
Andre Pany
Dec 17, 2019
Dmitriy
December 17, 2019
{
        ...
	"configurations": [
		{
                        ...
			"targetPath": "/build",
			"copyFiles": [
				"/template"
			],
			"dependencies": {
				"package": { "path": "./source/package" }
			},
			"subPackages": [
				{
					"name": "package",
					"sourcePaths": ["/source/package"],
					"importPaths": ["/source/package"],
	                                "targetPath": "/template",
	                                "targetName": "./package",
	                                "copyFiles": [
		                          "some_file"
	                                ]
				}
			]
		}
	]
}

Hello.
I have a dub project which contains another one subProject in source dir.
I need some files to be copied when subPackage builds. And I expect files to be copied to
"targetPath": "/template" of subProject, but it copies to "targetPath": "/build", which is root output project
Should copyFiles for subPackage use it's target path

December 17, 2019
On Tuesday, 17 December 2019 at 13:03:17 UTC, Dmitriy wrote:
> {
>         ...
> 	"configurations": [
> 		{
>                         ...
> 			"targetPath": "/build",
> 			"copyFiles": [
> 				"/template"
> 			],
> 			"dependencies": {
> 				"package": { "path": "./source/package" }
> 			},
> 			"subPackages": [
> 				{
> 					"name": "package",
> 					"sourcePaths": ["/source/package"],
> 					"importPaths": ["/source/package"],
> 	                                "targetPath": "/template",
> 	                                "targetName": "./package",
> 	                                "copyFiles": [
> 		                          "some_file"
> 	                                ]
> 				}
> 			]
> 		}
> 	]
> }
>
> [...]

Could you check whether you can use variable $PACKAGE_DIR or $ROOT_PACKAGE_DIR
in copyFiles command to specify the correct folder?

Kind regards
André
December 17, 2019
copyFiles in subPackage finds file correct, so changing it gives "file not found".

Also subPackage builds into "targetPath": "/template" as expected.

But copyFiles uses "targetPath": "/build" instead of using it's local "targetPath": "/template".

I just assumed if targetPath has been set in subPackage then all commands for this package should use its targetPath config as a destination folder

if there somebody of dub distributors please check is it a bug?