dart-archive / custom-element-apigen

Tool to generate Dart APIs for polymer custom elements written in Javascript
BSD 3-Clause "New" or "Revised" License
13 stars 13 forks source link

Behaviors of two components #47

Open Hecatoncheir opened 8 years ago

Hecatoncheir commented 8 years ago

Hi. In lib/src I have two directories with behavior file with same name:

lib/src/selection-mgr/behavior.html
lib/src/undo-mgr/behavior.html

In files_to_generate section I write:

files_to_generate:
    - selection-mgr/behavior.html
    - undo-mgr/behavior.html

In lib/src I get one behavior.dart with UndoMgrBehavior, that have write after selection-mgr.

Can behavior.dart content more one behavior? Or how I can change output file name or path? Or how I can do it right?

jakemac53 commented 8 years ago

So there is a file_overrides option, which lets you override what file a specific class should go into. It is used like this:

files_to_generate:
    - selection-mgr/behavior.html:
        file_overrides:
          selection_mgr_behavior: # Will create a corresponding *.dart *.html *_nodart.html
            - SelectionMgrBehavior
    - undo-mgr/behavior.html

I think the original behavior.* files will still be output, but wouldn't define anything. You could just manually delete them.

Ideally there would be a more specific option which just renamed the output file, but that doesn't exist today.

Hecatoncheir commented 8 years ago

Thanks for explain.