Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Blade maintain directory structure in the xcassets folder? #3

Open
rex-remind101 opened this issue Oct 2, 2015 · 1 comment
Open
Labels

Comments

@rex-remind101
Copy link

One of the great things about Xcode's xcassets Import feature is if you import from a folder it will maintain the directory structure the images were in. Does Blade do this automatically?

@jondot
Copy link
Owner

jondot commented Oct 2, 2015

It will actually just "stalk" the existing folder structure. So, anything with a Contents.json (typically image catalogs) will be a valid output path for Blade.

If paths are already defined in an existing Contents.json -> Blade will use those by default.
If not, then the file format will be output by blade's own definitions, here's such an output:

-rw-r--r--  1 Dotan  staff   1.6K Sep 29 23:07 Contents.json
-rw-r--r--  1 Dotan  staff   1.6K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   4.2K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   2.5K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   6.6K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   6.1K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff    16K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   4.2K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   7.4K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff   6.6K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff    12K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff    12K Sep 29 23:07 [email protected]
-rw-r--r--  1 Dotan  staff    20K Sep 29 23:07 [email protected]

Here's a sample mapping (Bladefile), I took the liberty of commenting these for you:

blades:
  - source: assets/app-icon.png # this is the source asset file
    mount: SnappyScan/Images.xcassets/AppIcon.appiconset  # this is where the generated files would be dumped into
    contents: true   # generate a new catalog, doesn't matter what's already in there
  - source: assets/splash-icon.png
    mount: SnappyScan/Images.xcassets/SplashIcon.imageset
    contents: true

So you see, Blade will work with what's already there, and not generate its own tree structure. This is by design.
Nevertheless, this project is open to other ideas - bring them in if you have them.

@jondot jondot added the how-to label Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants