cocoapods-icemobile-plugin 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.yardopts +2 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +12 -0
- data/README.md +6 -0
- data/Rakefile +18 -0
- data/cocoapods-icemobile-plugin.gemspec +21 -0
- data/fixtures/.gitignore.erb +27 -0
- data/fixtures/BootstrapDelegate.h.erb +18 -0
- data/fixtures/BootstrapDelegate.m.erb +266 -0
- data/fixtures/Info.plist.erb +50 -0
- data/fixtures/Podfile.erb +4 -0
- data/fixtures/Prefix.pch.erb +13 -0
- data/fixtures/README.md.erb +1 -0
- data/fixtures/SidebarContainerViewControllerSkinner.h.erb +13 -0
- data/fixtures/SidebarContainerViewControllerSkinner.m.erb +28 -0
- data/fixtures/main.m.erb +16 -0
- data/lib/cocoapods-icemobile-plugin.rb +3 -0
- data/lib/cocoapods-icemobile-plugin/version.rb +3 -0
- data/lib/cocoapods_plugin.rb +59 -0
- data/lib/pod/command/icegenerate.rb +140 -0
- data/lib/pod/helper/project_builder.rb +137 -0
- data/lib/pod/helper/template_file.rb +138 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1b0945d305a0d944e393ffefda4761a2757a93c5
|
4
|
+
data.tar.gz: 707f50f12a707bfa0662b239eb2ab78bc5e92595
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c44172d72d2c36a8f887c174653084cf7eaf005cb37eca590871410051602b7fdfed4a7eeb2a34cf14c71db366f1b49383a28820a4edcce1df991299db757597
|
7
|
+
data.tar.gz: 3ce00016f88609d7091a1d4d04731ab9820617cf1b5f875ec463165a9e69b34ae45ab6609b8f494de7688b977d8c78dbc2fb4505566ff4c18868ec873feafbc1
|
data/.gitignore
ADDED
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem 'cocoapods'
|
7
|
+
gem 'bacon'
|
8
|
+
gem 'mocha-on-bacon'
|
9
|
+
gem 'mocha', '~> 0.11.4'
|
10
|
+
gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
|
11
|
+
gem "fakefs", :require => "fakefs/safe"
|
12
|
+
end
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
def gem_version
|
2
|
+
require File.expand_path('../lib/cocoapods-icemobile-plugin/version.rb', __FILE__)
|
3
|
+
CocoapodsIcemobilePlugin::VERSION
|
4
|
+
end
|
5
|
+
|
6
|
+
def gem_filename
|
7
|
+
"cocoapods-icemobile-plugin-#{gem_version}.gem"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Build a gem for the current version"
|
11
|
+
task :build do
|
12
|
+
sh "gem build cocoapods-icemobile-plugin.gemspec"
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Install a gem version of the current code"
|
16
|
+
task :install => :build do
|
17
|
+
sh "gem install #{gem_filename}"
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-icemobile-plugin/version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "cocoapods-icemobile-plugin"
|
8
|
+
spec.version = CocoapodsIcemobilePlugin::VERSION
|
9
|
+
spec.authors = ["Sumeru Chatterjee"]
|
10
|
+
spec.summary = %q{CocoaPods plugin for internal icemobile projects.}
|
11
|
+
spec.homepage = "http://www.icemobile.com"
|
12
|
+
spec.email = "sumeru@icemobile.com"
|
13
|
+
spec.description = "IceMobile Plugin for CocoaPods (Used within IceMobile for internal projects."
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency 'cocoapods','~> 0.29'
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# OS X
|
2
|
+
.DS_Store
|
3
|
+
.Trashes
|
4
|
+
*.swp
|
5
|
+
*.lock
|
6
|
+
*~.nib
|
7
|
+
DerivedData/
|
8
|
+
build/
|
9
|
+
*.pbxuser
|
10
|
+
*.mode1v3
|
11
|
+
*.mode2v3
|
12
|
+
*.perspectivev3
|
13
|
+
!default.pbxuser
|
14
|
+
!default.mode1v3
|
15
|
+
!default.mode2v3
|
16
|
+
!default.perspectivev3
|
17
|
+
xcuserdata
|
18
|
+
|
19
|
+
#git
|
20
|
+
*.moved-aside
|
21
|
+
*.orig
|
22
|
+
|
23
|
+
# CocoaPods
|
24
|
+
Pods
|
25
|
+
|
26
|
+
#Revision
|
27
|
+
<%= @project_name %>/Revision
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// <%= @project_prefix %>BootstrapDelegate.h
|
3
|
+
// <%= @project_name %>
|
4
|
+
//
|
5
|
+
// Created by cocoapods-icemobile-plugin
|
6
|
+
// Copyright (c) <%= @project_year %> IceMobile. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <CoreProductModules/BFCoreApplicationDelegate.h>
|
10
|
+
|
11
|
+
@interface <%= @project_prefix %>BootstrapDelegate : BFCoreApplicationDelegate
|
12
|
+
|
13
|
+
@property (nonatomic, strong) BFStringSettingsItem <BFStaticSetting> *revision;
|
14
|
+
@property (nonatomic, strong) BFActionSettingsItem *resetSettingsItem;
|
15
|
+
@property (nonatomic, strong) BFDynamicContentSettingsItem *termsAndConditionsSetting;
|
16
|
+
@property (nonatomic, strong) BFDynamicContentSettingsItem *privacyPolicySetting;
|
17
|
+
|
18
|
+
@end
|
@@ -0,0 +1,266 @@
|
|
1
|
+
//
|
2
|
+
// <%= @project_prefix %>BootstrapDelegate.m
|
3
|
+
// <%= @project_name %>
|
4
|
+
//
|
5
|
+
// Created by cocoapods-icemobile-plugin
|
6
|
+
// Copyright (c) <%= @project_year %> IceMobile. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "revision.h"
|
10
|
+
#import "<%= @project_prefix %>BootstrapDelegate.h"
|
11
|
+
#import <ParisHilton/BFDebugService.h>
|
12
|
+
|
13
|
+
@implementation <%= @project_prefix %>BootstrapDelegate
|
14
|
+
|
15
|
+
#pragma mark - BFBootstrapDelegate
|
16
|
+
|
17
|
+
- (BFModuleConfiguration *)moduleConfigurationForBootstrap:(BFBootstrap *)bootstrap {
|
18
|
+
|
19
|
+
BFModuleConfiguration *config = [super moduleConfigurationForBootstrap:bootstrap];
|
20
|
+
|
21
|
+
// ShoppingList
|
22
|
+
{
|
23
|
+
BFSettingsSection *section = [BFSettingsSection sectionWithTitle:@"Shopping List" order:1];
|
24
|
+
|
25
|
+
[config addImplementation:[BFShoppingListService class] forProtocol:@protocol(BFShoppingListService) configureBlock:^(BFShoppingListService *service) {
|
26
|
+
service.updateWithTimeInterval.groupItem = self.debugSettingsGroup;
|
27
|
+
service.updateWithTimeInterval.visible = YES;
|
28
|
+
service.updateWithTimeInterval.section = section;
|
29
|
+
service.updateWithTimeInterval.title = @"List Update Interval";
|
30
|
+
|
31
|
+
service.maximumNumberOfShoppingListItems.groupItem = self.debugSettingsGroup;
|
32
|
+
service.maximumNumberOfShoppingListItems.visible = YES;
|
33
|
+
service.maximumNumberOfShoppingListItems.section = section;
|
34
|
+
service.maximumNumberOfShoppingListItems.title = @"Max List Item";
|
35
|
+
|
36
|
+
service.testThousandShoppingListItems.groupItem = self.debugSettingsGroup;
|
37
|
+
service.testThousandShoppingListItems.visible = YES;
|
38
|
+
service.testThousandShoppingListItems.section = section;
|
39
|
+
service.testThousandShoppingListItems.title = @"Set 1000 Items";
|
40
|
+
}];
|
41
|
+
[config addImplementation:[BFShoppingListUIProvider class] forProtocol:@protocol(BFShoppingListUIProvider) configureBlock:^(BFShoppingListUIProvider *provider) {
|
42
|
+
|
43
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:0];
|
44
|
+
|
45
|
+
provider.shoppingListOverlayButtonEnabled.groupItem = self.debugSettingsGroup;
|
46
|
+
provider.shoppingListOverlayButtonEnabled.visible = YES;
|
47
|
+
provider.shoppingListOverlayButtonEnabled.section = section;
|
48
|
+
provider.shoppingListOverlayButtonEnabled.title = @"Shopping List Button";
|
49
|
+
}];
|
50
|
+
|
51
|
+
[config addImplementation:[BFAutocompleteService class] forProtocol:@protocol(BFAutocompleteService) configureBlock:NULL];
|
52
|
+
}
|
53
|
+
[config addDynamicModule:@"Shopping List" order:0 enabledByDefault:YES forProtocols:@[@protocol(BFShoppingListService), @protocol(BFShoppingListUIProvider), @protocol(BFAutocompleteService)]];
|
54
|
+
|
55
|
+
|
56
|
+
// Stamps
|
57
|
+
{
|
58
|
+
BFSettingsSection *section = [BFSettingsSection sectionWithTitle:@"Stamps" order:1];
|
59
|
+
|
60
|
+
[config addImplementation:[BFJoinProgramService class] forProtocol:@protocol(BFJoinProgramService) configureBlock:^(BFJoinProgramService *service) {
|
61
|
+
service.identitySettingsItem.section = [BFSettingsSection sectionWithTitle:BFLocalizedString(@"stampsCard_label_settingsHeaderTitle") order:0];
|
62
|
+
}];
|
63
|
+
[config addImplementation:[BFJoinProgramUIProvider class] forProtocol:@protocol(BFJoinProgramUIProvider) configureBlock:NULL];
|
64
|
+
|
65
|
+
[config addImplementation:[BFStampsService class] forProtocol:@protocol(BFStampsService) configureBlock:NULL];
|
66
|
+
[config addImplementation:[BFStampsUIProvider class] forProtocol:@protocol(BFStampsUIProvider) withId:@"stamps" configureBlock:^(BFStampsUIProvider *provider) {
|
67
|
+
|
68
|
+
BFMenuSection *stampsSection = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:1];
|
69
|
+
provider.menuItem.section = stampsSection;
|
70
|
+
provider.menuItem.order = 0;
|
71
|
+
|
72
|
+
provider.rewardsMenuItem.section = stampsSection;
|
73
|
+
provider.rewardsMenuItem.order = 1;
|
74
|
+
|
75
|
+
provider.myCollectionMenuItem.section = stampsSection;
|
76
|
+
provider.myCollectionMenuItem.order = 2;
|
77
|
+
|
78
|
+
provider.programInfoMenuItem.section = stampsSection;
|
79
|
+
provider.programInfoMenuItem.order = 3;
|
80
|
+
|
81
|
+
provider.topMenuEnabledSetting.groupItem = self.debugSettingsGroup;
|
82
|
+
provider.topMenuEnabledSetting.visible = YES;
|
83
|
+
provider.topMenuEnabledSetting.section = section;
|
84
|
+
provider.topMenuEnabledSetting.title = @"Top Menu Enabled";
|
85
|
+
|
86
|
+
provider.rewardsDisplayTypeSetting.groupItem = self.debugSettingsGroup;
|
87
|
+
provider.rewardsDisplayTypeSetting.visible = YES;
|
88
|
+
provider.rewardsDisplayTypeSetting.section = section;
|
89
|
+
provider.rewardsDisplayTypeSetting.title = @"Rewards Display Type";
|
90
|
+
|
91
|
+
provider.myCollectionDisplayTypeSetting.groupItem = self.debugSettingsGroup;
|
92
|
+
provider.myCollectionDisplayTypeSetting.visible = YES;
|
93
|
+
provider.myCollectionDisplayTypeSetting.section = section;
|
94
|
+
provider.myCollectionDisplayTypeSetting.title = @"My Collection Display Type";
|
95
|
+
}];
|
96
|
+
}
|
97
|
+
[config addDynamicModule:@"Stamps" order:1 enabledByDefault:YES forProtocols:@[@protocol(BFJoinProgramService), @protocol(BFJoinProgramUIProvider), @protocol(BFStampsService), @protocol(BFStampsUIProvider)]];
|
98
|
+
|
99
|
+
|
100
|
+
// ProductAnnouncements
|
101
|
+
{
|
102
|
+
BFSettingsSection *section = [BFSettingsSection sectionWithTitle:@"Product Announcements" order:1];
|
103
|
+
|
104
|
+
[config addImplementation:[BFProductAnnouncementsService class] forProtocol:@protocol(BFProductAnnouncementsService) configureBlock:^(BFProductAnnouncementsService *service) {
|
105
|
+
|
106
|
+
BFGroupSettingsItem *promotionsBannerGroupItem = [[BFGroupSettingsItem alloc] init];
|
107
|
+
promotionsBannerGroupItem.section = section;
|
108
|
+
promotionsBannerGroupItem.title = @"Promotions Banner Settings";
|
109
|
+
promotionsBannerGroupItem.groupItem = self.debugSettingsGroup;
|
110
|
+
|
111
|
+
BFSettingsSection *bannerSection = [BFSettingsSection sectionWithTitle:@"Promotions Banner" order:0];
|
112
|
+
|
113
|
+
service.productBannerViewTimeInterval.groupItem = promotionsBannerGroupItem;
|
114
|
+
service.productBannerViewTimeInterval.visible = YES;
|
115
|
+
service.productBannerViewTimeInterval.section = bannerSection;
|
116
|
+
service.productBannerViewTimeInterval.order = 0;
|
117
|
+
service.productBannerViewTimeInterval.title = @"Banner time interval";
|
118
|
+
|
119
|
+
service.productBannerViewShouldTurnPageDirection.groupItem = promotionsBannerGroupItem;
|
120
|
+
service.productBannerViewShouldTurnPageDirection.visible = YES;
|
121
|
+
service.productBannerViewShouldTurnPageDirection.section = bannerSection;
|
122
|
+
service.productBannerViewShouldTurnPageDirection.order = 1;
|
123
|
+
service.productBannerViewShouldTurnPageDirection.title = @"Turn banner direction";
|
124
|
+
|
125
|
+
service.maxNumberProductBannerItems.groupItem = promotionsBannerGroupItem;
|
126
|
+
service.maxNumberProductBannerItems.visible = YES;
|
127
|
+
service.maxNumberProductBannerItems.section = bannerSection;
|
128
|
+
service.maxNumberProductBannerItems.order = 2;
|
129
|
+
service.maxNumberProductBannerItems.title = @"Max. numb. banner items";
|
130
|
+
|
131
|
+
service.productBannerViewShouldAnimatedLastTransition.groupItem = promotionsBannerGroupItem;
|
132
|
+
service.productBannerViewShouldAnimatedLastTransition.visible = YES;
|
133
|
+
service.productBannerViewShouldAnimatedLastTransition.section = bannerSection;
|
134
|
+
service.productBannerViewShouldAnimatedLastTransition.order = 3;
|
135
|
+
service.productBannerViewShouldAnimatedLastTransition.title = @"Animate last banner transition";
|
136
|
+
|
137
|
+
service.detailInShoppingListIFFValidSetting.visible = YES;
|
138
|
+
service.detailInShoppingListIFFValidSetting.groupItem = self.debugSettingsGroup;
|
139
|
+
service.detailInShoppingListIFFValidSetting.section = section;
|
140
|
+
service.detailInShoppingListIFFValidSetting.title = @"Detail in Shopping List IFF valid";
|
141
|
+
service.detailInShoppingListIFFValidSetting.defaultValue = @(YES);
|
142
|
+
}];
|
143
|
+
|
144
|
+
[config addImplementation:[BFSpecialOffersUIProvider class] forProtocol:@protocol(BFSpecialOffersUIProvider) configureBlock:^(BFSpecialOffersUIProvider *provider) {
|
145
|
+
|
146
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:2];
|
147
|
+
|
148
|
+
provider.displayTypeSetting.visible = YES;
|
149
|
+
provider.displayTypeSetting.groupItem = self.debugSettingsGroup;
|
150
|
+
provider.displayTypeSetting.section = section;
|
151
|
+
provider.displayTypeSetting.title = @"Promotions Display Type";
|
152
|
+
}];
|
153
|
+
|
154
|
+
[config addImplementation:[BFBonusStampOffersUIProvider class] forProtocol:@protocol(BFBonusStampOffersUIProvider) configureBlock:^(BFBonusStampOffersUIProvider *provider) {
|
155
|
+
|
156
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:3];
|
157
|
+
|
158
|
+
provider.displayTypeSetting.groupItem = self.debugSettingsGroup;
|
159
|
+
provider.displayTypeSetting.visible = YES;
|
160
|
+
provider.displayTypeSetting.section = section;
|
161
|
+
provider.displayTypeSetting.title = @"Bonus Stamps Display Type";
|
162
|
+
}];
|
163
|
+
|
164
|
+
[config addImplementation:[BFPromoReaderService class] forProtocol:@protocol(BFPromoReaderService) configureBlock:NULL];
|
165
|
+
}
|
166
|
+
[config addDynamicModule:@"Promotions" order:2 enabledByDefault:YES forProtocols:@[@protocol(BFProductAnnouncementsService), @protocol(BFSpecialOffersUIProvider)]];
|
167
|
+
[config addDynamicModule:@"Bonus Stamps" order:3 enabledByDefault:YES forProtocols:@[@protocol(BFProductAnnouncementsService), @protocol(BFBonusStampOffersUIProvider)]];
|
168
|
+
|
169
|
+
// Recipes
|
170
|
+
{
|
171
|
+
[config addImplementation:[BFRecipesService class] forProtocol:@protocol(BFRecipesService) configureBlock:NULL];
|
172
|
+
[config addImplementation:[BFRecipesUIProvider class] forProtocol:@protocol(BFRecipesUIProvider) configureBlock:^(BFRecipesUIProvider *provider) {
|
173
|
+
|
174
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:4];
|
175
|
+
}];
|
176
|
+
}
|
177
|
+
[config addDynamicModule:@"Recipes" order:4 enabledByDefault:YES forProtocols:@[@protocol(BFRecipesService), @protocol(BFRecipesUIProvider)]];
|
178
|
+
|
179
|
+
// StoreFinder
|
180
|
+
{
|
181
|
+
[config addImplementation:[BFStoreFinderService class] forProtocol:@protocol(BFStoreFinderService) configureBlock:NULL];
|
182
|
+
[config addImplementation:[BFStoreFinderUIProvider class] forProtocol:@protocol(BFStoreFinderUIProvider) configureBlock:^(BFStoreFinderUIProvider *provider) {
|
183
|
+
|
184
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:5];
|
185
|
+
|
186
|
+
provider.initialMapRegion = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2DMake(51.932, 5.279), 390008, 436163);
|
187
|
+
}];
|
188
|
+
}
|
189
|
+
[config addDynamicModule:@"Stores" order:5 enabledByDefault:YES forProtocols:@[@protocol(BFStoreFinderService), @protocol(BFStoreFinderUIProvider)]];
|
190
|
+
|
191
|
+
// Contact / Help
|
192
|
+
{
|
193
|
+
[config addImplementation:[BFFeedbackService class] forProtocol:@protocol(BFFeedbackService) configureBlock:NULL];
|
194
|
+
[config addImplementation:[BFContactUIProvider class] forProtocol:@protocol(BFContactUIProvider) configureBlock:^(BFContactUIProvider *provider) {
|
195
|
+
|
196
|
+
provider.menuItem.section = [BFMenuSection sectionWithTitle:provider.menuItem.section.title order:NSIntegerMax - 1];
|
197
|
+
}];
|
198
|
+
|
199
|
+
[config addImplementation:[BFFAQService class] forProtocol:@protocol(BFFAQService) configureBlock:NULL];
|
200
|
+
}
|
201
|
+
[config addDynamicModule:@"Contact" order:6 enabledByDefault:YES forProtocols:@[@protocol(BFContactUIProvider), @protocol(BFFeedbackService), @protocol(BFFAQService)]];
|
202
|
+
|
203
|
+
return config;
|
204
|
+
}
|
205
|
+
|
206
|
+
- (void)bootstrapDidCreateSettingsItems:(BFBootstrap *)bootstrap {
|
207
|
+
self.revision.section = [BFSettingsSection sectionWithTitle:BFLocalizedString(@"contact_header_settingsVersion") order:NSIntegerMax];
|
208
|
+
self.revision.title = BFLocalizedString(@"contact_label_settingsVersion");
|
209
|
+
|
210
|
+
BFSettingsSection *legalSection = [BFSettingsSection sectionWithTitle:BFLocalizedString(@"contact_header_settingsLegal") order:0];
|
211
|
+
|
212
|
+
self.termsAndConditionsSetting.section = legalSection;
|
213
|
+
self.termsAndConditionsSetting.order = 0;
|
214
|
+
self.termsAndConditionsSetting.title = BFLocalizedString(@"contact_label_settingsTermsConditions");
|
215
|
+
self.termsAndConditionsSetting.screenTitle = BFLocalizedString(@"contact_screenTitle_termsConditions");
|
216
|
+
self.termsAndConditionsSetting.dynamicContentKey = @"legalinfo";
|
217
|
+
self.termsAndConditionsSetting.trackingModule = @"settings";
|
218
|
+
self.termsAndConditionsSetting.trackingIdentifier = @"termsAndConditions";
|
219
|
+
|
220
|
+
self.privacyPolicySetting.section = legalSection;
|
221
|
+
self.privacyPolicySetting.order = 1;
|
222
|
+
self.privacyPolicySetting.title = BFLocalizedString(@"contact_label_settingsPrivacyPolicy");
|
223
|
+
self.privacyPolicySetting.screenTitle = BFLocalizedString(@"contact_screenTitle_privacyPolicy");
|
224
|
+
self.privacyPolicySetting.dynamicContentKey = @"privacypolicy";
|
225
|
+
self.privacyPolicySetting.trackingModule = @"settings";
|
226
|
+
self.privacyPolicySetting.trackingIdentifier = @"privacyPolicy";
|
227
|
+
|
228
|
+
self.resetSettingsItem.groupItem = self.debugSettingsGroup;
|
229
|
+
self.resetSettingsItem.title = @"Reset";
|
230
|
+
self.resetSettingsItem.section = bootstrap.dynamicModuleSettingsGroup.section;
|
231
|
+
[self.resetSettingsItem setActionBlock:^{
|
232
|
+
[[BFSettingsManager sharedManager] resetAllSettings];
|
233
|
+
[[BFSettingsManager sharedManager] resetUserDefaults];
|
234
|
+
[[BFBootstrap sharedBootstrap] restartBootstrap];
|
235
|
+
}];
|
236
|
+
}
|
237
|
+
|
238
|
+
- (BOOL)bootstrap:(BFBootstrap *)bootstrap didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
239
|
+
|
240
|
+
if ([bootstrap.window respondsToSelector:@selector(tintColor)]) {
|
241
|
+
bootstrap.window.tintColor = [UIColor colorWithHex:0x96C733];
|
242
|
+
}
|
243
|
+
|
244
|
+
#if DEBUG
|
245
|
+
// Revision
|
246
|
+
{
|
247
|
+
NSString *revision = <%= @project_name %>Revision;
|
248
|
+
if ([revision length] > 9) {
|
249
|
+
revision = [revision substringToIndex:9];
|
250
|
+
}
|
251
|
+
[[BFSettingsManager sharedManager] setValue:revision forSettingsItem:self.revision];
|
252
|
+
}
|
253
|
+
#endif
|
254
|
+
|
255
|
+
// Statusbar Style
|
256
|
+
{
|
257
|
+
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
|
258
|
+
}
|
259
|
+
return YES;
|
260
|
+
}
|
261
|
+
|
262
|
+
- (NSString *)skinNameForBootstrap:(BFBootstrap *)bootstrap {
|
263
|
+
return @"<%= @project_prefix %>";
|
264
|
+
}
|
265
|
+
|
266
|
+
@end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
6
|
+
<string>en</string>
|
7
|
+
<key>CFBundleDisplayName</key>
|
8
|
+
<string>${PRODUCT_NAME}</string>
|
9
|
+
<key>CFBundleExecutable</key>
|
10
|
+
<string>${EXECUTABLE_NAME}</string>
|
11
|
+
<key>CFBundleIdentifier</key>
|
12
|
+
<string><%= @project_identifier %></string>
|
13
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
14
|
+
<string>6.0</string>
|
15
|
+
<key>CFBundleName</key>
|
16
|
+
<string><%= @project_name %></string>
|
17
|
+
<key>CFBundlePackageType</key>
|
18
|
+
<string>APPL</string>
|
19
|
+
<key>CFBundleShortVersionString</key>
|
20
|
+
<string>1.0</string>
|
21
|
+
<key>CFBundleSignature</key>
|
22
|
+
<string>????</string>
|
23
|
+
<key>CFBundleVersion</key>
|
24
|
+
<string>1.0</string>
|
25
|
+
<key>LSRequiresIPhoneOS</key>
|
26
|
+
<true/>
|
27
|
+
<key>UIAppFonts</key>
|
28
|
+
<array>
|
29
|
+
<string>InterFaceCorp-Regular.ttf</string>
|
30
|
+
<string>InterFaceCorp-Bold.ttf</string>
|
31
|
+
</array>
|
32
|
+
<key>UIRequiredDeviceCapabilities</key>
|
33
|
+
<array>
|
34
|
+
<string>armv7</string>
|
35
|
+
</array>
|
36
|
+
<key>UISupportedInterfaceOrientations</key>
|
37
|
+
<array/>
|
38
|
+
<key>UISupportedInterfaceOrientations~ipad</key>
|
39
|
+
<array>
|
40
|
+
<string>UIInterfaceOrientationPortrait</string>
|
41
|
+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
42
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
43
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
44
|
+
</array>
|
45
|
+
<key>UISupportedInterfaceOrientations~iphone</key>
|
46
|
+
<array>
|
47
|
+
<string>UIInterfaceOrientationPortrait</string>
|
48
|
+
</array>
|
49
|
+
</dict>
|
50
|
+
</plist>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// Prefix header
|
3
|
+
//
|
4
|
+
// The contents of this file are implicitly included at the beginning of every source file.
|
5
|
+
//
|
6
|
+
|
7
|
+
#ifdef __OBJC__
|
8
|
+
#import <Foundation/Foundation.h>
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
#import <ParisHilton/ParisHilton.h>
|
11
|
+
#import <CoreProductModules/CoreProductModules.h>
|
12
|
+
#endif
|
13
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# Welcome to <%= @project_name %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// BFSidebarContainerViewController<%= @project_prefix %>Skinner.h
|
3
|
+
// <%= @project_name %>
|
4
|
+
//
|
5
|
+
// Created by cocoapods-icemobile-plugin
|
6
|
+
// Copyright (c) <%= @project_year %> IceMobile. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <ParisHilton/BFSidebarContainerViewControllerSkinner.h>
|
10
|
+
|
11
|
+
@interface BFSidebarContainerViewController<%= @project_prefix %>Skinner : BFSidebarContainerViewControllerSkinner
|
12
|
+
@end
|
13
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
//
|
2
|
+
// BFSidebarContainerViewController<%= @project_prefix %>Skinner.h
|
3
|
+
// <%= @project_name %>
|
4
|
+
//
|
5
|
+
// Created by cocoapods-icemobile-plugin
|
6
|
+
// Copyright (c) <%= @project_year %> IceMobile. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "BFSidebarContainerViewController<%= @project_prefix %>Skinner.h"
|
10
|
+
|
11
|
+
@implementation BFSidebarContainerViewController<%= @project_prefix %>Skinner
|
12
|
+
|
13
|
+
- (id)init {
|
14
|
+
if ((self = [super init])) {
|
15
|
+
self.headerImage = [UIImage imageNamed:@"view_core_brightShopperLogo"];
|
16
|
+
self.headerHeight = 78;
|
17
|
+
self.headerImageLeftMargin = 38;
|
18
|
+
}
|
19
|
+
return self;
|
20
|
+
}
|
21
|
+
|
22
|
+
- (void)skinObject:(BFSidebarContainerViewController *)skinnable {
|
23
|
+
[super skinObject:skinnable];
|
24
|
+
|
25
|
+
skinnable.menuTableView.automaticallyUpdateInsetsForShoppingListButton = NO;
|
26
|
+
}
|
27
|
+
|
28
|
+
@end
|
data/fixtures/main.m.erb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
//
|
2
|
+
// main.m
|
3
|
+
// <%= @project_name %>
|
4
|
+
//
|
5
|
+
// Created by cocoapods-icemobile-plugin
|
6
|
+
// Copyright (c) <%= @project_year %> IceMobile. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "<%= @project_prefix %>BootstrapDelegate.h"
|
10
|
+
|
11
|
+
int main(int argc, char * argv[])
|
12
|
+
{
|
13
|
+
@autoreleasepool {
|
14
|
+
return BFBootstrapMain(argc, argv, nil, NSStringFromClass([<%= @project_prefix %>BootstrapDelegate class]));
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'cocoapods-icemobile-plugin'
|
2
|
+
require 'cocoapods'
|
3
|
+
require 'xcodeproj'
|
4
|
+
|
5
|
+
COCOAPODS_WORKSPACE_PATH = nil
|
6
|
+
PODS_PROJECT_PATH = "Pods/Pods.xcodeproj"
|
7
|
+
BRIGHT_PROJECT_PATHS = [ "ParisHilton/ParisHilton.xcodeproj",
|
8
|
+
"CoreProductModules/CoreProductModules.xcodeproj"]
|
9
|
+
|
10
|
+
Pod::Command.class_eval do
|
11
|
+
self.description = 'CocoaPods, the Objective-C library package manager.(Plugged in by cocoapods-icemobile-plugin)'
|
12
|
+
end
|
13
|
+
|
14
|
+
Pod::Installer.class_eval do
|
15
|
+
def install!
|
16
|
+
resolve_dependencies
|
17
|
+
download_dependencies
|
18
|
+
generate_pods_project
|
19
|
+
integrate_user_project if config.integrate_targets?
|
20
|
+
if is_bright_project?
|
21
|
+
integrate_bright_projects
|
22
|
+
else
|
23
|
+
puts "Bright Project Not Detected"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def is_bright_project?
|
28
|
+
project_paths = BRIGHT_PROJECT_PATHS
|
29
|
+
project_paths.each do |project_path|
|
30
|
+
return false if !File.exist?(project_path)
|
31
|
+
end
|
32
|
+
return true
|
33
|
+
end
|
34
|
+
|
35
|
+
def integrate_bright_projects
|
36
|
+
puts "Integrating Bright Projects Into Workspace"
|
37
|
+
workspace = Xcodeproj::Workspace.new_from_xcworkspace($COCOAPODS_WORKSPACE_PATH)
|
38
|
+
|
39
|
+
project_paths = BRIGHT_PROJECT_PATHS
|
40
|
+
project_paths.each do |project_path|
|
41
|
+
workspace.projpaths.push(project_path) unless workspace.projpaths.include?(project_path)
|
42
|
+
end
|
43
|
+
|
44
|
+
pods_project_path = PODS_PROJECT_PATH
|
45
|
+
if podfile.target_definitions.values.all?{ |td| td.empty? }
|
46
|
+
workspace.projpaths.delete(pods_project_path) if workspace.projpaths.include?(pods_project_path)
|
47
|
+
end
|
48
|
+
|
49
|
+
workspace.save_as($COCOAPODS_WORKSPACE_PATH)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
Pod::Installer::UserProjectIntegrator.class_eval do
|
54
|
+
def integrate!
|
55
|
+
create_workspace
|
56
|
+
integrate_user_targets
|
57
|
+
$COCOAPODS_WORKSPACE_PATH = workspace_path
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
BRIGHT_PROJECT_URL = 'git@gitlab.development.ice.local:bright-ios/bright.git'
|
2
|
+
BRIGHT_BRANCH = 'CoreApplicationDelegate'
|
3
|
+
BRIGHT_REQUIRED = [ "CoreProductModules","ParisHilton" ]
|
4
|
+
BRIGHT_COMMON_RESOURCES = 'WhiteLabel/WhiteLabel/Resources/*'
|
5
|
+
BRIGHT_DEFAULT_ASSETCATALOG = 'WhiteLabel/Bright/Resources/Assets.xcassets'
|
6
|
+
BRIGHT_REVISION_SCRIPT = 'WhiteLabel/Generate-Revision.sh'
|
7
|
+
|
8
|
+
module Pod
|
9
|
+
class Command
|
10
|
+
class IceGenerate < Command
|
11
|
+
|
12
|
+
self.summary = "Generate a new IceMobile BrightShopper Project"
|
13
|
+
self.arguments = 'NAME','PREFIX'
|
14
|
+
|
15
|
+
def initialize(argv)
|
16
|
+
@name = argv.shift_argument
|
17
|
+
@prefix = argv.shift_argument
|
18
|
+
ENV['CP_PROJECT_NAME'] = @name
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
def validate!
|
23
|
+
super
|
24
|
+
help! "Usage: ice-generate <PROJECT_NAME> <PROJECT_PREFIX>" unless @name && @prefix
|
25
|
+
end
|
26
|
+
|
27
|
+
def run
|
28
|
+
new_project(@name)
|
29
|
+
end
|
30
|
+
|
31
|
+
public
|
32
|
+
|
33
|
+
def new_project(name)
|
34
|
+
if File.directory?("#{name}")
|
35
|
+
UI.puts"Fatal: Directory #{name} already exists. Please delete it and run again.".red
|
36
|
+
return
|
37
|
+
end
|
38
|
+
|
39
|
+
FileUtils.mkdir_p("#{@name}")
|
40
|
+
run_git_command("clone -b #{BRIGHT_BRANCH} #{BRIGHT_PROJECT_URL} ../#{@name}")
|
41
|
+
|
42
|
+
create_project_files
|
43
|
+
create_xcode_project
|
44
|
+
copy_resources
|
45
|
+
remove_unnecessary_folders
|
46
|
+
|
47
|
+
run_pod_command('install')
|
48
|
+
|
49
|
+
run_git_command("add -A")
|
50
|
+
run_git_command(%q(commit -m "Autogenerated project with cocoapods-icemobile-plugin"))
|
51
|
+
run_git_command("remote rm origin")
|
52
|
+
end
|
53
|
+
|
54
|
+
def remove_unnecessary_folders
|
55
|
+
Dir.foreach("./#{@name}") do |item|
|
56
|
+
next if item == '.' or item == '..' or item.start_with?".git" or item.start_with?"Pod" or item.start_with?"README.md" or BRIGHT_REQUIRED.include?(item) or item.start_with?"#{@name}"
|
57
|
+
UI.puts "Removing #{item}".green
|
58
|
+
FileUtils.rm_rf("./#{@name}/#{item}")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def create_project_files
|
63
|
+
#Create Directories
|
64
|
+
FileUtils.mkdir_p("#{@name}/#{@name}")
|
65
|
+
dirs = ["Supporting Files", "Skinners", "Resources", "Scripts"]
|
66
|
+
dirs.each { |dir| FileUtils.mkdir_p("#{@name}/#{@name}//#{dir}/") }
|
67
|
+
FileUtils.mkdir_p("#{@name}/#{@name}/Resources/Common/")
|
68
|
+
|
69
|
+
#Create Root Files
|
70
|
+
Dir.chdir "#{@name}" do
|
71
|
+
File.delete(".gitignore") if File.exist?(".gitignore")
|
72
|
+
Pod::Helper::Gitignore.new(@name,@prefix).file
|
73
|
+
Pod::Helper::Podfile.new(@name,@prefix).file
|
74
|
+
Pod::Helper::Readme.new(@name,@prefix).file
|
75
|
+
end
|
76
|
+
|
77
|
+
#Create Bootstrap Delegates
|
78
|
+
Dir.chdir "#{@name}/#{@name}" do
|
79
|
+
Pod::Helper::BootstrapDelegateH.new(@name,@prefix).file
|
80
|
+
Pod::Helper::BootstrapDelegateM.new(@name,@prefix).file
|
81
|
+
end
|
82
|
+
|
83
|
+
#Create Supporting Files
|
84
|
+
Dir.chdir "#{@name}/#{@name}/Supporting Files" do
|
85
|
+
Pod::Helper::InfoPlist.new(@name,@prefix).file
|
86
|
+
Pod::Helper::MainM.new(@name,@prefix).file
|
87
|
+
Pod::Helper::PrefixHeader.new(@name,@prefix).file
|
88
|
+
end
|
89
|
+
|
90
|
+
#Create SidebarContainerViewControllerSkinner
|
91
|
+
Dir.chdir "#{@name}/#{@name}/Skinners" do
|
92
|
+
Pod::Helper::SidebarContainerViewControllerSkinnerH.new(@name,@prefix).file
|
93
|
+
Pod::Helper::SidebarContainerViewControllerSkinnerM.new(@name,@prefix).file
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
def copy_resources
|
99
|
+
Dir.chdir(@name) do
|
100
|
+
UI.puts "Copying Resources from WhiteLabel".green
|
101
|
+
system("cp -r #{BRIGHT_COMMON_RESOURCES} #{@name}/Resources/Common/")
|
102
|
+
system("cp -r #{BRIGHT_DEFAULT_ASSETCATALOG} #{@name}/Resources/")
|
103
|
+
system("cp #{BRIGHT_REVISION_SCRIPT} #{@name}/Scripts")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def create_xcode_project
|
108
|
+
UI.puts "Creating #{@name}.xcodeproj"
|
109
|
+
builder = Helper::ProjectBuilder.new(@name,@prefix)
|
110
|
+
project = builder.build_project
|
111
|
+
end
|
112
|
+
|
113
|
+
def run_git_command(command)
|
114
|
+
Dir.chdir(@name) do
|
115
|
+
UI.puts "run git #{command}".green
|
116
|
+
system("git #{command}")
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def run_pod_command(command)
|
121
|
+
Dir.chdir(@name) do
|
122
|
+
UI.puts "run pod #{command}".green
|
123
|
+
system("pod #{command}")
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def run_bundle_command(command)
|
128
|
+
Dir.chdir(@name) do
|
129
|
+
_bundle_command = Gem.bin_path('bundler', 'bundle')
|
130
|
+
|
131
|
+
require 'bundler'
|
132
|
+
Bundler.with_clean_env do
|
133
|
+
UI.puts "run bundle #{command}".green
|
134
|
+
`"#{Gem.ruby}" "#{_bundle_command}" #{command}`
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require 'xcodeproj'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
module Helper
|
5
|
+
class ProjectBuilder
|
6
|
+
|
7
|
+
def initialize(name,prefix)
|
8
|
+
@name = name
|
9
|
+
@prefix = prefix
|
10
|
+
end
|
11
|
+
|
12
|
+
def build_project
|
13
|
+
create_project
|
14
|
+
configure_project
|
15
|
+
save_project
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_project
|
19
|
+
@project = Xcodeproj::Project.new(@name, false)
|
20
|
+
end
|
21
|
+
|
22
|
+
def save_project
|
23
|
+
@project.save("#{@name}/#{@name}.xcodeproj")
|
24
|
+
@project
|
25
|
+
end
|
26
|
+
|
27
|
+
def configure_project
|
28
|
+
create_groups
|
29
|
+
create_target
|
30
|
+
add_required_files
|
31
|
+
add_default_frameworks
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def create_target
|
36
|
+
@main_target = @project.new_target(:application, @name, :ios, 7.0)
|
37
|
+
@main_target.build_configuration_list.build_configurations.each do |bc|
|
38
|
+
bc.build_settings['GCC_PREFIX_HEADER'] = "$(SRCROOT)/#{@name}/Supporting Files/#{@name}-Prefix.pch"
|
39
|
+
bc.build_settings['OTHER_LDFLAGS'] = "$(inherited)"
|
40
|
+
bc.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include $(BUILT_PRODUCTS_DIR)/../../Headers"
|
41
|
+
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "6.0"
|
42
|
+
bc.build_settings['CODE_SIGN_IDENTITY'] = "iPhone Developer"
|
43
|
+
bc.build_settings['INFOPLIST_FILE'] = "$(SRCROOT)/#{@name}/Supporting Files/#{@name}-Info.plist"
|
44
|
+
bc.build_settings['ASSETCATALOG_COMPILER_APPICON_NAME'] = "AppIcon"
|
45
|
+
bc.build_settings['ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME'] = "LaunchImage"
|
46
|
+
bc.build_settings['OTHER_LDFLAGS'] = "$(inherited) -ObjC"
|
47
|
+
bc.build_settings['FRAMEWORK_SEARCH_PATHS'] = "$(inherited) $(SRCROOT)/ParisHilton/Frameworks $(SRCROOT)/CoreProductModules/Frameworks"
|
48
|
+
bc.build_settings['ARCHS'] = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"
|
49
|
+
end
|
50
|
+
|
51
|
+
#Add Create Revision Build Phase
|
52
|
+
phase_name = "Create Revision"
|
53
|
+
phase = @main_target.new_shell_script_build_phase(phase_name)
|
54
|
+
phase.shell_script = "${SRCROOT}/#{@name}/Scripts/Generate-Revision.sh ${PROJECT_NAME} ${PROJECT_DIR}/#{@name}/Revision"
|
55
|
+
phase.show_env_vars_in_log = '1'
|
56
|
+
@main_target.build_phases.delete(phase)
|
57
|
+
@main_target.build_phases.insert(0,phase) # moving create revision build phase to top
|
58
|
+
|
59
|
+
#Add Paris Hilton Static Lib
|
60
|
+
target_name = "ParisHilton";
|
61
|
+
library = @project.frameworks_group.new_product_ref_for_target(target_name, :static_library)
|
62
|
+
@main_target.frameworks_build_phase.add_file_reference(library)
|
63
|
+
|
64
|
+
#Add CoreProductModules Static Lib
|
65
|
+
target_name = "CoreProductModules";
|
66
|
+
library = @project.frameworks_group.new_product_ref_for_target(target_name, :static_library)
|
67
|
+
@main_target.frameworks_build_phase.add_file_reference(library)
|
68
|
+
|
69
|
+
#Add Google Analytics
|
70
|
+
path = "ParisHilton/Frameworks/GoogleAnalytics.framework"
|
71
|
+
gref = @project.frameworks_group.new_file(path)
|
72
|
+
@main_target.frameworks_build_phase.add_file_reference(gref, true)
|
73
|
+
|
74
|
+
#Add zbar
|
75
|
+
path = "CoreProductModules/Frameworks/zbar.framework"
|
76
|
+
zref = @project.frameworks_group.new_file(path)
|
77
|
+
@main_target.frameworks_build_phase.add_file_reference(zref, true)
|
78
|
+
end
|
79
|
+
|
80
|
+
def create_groups
|
81
|
+
@sources = @project.new_group "#{@name}"
|
82
|
+
@skinners = @sources.new_group "Skinners"
|
83
|
+
@resources = @sources.new_group "Resources"
|
84
|
+
@common_resources = @resources.new_group "Common"
|
85
|
+
@common_resources_fonts = @common_resources.new_group "Fonts"
|
86
|
+
@revision = @sources.new_group "Revision"
|
87
|
+
@supporting_files= @sources.new_group "Supporting Files"
|
88
|
+
end
|
89
|
+
|
90
|
+
def add_required_files
|
91
|
+
sources_dir = "#{@name}/"
|
92
|
+
resources_dir = "#{sources_dir}Resources/"
|
93
|
+
common_resources_dir = "#{resources_dir}Common/"
|
94
|
+
common_resources_fonts_dir = "#{common_resources_dir}Fonts/"
|
95
|
+
supporting_files_dir = "#{sources_dir}Supporting Files/"
|
96
|
+
revision_dir = "#{sources_dir}Revision/"
|
97
|
+
skinner_dir = "#{sources_dir}Skinners/"
|
98
|
+
|
99
|
+
@sources.new_file(sources_dir + BootstrapDelegateH.new(@name,@prefix).name)
|
100
|
+
adm_ref = @sources.new_file(sources_dir + BootstrapDelegateM.new(@name,@prefix).name)
|
101
|
+
|
102
|
+
@supporting_files.new_file(Readme.new(@name,@prefix).name)
|
103
|
+
@supporting_files.new_file(supporting_files_dir + InfoPlist.new(@name,@prefix).name)
|
104
|
+
@supporting_files.new_file(supporting_files_dir + PrefixHeader.new(@name,@prefix).name)
|
105
|
+
mainm_ref = @supporting_files.new_file(supporting_files_dir + MainM.new(@name,@prefix).name)
|
106
|
+
|
107
|
+
@skinners.new_file(skinner_dir + SidebarContainerViewControllerSkinnerH.new(@name,@prefix).name)
|
108
|
+
skm_ref = @skinners.new_file(skinner_dir + SidebarContainerViewControllerSkinnerM.new(@name,@prefix).name)
|
109
|
+
|
110
|
+
@revision.new_file(revision_dir + "revision.h")
|
111
|
+
rev_ref = @revision.new_file(revision_dir + "revision.m")
|
112
|
+
|
113
|
+
#Add app asset catalog
|
114
|
+
ac_ref = @resources.new_file(resources_dir + "Assets.xcassets")
|
115
|
+
|
116
|
+
#Add common files
|
117
|
+
cac_ref = @common_resources.new_file(common_resources_dir + "Assets.xcassets")
|
118
|
+
ajson_ref = @common_resources.new_file(common_resources_dir + "AnalyticsStrings.json")
|
119
|
+
ljson_ref = @common_resources.new_file(common_resources_dir + "en.lproj/LocalizableStrings.json")
|
120
|
+
istrings_ref = @common_resources.new_file(common_resources_dir + "en.lproj/InfoPlist.strings")
|
121
|
+
demo_ref = @common_resources.new_reference(common_resources_dir + "en.lproj/Demo")
|
122
|
+
|
123
|
+
#Add common fonts
|
124
|
+
f1_ref = @common_resources_fonts.new_file(common_resources_fonts_dir + "InterFaceCorp-Bold.ttf")
|
125
|
+
f2_ref = @common_resources_fonts.new_file(common_resources_fonts_dir + "InterFaceCorp-Regular.ttf")
|
126
|
+
|
127
|
+
@main_target.add_file_references([adm_ref, mainm_ref, rev_ref, skm_ref])
|
128
|
+
@main_target.add_resources([ac_ref,cac_ref,f1_ref,f2_ref,ajson_ref,ljson_ref,istrings_ref,demo_ref])
|
129
|
+
end
|
130
|
+
|
131
|
+
def add_default_frameworks
|
132
|
+
@main_target.add_system_libraries [ 'xml2', 'iconv', 'sqlite3.0', 'z' ]
|
133
|
+
@main_target.add_system_frameworks [ 'MapKit', 'QuartzCore', 'AdSupport', 'AVFoundation', 'CoreVideo', 'CoreText', 'CoreMedia', 'CoreLocation', 'CoreData', 'Foundation', 'UIKit', 'CoreGraphics', 'SystemConfiguration' ]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
require 'erb'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
module Helper
|
5
|
+
class TemplateFile
|
6
|
+
|
7
|
+
def initialize(project_name,project_prefix)
|
8
|
+
@project_name = project_name
|
9
|
+
@project_prefix = project_prefix
|
10
|
+
@project_year = Date.today.strftime('%Y')
|
11
|
+
@project_identifier = "com.icemobile.#{project_name.downcase}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def fixture_path
|
15
|
+
File.join(File.dirname(File.expand_path(__FILE__)), '../../../fixtures')
|
16
|
+
end
|
17
|
+
|
18
|
+
def write
|
19
|
+
output_file = nil
|
20
|
+
File.open(name, 'w') do |output_file|
|
21
|
+
output_file.puts template.result binding
|
22
|
+
end
|
23
|
+
output_file
|
24
|
+
end
|
25
|
+
|
26
|
+
def exists?
|
27
|
+
File.exists?(name)
|
28
|
+
end
|
29
|
+
|
30
|
+
public
|
31
|
+
|
32
|
+
def name
|
33
|
+
"TemplateFile"
|
34
|
+
end
|
35
|
+
|
36
|
+
def file
|
37
|
+
if exists?
|
38
|
+
File.read(name)
|
39
|
+
else
|
40
|
+
write
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def template
|
45
|
+
ERB.new(File.read("#{fixture_path}/#{template_name}.erb"))
|
46
|
+
end
|
47
|
+
|
48
|
+
def template_name
|
49
|
+
name
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class Gitignore < TemplateFile
|
54
|
+
def name
|
55
|
+
'.gitignore'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class BootstrapDelegateH < TemplateFile
|
60
|
+
def name
|
61
|
+
"#{@project_prefix}BootstrapDelegate.h"
|
62
|
+
end
|
63
|
+
|
64
|
+
def template_name
|
65
|
+
'BootstrapDelegate.h'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class BootstrapDelegateM < TemplateFile
|
70
|
+
def name
|
71
|
+
"#{@project_prefix}BootstrapDelegate.m"
|
72
|
+
end
|
73
|
+
|
74
|
+
def template_name
|
75
|
+
'BootstrapDelegate.m'
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
class InfoPlist < TemplateFile
|
80
|
+
def name
|
81
|
+
"#{@project_name}-Info.plist"
|
82
|
+
end
|
83
|
+
|
84
|
+
def template_name
|
85
|
+
'Info.plist'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
class MainM < TemplateFile
|
90
|
+
def name
|
91
|
+
'main.m'
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
class Podfile < TemplateFile
|
96
|
+
def name
|
97
|
+
'Podfile'
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class PrefixHeader < TemplateFile
|
102
|
+
def name
|
103
|
+
"#{@project_name}-Prefix.pch"
|
104
|
+
end
|
105
|
+
|
106
|
+
def template_name
|
107
|
+
'Prefix.pch'
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
class Readme < TemplateFile
|
112
|
+
def name
|
113
|
+
'README.md'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
class SidebarContainerViewControllerSkinnerH < TemplateFile
|
118
|
+
def name
|
119
|
+
"BFSidebarContainerViewController#{@project_prefix}Skinner.h"
|
120
|
+
end
|
121
|
+
|
122
|
+
def template_name
|
123
|
+
'SidebarContainerViewControllerSkinner.h'
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
class SidebarContainerViewControllerSkinnerM < TemplateFile
|
128
|
+
def name
|
129
|
+
"BFSidebarContainerViewController#{@project_prefix}Skinner.m"
|
130
|
+
end
|
131
|
+
|
132
|
+
def template_name
|
133
|
+
'SidebarContainerViewControllerSkinner.m'
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-icemobile-plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sumeru Chatterjee
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.29'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.29'
|
27
|
+
description: IceMobile Plugin for CocoaPods (Used within IceMobile for internal projects.
|
28
|
+
email: sumeru@icemobile.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitignore
|
34
|
+
- .yardopts
|
35
|
+
- CHANGELOG.md
|
36
|
+
- Gemfile
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- cocoapods-icemobile-plugin.gemspec
|
40
|
+
- fixtures/.gitignore.erb
|
41
|
+
- fixtures/BootstrapDelegate.h.erb
|
42
|
+
- fixtures/BootstrapDelegate.m.erb
|
43
|
+
- fixtures/Info.plist.erb
|
44
|
+
- fixtures/Podfile.erb
|
45
|
+
- fixtures/Prefix.pch.erb
|
46
|
+
- fixtures/README.md.erb
|
47
|
+
- fixtures/SidebarContainerViewControllerSkinner.h.erb
|
48
|
+
- fixtures/SidebarContainerViewControllerSkinner.m.erb
|
49
|
+
- fixtures/main.m.erb
|
50
|
+
- lib/cocoapods-icemobile-plugin.rb
|
51
|
+
- lib/cocoapods-icemobile-plugin/version.rb
|
52
|
+
- lib/cocoapods_plugin.rb
|
53
|
+
- lib/pod/command/icegenerate.rb
|
54
|
+
- lib/pod/helper/project_builder.rb
|
55
|
+
- lib/pod/helper/template_file.rb
|
56
|
+
homepage: http://www.icemobile.com
|
57
|
+
licenses: []
|
58
|
+
metadata: {}
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
requirements: []
|
74
|
+
rubyforge_project:
|
75
|
+
rubygems_version: 2.2.2
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: CocoaPods plugin for internal icemobile projects.
|
79
|
+
test_files: []
|
80
|
+
has_rdoc:
|