-->

depswriter.py complains 'The command line is t

2019-08-14 07:26发布

问题:

I tried to create deps.js file using 'closure-library\closure\bin\build\depswriter.py' in Windows 7. My python version is 2.7.3. Its complaining 'The command line is too long'.

Its working perfectly fine in Linux.

Any solution to make it work in windows.

回答1:

To work around the Windows command-line limitation with depswriter.py, you can use the following flags to recursively scan directories for JavaScript files:

--root               A root directory to scan for JS source files. Paths of JS 
                     files in generated deps file will be relative to this path. 
                     This flag may be specified multiple times.  

--root_with_prefix   A root directory to scan for JS source files, plus a prefix
                     (if either contains a space, surround with quotes).  Paths 
                     in generated deps file will be relative to the root, but 
                     preceded by the prefix. This flag may be specified multiple 
                     times.


In many cases, an entire project can be specified using one --root flag.