1

I am writing a GYP file for my project. When I use 'copies' to copy a directory, the content does not get copied in windows platform (target as 'win'). But, coping a single file using 'copies' is successful (I am able to copy a single file; but not a folder.)

However, the content gets copied (individual files as well as folders) in other platforms (Linux, mac).

Below is the snippet from my gyp file.

##### Variables section
'unitTestContentFoldersWin':
 [
   '<(PACKAGE_ROOT)/dependencies/resources',
 ],

'unitTest1':
 [
   '<(PACKAGE_ROOT)/dependencies/resources/abc.txt',
 ],

##### Target is 'win'

'copies': 
 [
    {  
       # This does not work ! 
       'destination': '<(PACKAGE_ROOT)/build/bin/',
       'files': ['<@(unitTestContentFoldersWin)'],
    },
    {  
        # This works !
       'destination': '<(PACKAGE_ROOT)/build/bin/',
       'files': ['<@(unitTest1)'],
    },
 ],

1 Answers1

2

Try to add a slash at the end of directory path to copy the whole directory :

'unitTestContentFoldersWin':
 [
   '<(PACKAGE_ROOT)/dependencies/resources/',
 ],

As I remember, gyp copies also support asterisk mask to copy entries of the directory:

'unitTestContentFoldersWin':
 [
   '<(PACKAGE_ROOT)/dependencies/resources/*',
 ],
pmed
  • 1,536
  • 8
  • 13