Skip to content

More advanced extraFiles #650

@ha-D

Description

@ha-D

I have a project structure such as below:

└── MainProject
    ├── OtherProject
    │   ├── app
    │   └── dist
    ├── app
    └── dist

Where OtherProject is a separate project with its own git repository. I want to have the binary outputs of OtherProject to be included in the MainProject bundle, I'm using the extraFiles option to do so. The directory structure I want to get from my build is (for osx):

└── Contents
    ├── Frameworks
    ├── Info.plist
    ├── MacOS
    │   ├── mainproject
    │   └── otherproject
    └── Resources

But since extraFiles copies everything with the original directory structure relative to the project root, I can only get:

└── Contents
    ├── Frameworks
    ├── Info.plist
    ├── MacOS
    │   └── mainproject
    ├── OtherProject
    │   └── dist
    │       └── otherproject
    └── Resources

Although it's possible to get the app content structure I want by restructuring the directories before build, it's kind of an inconvenience.

I propose that aside from the glob patterns, extraFiles also accepts JSON objects with a structure such as:

{
  "from": "path/to/src",
  "to": "path/to/dst",
  "filter": ["glob patterns"]
}

Where from specifies the base directory to be copied from relative to the project root, to specifies the directory to be copied to relative to the app's content directory and filter specifies patterns to match when copying.

This would effectively solve issue #597 as well, as from can be a parent directory.

If you approve of this, I could send a pull request myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions