blade
blade copied to clipboard
Does Blade maintain directory structure in the xcassets folder?
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?
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.