puls / objc-codegenutils

Three small tools to help you meet Xcode halfway.
Other
507 stars 26 forks source link

Workflow for objc-colordump #11

Open drodriguez opened 10 years ago

drodriguez commented 10 years ago

I have started using objc-colordump, but I find it a little bit complicated to use when you are changing the palette colors.

My setup: I created the palette with one color, then I copied the clr file to my working directory, and set up the build phase invoking objc-colordump, pointing to the clr file in my working copy.

At this moment, if I modify the palette (add a color, remove a color,…), the file that changes is the one in ~/Library/Colors, but everytime I recompile my project, since the tool “install” the palette again, my changes get overwritten. I have to remember to copy back the palette in the Library to my working copy before recompiling. This doesn't make things very easy (and I have lost a couple of colors because of this).

I trying soft-linking the ~/Library/Colors palette to the one in my working directory, and the link gets overwritten during the compilation.

My question is, how are you using the tool while creating new colors in the palette? Do you manually copy the clr file each time it gets modified?

Thanks.

afnanahmad commented 9 years ago

@drodriguez use following command to point to Palette file in ~/Library/Colors objc-colordump -f "$USER_LIBRARY_DIR"/Colors/<palette-name>.clr -o Resources/Gen

drodriguez commented 9 years ago

Thanks @afnan-ahmad, but I want to distribute the clr file in the repository. Unfortunately your solution will imply copying it from the repository to the Library folder at least once, and also I will need to copy it back to the repository everytime I make changes. I can probably automate those two steps, but I don’t think the people from Square use that workflow, or they will have pointed at it in the README file.

afnanahmad commented 9 years ago

@drodriguez I understand what you are trying to do. But every time a palette is change, it changes the file in ~/Library/Colors even if you open that .clr file from any other location. My solution reads file in ~/Library/Colors and generate Code file for that palette.