www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DUB copyFiles for subPackages

reply Dmitriy <dmitriy.mihaylichenko gmail.com> writes:
{
         ...
	"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
Dec 17 2019
parent reply Andre Pany <andre s-e-a-p.de> writes:
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é
Dec 17 2019
parent Dmitriy <dmitriy.mihaylichenko gmail.com> writes:
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?
Dec 17 2019