jeeebot
Jeeebot is a constants generator for XCode Projects that is written with Node.JS.
Using NSString*
as a key easily cause serious misstake that is hard to find.
Jeeebot generates keys as constants so, Compiler can check this errors easiy.
XCode also prevent mistake and can suggest code completion with Jeeebot
Jeeebot can generate constants for:
- Localized String Keys for
.strings
files. - Segue Identifiers from
.Stroyboard
files. - Reuse Identifiers from
.Stroyboard
and .xib
files. - Named Image keys from
.asset
files. - Entity names, attribute names and fetch requests from core data model definition.
Jeeebot can be used as cli tool or can be integrated with XCode.
This project was started to use for my commercial ios projects.
I'v helped a lot from great open source communities about the developing ios apps.
Now I'm contributing my tool to pay back.
Installation
You need to install node to use jeeebot.
$ npm install jeeebot -g
$ jeeebot -h
Usage:
jeeebot [OPTIONS] [ARGS]
Options:
-t, --type STRING Generator type: segue | reuse | strings | asset |
coredata | plist
--fieldStyle [STRING] Field naming style: uppercase | camelcase (Default is camelcase)
--fieldPrefix [STRING] Prefix for field name (Default is k)
-c, --copyright [STRING] Copyright (Default is Jeeeyul Lee<jeeeyul@gmail.com>)
-o, --output PATH Output file
-h, --help Display help and usage details
Keys for localized string
en.lproj/strings.strings:
# Jeeebot
"hello" = "Hello";
ko.lproj/strings.strings:
# Jeeebot
"hello" = "안녕하세요!";
$ jeeebot -t strings *.lproj/strings.strings --fieldPrefix kLang -o strings.h
will generates:
#ifndef strings_h
#pragma mark - Jeeebot
static NSString* const kLangHello = @"hello";
#endif
Keys for segue identifier
$ jeeebot -t segue Storyboard.storyboard --fieldPrefix kSegue -o SegueIdentifiers.h
#ifndef RPSegues_derived_h
#pragma mark - Root View Controller
static NSString* const kSegueEditSort = @"edit-sort";
static NSString* const kSegueShow = @"show";
#pragma mark - Calendar Settings Editor
static NSString* const kSegueEditPriorityFilter = @"edit-priority-filter";
static NSString* const kSegueEditDueFilter = @"edit-due-filter";
#endif
Keys for Reuse Identifiers
$ jeeebot -t reuse Storyboard.storyboard --fieldPrefix kReuse -o ReuseIdentifiers.h
#ifndef RPReuses_derived_h
#pragma mark - Sort Controller
static NSString* const kReuseDefault = @"default";
#endif
Keys for Image Assets
$ jeeebot -t asset Media.assets --fieldPrefix kImage -o NamedImages.h
#ifndef RPImages_derived_h
#pragma mark - default
static NSString* const kImageAppIcon = @"AppIcon";
static NSString* const kImageLogo = @"Logo";
#endif
Keys for Core Data entities and attributes
$ jeeebot -t coredata "Test.xcdatamodeld/Test 4.xcdatamodel" --fieldPrefix kModel -o ModelKeys.h
#ifndef RPModelKeys_derived_h
#pragma mark - RPCalendarSettings
static NSString* const kModelRPCalendarSettings = @"RPCalendarSettings";
static NSString* const kModelRPCalendarSettingsCalendarIdentifier = @"calendarIdentifier";
static NSString* const kModelRPCalendarSettingsDisplayInWidget = @"displayInWidget";
static NSString* const kModelRPCalendarSettingsDisplayNotScheduled = @"displayNotScheduled";
static NSString* const kModelRPCalendarSettingsDueDateFilter = @"dueDateFilter";
static NSString* const kModelRPCalendarSettingsFilterCompoundRule = @"filterCompoundRule";
static NSString* const kModelRPCalendarSettingsOrder = @"order";
static NSString* const kModelRPCalendarSettingsPriorityFilter = @"priorityFilter";
static NSString* const kModelRPCalendarSettingsUseDueDateFilter = @"useDueDateFilter";
static NSString* const kModelRPCalendarSettingsUsePriorityFilter = @"usePriorityFilter";
#endif