├── AutoBuildApp.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcuserdata
│ └── jaki.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── AutoBuildApp.xcscheme
│ └── xcschememanagement.plist
├── AutoBuildApp.xcworkspace
├── contents.xcworkspacedata
└── xcuserdata
│ └── jaki.xcuserdatad
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
├── AutoBuildApp
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon 2-1.png
│ │ ├── icon 2-2.png
│ │ ├── icon 2-3.png
│ │ ├── icon 2-4.png
│ │ ├── icon 2-5.png
│ │ ├── icon 2-6.png
│ │ ├── icon 2-7.png
│ │ └── icon 2.png
│ ├── Contents.json
│ └── logoko.imageset
│ │ ├── Contents.json
│ │ └── logoko.png
├── Base.lproj
│ └── Main.storyboard
├── BuildUnit
│ ├── BuildTools
│ │ ├── XCBuildTaskManager.h
│ │ └── XCBuildTaskManager.m
│ └── Model
│ │ ├── BaseTask.h
│ │ ├── BaseTask.m
│ │ ├── GitTask.h
│ │ ├── GitTask.m
│ │ ├── ProjectTask.h
│ │ ├── ProjectTask.m
│ │ ├── TaskProtocol.h
│ │ ├── UploadTask.h
│ │ ├── UploadTask.m
│ │ ├── XCBuildTask.h
│ │ └── XCBuildTask.m
├── DataUnit
│ ├── DB
│ │ ├── DBManager.h
│ │ └── DBManager.m
│ ├── Project
│ │ ├── ProjectManager.h
│ │ ├── ProjectManager.m
│ │ ├── ProjectModel.h
│ │ └── ProjectModel.m
│ └── Request
│ │ ├── HttpRequestManager.h
│ │ └── HttpRequestManager.m
├── Info.plist
├── UIUnit
│ ├── Control
│ │ ├── GUC.h
│ │ ├── GreatUserInterfaceControl.h
│ │ ├── GreatUserInterfaceControl.m
│ │ ├── GreatUserInterfaceControlAlert.h
│ │ ├── GreatUserInterfaceControlAlert.m
│ │ ├── GreatUserInterfaveControlPanel.h
│ │ └── GreatUserInterfaveControlPanel.m
│ ├── Route
│ │ ├── RouteManager.h
│ │ └── RouteManager.m
│ ├── View
│ │ ├── ColorView.h
│ │ ├── ColorView.m
│ │ ├── MainTopBar.h
│ │ ├── MainTopBar.m
│ │ ├── MainViewTableCellView.h
│ │ ├── MainViewTableCellView.m
│ │ └── MainViewTableCellView.xib
│ ├── ViewController
│ │ ├── AddProjectViewController.h
│ │ ├── AddProjectViewController.m
│ │ ├── AddProjectViewController.xib
│ │ ├── ProjectDetailWindow.h
│ │ ├── ProjectDetailWindow.m
│ │ ├── ProjectDetailWindow.xib
│ │ ├── ViewController.h
│ │ ├── ViewController.m
│ │ ├── WindowController.h
│ │ └── WindowController.m
│ └── ViewModel
│ │ ├── AddProjectViewModel.h
│ │ ├── AddProjectViewModel.m
│ │ ├── MainViewModel.h
│ │ ├── MainViewModel.m
│ │ ├── MainViewTableCellModel.h
│ │ └── MainViewTableCellModel.m
└── main.m
├── Podfile
├── Podfile.lock
└── Pods
├── AFNetworking
├── AFNetworking
│ ├── AFHTTPSessionManager.h
│ ├── AFHTTPSessionManager.m
│ ├── AFNetworkReachabilityManager.h
│ ├── AFNetworkReachabilityManager.m
│ ├── AFNetworking.h
│ ├── AFSecurityPolicy.h
│ ├── AFSecurityPolicy.m
│ ├── AFURLRequestSerialization.h
│ ├── AFURLRequestSerialization.m
│ ├── AFURLResponseSerialization.h
│ ├── AFURLResponseSerialization.m
│ ├── AFURLSessionManager.h
│ └── AFURLSessionManager.m
├── LICENSE
└── README.md
├── Headers
├── Private
│ ├── AFNetworking
│ │ ├── AFHTTPSessionManager.h
│ │ ├── AFNetworkReachabilityManager.h
│ │ ├── AFNetworking.h
│ │ ├── AFSecurityPolicy.h
│ │ ├── AFURLRequestSerialization.h
│ │ ├── AFURLResponseSerialization.h
│ │ └── AFURLSessionManager.h
│ └── Masonry
│ │ ├── MASCompositeConstraint.h
│ │ ├── MASConstraint+Private.h
│ │ ├── MASConstraint.h
│ │ ├── MASConstraintMaker.h
│ │ ├── MASLayoutConstraint.h
│ │ ├── MASUtilities.h
│ │ ├── MASViewAttribute.h
│ │ ├── MASViewConstraint.h
│ │ ├── Masonry.h
│ │ ├── NSArray+MASAdditions.h
│ │ ├── NSArray+MASShorthandAdditions.h
│ │ ├── NSLayoutConstraint+MASDebugAdditions.h
│ │ ├── View+MASAdditions.h
│ │ ├── View+MASShorthandAdditions.h
│ │ └── ViewController+MASAdditions.h
└── Public
│ ├── AFNetworking
│ ├── AFHTTPSessionManager.h
│ ├── AFNetworkReachabilityManager.h
│ ├── AFNetworking.h
│ ├── AFSecurityPolicy.h
│ ├── AFURLRequestSerialization.h
│ ├── AFURLResponseSerialization.h
│ └── AFURLSessionManager.h
│ └── Masonry
│ ├── MASCompositeConstraint.h
│ ├── MASConstraint+Private.h
│ ├── MASConstraint.h
│ ├── MASConstraintMaker.h
│ ├── MASLayoutConstraint.h
│ ├── MASUtilities.h
│ ├── MASViewAttribute.h
│ ├── MASViewConstraint.h
│ ├── Masonry.h
│ ├── NSArray+MASAdditions.h
│ ├── NSArray+MASShorthandAdditions.h
│ ├── NSLayoutConstraint+MASDebugAdditions.h
│ ├── View+MASAdditions.h
│ ├── View+MASShorthandAdditions.h
│ └── ViewController+MASAdditions.h
├── Manifest.lock
├── Masonry
├── LICENSE
├── Masonry
│ ├── MASCompositeConstraint.h
│ ├── MASCompositeConstraint.m
│ ├── MASConstraint+Private.h
│ ├── MASConstraint.h
│ ├── MASConstraint.m
│ ├── MASConstraintMaker.h
│ ├── MASConstraintMaker.m
│ ├── MASLayoutConstraint.h
│ ├── MASLayoutConstraint.m
│ ├── MASUtilities.h
│ ├── MASViewAttribute.h
│ ├── MASViewAttribute.m
│ ├── MASViewConstraint.h
│ ├── MASViewConstraint.m
│ ├── Masonry.h
│ ├── NSArray+MASAdditions.h
│ ├── NSArray+MASAdditions.m
│ ├── NSArray+MASShorthandAdditions.h
│ ├── NSLayoutConstraint+MASDebugAdditions.h
│ ├── NSLayoutConstraint+MASDebugAdditions.m
│ ├── View+MASAdditions.h
│ ├── View+MASAdditions.m
│ ├── View+MASShorthandAdditions.h
│ ├── ViewController+MASAdditions.h
│ └── ViewController+MASAdditions.m
└── README.md
├── Pods.xcodeproj
├── project.pbxproj
└── xcuserdata
│ └── jaki.xcuserdatad
│ └── xcschemes
│ ├── AFNetworking.xcscheme
│ ├── Masonry.xcscheme
│ ├── Pods-AutoBuildApp.xcscheme
│ └── xcschememanagement.plist
└── Target Support Files
├── AFNetworking
├── AFNetworking-dummy.m
├── AFNetworking-prefix.pch
└── AFNetworking.xcconfig
├── Masonry
├── Masonry-dummy.m
├── Masonry-prefix.pch
└── Masonry.xcconfig
└── Pods-AutoBuildApp
├── Pods-AutoBuildApp-acknowledgements.markdown
├── Pods-AutoBuildApp-acknowledgements.plist
├── Pods-AutoBuildApp-dummy.m
├── Pods-AutoBuildApp-frameworks.sh
├── Pods-AutoBuildApp-resources.sh
├── Pods-AutoBuildApp.debug.xcconfig
└── Pods-AutoBuildApp.release.xcconfig
/AutoBuildApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AutoBuildApp.xcodeproj/xcuserdata/jaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/AutoBuildApp.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/AutoBuildApp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/AutoBuildApp.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | AutoBuildApp.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 252935E41EF8C36D00B9DB24
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/AutoBuildApp.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/AutoBuildApp.xcworkspace/xcuserdata/jaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AutoBuildApp/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/AutoBuildApp/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "RouteManager.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
19 | // Insert code here to initialize your application
20 | }
21 |
22 |
23 |
24 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
25 | // Insert code here to tear down your application
26 | }
27 |
28 | //点击关闭按钮后 在dock上可以继续打开
29 | - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
30 | {
31 | if (!flag){
32 | if (theApplication.windows.firstObject) {
33 | [[theApplication windows].firstObject makeKeyAndOrderFront:self];
34 | }
35 | return YES;
36 | }
37 | return NO;
38 |
39 | }
40 |
41 | #pragma mark -- menu tools action
42 |
43 |
44 | /**
45 | 添加工程
46 |
47 | @param sender item
48 | */
49 | - (IBAction)addProject:(NSMenuItem *)sender {
50 | [[RouteManager defaultManager]presentAddProjectViewControllerWithVC:nil];
51 | }
52 |
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "icon 2.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "icon 2-1.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "icon 2-2.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "icon 2-3.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "icon 2-4.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "icon 2-5.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "icon 2-6.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "icon 2-7.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "idiom" : "mac",
53 | "size" : "512x512",
54 | "scale" : "1x"
55 | },
56 | {
57 | "idiom" : "mac",
58 | "size" : "512x512",
59 | "scale" : "2x"
60 | }
61 | ],
62 | "info" : {
63 | "version" : 1,
64 | "author" : "xcode"
65 | }
66 | }
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-1.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-2.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-3.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-4.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-5.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-6.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2-7.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/AppIcon.appiconset/icon 2.png
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/logoko.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "logoko.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/AutoBuildApp/Assets.xcassets/logoko.imageset/logoko.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZYHshao/AutoBuild/2032abedb694e284bbf278e9a183a708c833b700/AutoBuildApp/Assets.xcassets/logoko.imageset/logoko.png
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/BuildTools/XCBuildTaskManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // XCBuildTaskManager.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class ProjectTask;
12 | @class ProjectModel;
13 |
14 | @interface XCBuildTaskManager : NSObject
15 |
16 | +(instancetype)defaultManager;
17 |
18 |
19 | @property(nonatomic,strong)NSMutableArray * allRuningProjectTask;
20 |
21 |
22 | /**
23 | 创建一个工程自动化任务
24 |
25 | @param project 项目对象
26 | @return 自动化任务对象
27 | */
28 | -(ProjectTask*)createProjectTask:(ProjectModel *)project;
29 |
30 |
31 | /**
32 | 执行一个自动化任务
33 |
34 | @param task 任务对象
35 | @param stepCallBack 进度回调
36 | */
37 | -(void)runTask:(ProjectTask *)task stepCallBack:(void(^)(int , NSDictionary* ,CGFloat,NSString *,NSString *,BOOL))stepCallBack;
38 |
39 |
40 | /**
41 | 取消一个自动化任务 并不会移除 只是停止执行
42 |
43 | @param task 任务对象
44 | */
45 | -(void)cancelTask:(ProjectTask *)task;
46 |
47 |
48 | /**
49 | 移除一个自动化任务
50 |
51 | @param task 任务对象
52 | */
53 | -(void)removeTask:(ProjectTask *)task;
54 |
55 | /**
56 | 获取git分支列表
57 |
58 | @param project git 工程
59 | */
60 | -(void)getGitBranch:(ProjectModel *)project stepCallBack:(void(^)(NSDictionary* ,NSString *,BOOL))stepCallBack;
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/BuildTools/XCBuildTaskManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // XCBuildTaskManager.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "XCBuildTaskManager.h"
10 | #import "ProjectTask.h"
11 | #import "BaseTask.h"
12 | @interface XCBuildTaskManager()
13 |
14 | @property(nonatomic,strong)NSMutableDictionary * opreationQueueMap;
15 |
16 | @end
17 |
18 |
19 | @implementation XCBuildTaskManager
20 |
21 | +(instancetype)defaultManager{
22 | static dispatch_once_t onceToken;
23 | static XCBuildTaskManager * manager = nil;
24 | dispatch_once(&onceToken, ^{
25 | if (!manager) {
26 | manager = [[XCBuildTaskManager alloc]init];
27 | }
28 | });
29 | return manager;
30 | }
31 |
32 | -(ProjectTask *)createProjectTask:(ProjectModel *)project{
33 | ProjectTask * pTask = [[ProjectTask alloc]initWithProject:project];
34 | return pTask;
35 | }
36 |
37 | -(void)runTask:(ProjectTask *)task stepCallBack:(void (^)(int step,NSDictionary *,CGFloat progress,NSString * log,NSString * finishString,BOOL isFinish))stepCallBack{
38 | for (NSString * key in self.opreationQueueMap.allKeys) {
39 | if ([key isEqualToString:task.projectPath]) {
40 | NSOperationQueue * queue = [self.opreationQueueMap valueForKey:key];
41 | [queue cancelAllOperations];
42 | NSArray * array = [task createTaskGroup];
43 | [self.allRuningProjectTask addObject:task];
44 | [self addOperation:queue taskArray:array callBack:stepCallBack task:task];
45 | return;
46 | }
47 | }
48 | NSOperationQueue * queue = [[NSOperationQueue alloc]init];
49 | queue.maxConcurrentOperationCount = 1;
50 | [self.opreationQueueMap setObject:queue forKey:task.projectPath];
51 | [self.allRuningProjectTask addObject:task];
52 | NSArray * array = [task createTaskGroup];
53 | [self addOperation:queue taskArray:array callBack:stepCallBack task:task];
54 |
55 | }
56 |
57 | -(void)getGitBranch:(ProjectModel *)project stepCallBack:(void (^)(NSDictionary *, NSString *, BOOL))stepCallBack{
58 | BaseTask * task = [[[ProjectTask alloc]initWithProject:project] createTaskGetGitBranch];
59 | NSAppleScript * script = [[NSAppleScript alloc]initWithSource:task.scriptFormat];
60 | NSOperationQueue * queue = [[NSOperationQueue alloc]init];
61 | NSBlockOperation * op = [NSBlockOperation blockOperationWithBlock:^{
62 | NSDictionary * errorDic = nil;
63 | NSAppleEventDescriptor* descript = [script executeAndReturnError:&errorDic];
64 | dispatch_async(dispatch_get_main_queue(), ^{
65 | if (stepCallBack) {
66 | stepCallBack(errorDic,descript.stringValue,YES);
67 | }
68 | });
69 | }];
70 | [queue addOperation:op];
71 | }
72 |
73 | -(void)cancelTask:(ProjectTask *)task{
74 | for (ProjectTask * ta in self.allRuningProjectTask) {
75 | if ([ta.projectPath isEqualToString:task.projectPath]) {
76 | //已经执行operation任务无法终止 用标记来提前中断
77 | ta.isCancel = YES;
78 | }
79 | }
80 | for (NSString * key in self.opreationQueueMap.allKeys) {
81 | if ([key isEqualToString:task.projectPath]) {
82 | NSOperationQueue * queue = [self.opreationQueueMap valueForKey:key];
83 | [queue cancelAllOperations];
84 | return;
85 | }
86 | }
87 | }
88 |
89 | -(void)removeTask:(ProjectTask *)task{
90 | [self cancelTask:task];
91 | [self.opreationQueueMap removeObjectForKey:task.projectPath];
92 | }
93 |
94 |
95 | -(void)getGitBranch:(ProjectModel *)project{
96 |
97 | }
98 |
99 | #pragma mark -- inner
100 | -(void)addOperation:(NSOperationQueue *)queue taskArray:(NSArray *)array callBack:(void (^)(int step,NSDictionary *,CGFloat progress,NSString * log,NSString * finishString,BOOL isFinish))stepCallBack task:(ProjectTask*)task{
101 | __weak typeof(self) __self = self;
102 | [queue addOperationWithBlock:^{
103 | for (int i=0; i *)allRuningProjectTask{
162 | if (!_allRuningProjectTask) {
163 | _allRuningProjectTask = [NSMutableArray new];
164 | }
165 | return _allRuningProjectTask;
166 | }
167 |
168 | @end
169 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/BaseTask.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseTask.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/28.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "TaskProtocol.h"
11 | @interface BaseTask : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/BaseTask.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseTask.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/28.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "BaseTask.h"
10 |
11 | @implementation BaseTask
12 | //subClass reWrite
13 | @synthesize scriptFormat;
14 | @synthesize taskInfo;
15 | @synthesize mode;
16 |
17 | -(void)innerTask:(void (^)(id, BOOL, CGFloat))taskInfoCallback{
18 | taskInfoCallback(nil,NO,0);
19 | }
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/GitTask.h:
--------------------------------------------------------------------------------
1 | //
2 | // GitTask.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/30.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "BaseTask.h"
10 |
11 | @class ProjectModel;
12 |
13 | typedef NS_ENUM(NSUInteger, GitTaskType) {
14 | GitTaskTypeGetBranchList,
15 | GitTaskTypeCheckOut,
16 | GitTaskTypePull
17 | };
18 |
19 | @interface GitTask : BaseTask
20 | -(instancetype)initWithProject:(ProjectModel *)project taskType:(GitTaskType)taskType;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/GitTask.m:
--------------------------------------------------------------------------------
1 | //
2 | // GitTask.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/30.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "GitTask.h"
10 | #import "ProjectModel.h"
11 |
12 | #define SCRIPT_FORMAT_STRING_GIT_BRANCH @"do shell script \"GIT_DIR=%@ git branch\""
13 | #define SCRIPT_FORMAT_STRING_GIT_CHECK_OUT @"do shell script \"GIT_DIR=%@ git checkout %@\""
14 | #define SCRIPT_FORMAT_STRING_GIT_PULL @"do shell script \"GIT_DIR=%@ git pull\""
15 |
16 | @interface GitTask()
17 |
18 | @property(nonatomic,weak)ProjectModel * project;
19 | @property(nonatomic,assign)GitTaskType type;
20 | @property(nonatomic,copy)NSString * gitDicFullPath;
21 |
22 | @end
23 |
24 | @implementation GitTask
25 |
26 | -(instancetype)initWithProject:(ProjectModel *)project taskType:(GitTaskType)taskType{
27 | self = [super init];
28 | if (self) {
29 | self.type = taskType;
30 | self.project = project;
31 | self.gitDicFullPath = project.gitFilePath;
32 | self.mode = BaseTaskModeShell;
33 | [self createFormatStringAndInfo];
34 | }
35 | return self;
36 | }
37 |
38 | -(void)createFormatStringAndInfo{
39 | if (self.type == GitTaskTypeGetBranchList) {
40 | self.scriptFormat = [NSString stringWithFormat:SCRIPT_FORMAT_STRING_GIT_BRANCH,self.gitDicFullPath];
41 | self.taskInfo = @"请求Git分支信息";
42 | }else if(self.type == GitTaskTypeCheckOut){
43 | self.scriptFormat= [NSString stringWithFormat:SCRIPT_FORMAT_STRING_GIT_CHECK_OUT,self.gitDicFullPath,self.project.selectGitBranch];
44 | self.taskInfo = [NSString stringWithFormat:@"检查%@分支",self.project.selectGitBranch];
45 | }else if(self.type==GitTaskTypePull){
46 | self.scriptFormat = [NSString stringWithFormat:SCRIPT_FORMAT_STRING_GIT_PULL,self.gitDicFullPath];
47 | self.taskInfo = @"拉取新代码";
48 | }
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/ProjectTask.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectTask.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 | @class ProjectModel;
13 | @class BaseTask;
14 |
15 | @interface ProjectTask :NSObject
16 |
17 | -(instancetype)initWithProject:(ProjectModel *)project;
18 |
19 | -(NSArray *)createTaskGroup;
20 |
21 | //获取git分支列表
22 | -(BaseTask *)createTaskGetGitBranch;
23 |
24 | @property (nonatomic,strong,readonly)NSString* projectPath;
25 |
26 | @property (nonatomic,assign)CGFloat progress;//0-1
27 |
28 | @property (nonatomic,assign)int totalTask;
29 |
30 | @property (nonatomic,assign)BOOL isCancel;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/ProjectTask.m:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectTask.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "ProjectTask.h"
10 | #import "ProjectModel.h"
11 | #import "XCBuildTask.h"
12 | #import "GitTask.h"
13 | #import "UploadTask.h"
14 |
15 | @interface ProjectTask()
16 |
17 | @property (nonatomic,weak)ProjectModel * project;
18 |
19 | @end
20 |
21 | @implementation ProjectTask
22 |
23 | -(instancetype)initWithProject:(ProjectModel *)project{
24 | self = [super init];
25 | if (self) {
26 | self.project = project;
27 | _projectPath = project.projectPath;
28 |
29 | }
30 | return self;
31 | }
32 |
33 | -(NSArray *)createTaskGroup{
34 | NSMutableArray * array = [[NSMutableArray alloc]init];
35 | if (self.project.buildModel == ProjectUserOwnerModel) {
36 | XCBuildTask * taskClean = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeClean];
37 | XCBuildTask * taskArchive = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportArchive];
38 | XCBuildTask * taskIPA = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportIPA];
39 | [array addObject:taskClean];
40 | [array addObject:taskArchive];
41 | [array addObject:taskIPA];
42 | self.totalTask = 3;
43 | }else if(self.project.buildModel == ProjectSemiAuto){
44 | XCBuildTask * taskClean = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeClean];
45 | XCBuildTask * taskArchive = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportArchive];
46 | XCBuildTask * taskIPA = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportIPA];
47 | UploadTask * taskUpload = [[UploadTask alloc]initWithProject:self.project];
48 | [array addObject:taskClean];
49 | [array addObject:taskArchive];
50 | [array addObject:taskIPA];
51 | [array addObject:taskUpload];
52 | self.totalTask = 4;
53 | }else if(self.project.buildModel == ProjectAuto){
54 | GitTask * checkout = [[GitTask alloc]initWithProject:self.project taskType:GitTaskTypeCheckOut];
55 | GitTask * pullTask = [[GitTask alloc]initWithProject:self.project taskType:GitTaskTypePull];
56 | XCBuildTask * taskClean = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeClean];
57 | XCBuildTask * taskArchive = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportArchive];
58 | XCBuildTask * taskIPA = [[XCBuildTask alloc]initWithProject:self.project taskType:XCBuildTaskTypeExportIPA];
59 | UploadTask * taskUpload = [[UploadTask alloc]initWithProject:self.project];
60 | [array addObject:checkout];
61 | [array addObject:pullTask];
62 | [array addObject:taskClean];
63 | [array addObject:taskArchive];
64 | [array addObject:taskIPA];
65 | [array addObject:taskUpload];
66 | self.totalTask = 6;
67 | }
68 | return array;
69 | }
70 |
71 | -(BaseTask *)createTaskGetGitBranch{
72 | GitTask * task = [[GitTask alloc]initWithProject:self.project taskType:GitTaskTypeGetBranchList];
73 | return task;
74 | }
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/TaskProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // TaskProtocol.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, BaseTaskMode) {
12 | BaseTaskModeShell,
13 | BaseTaskiInnerTask,
14 | };
15 |
16 | @protocol TaskProtocol
17 |
18 | @property (nonatomic,strong)NSString * scriptFormat;
19 |
20 | @property (nonatomic,strong)NSString * taskInfo;
21 |
22 | @property (nonatomic,assign)BaseTaskMode mode;
23 |
24 | -(void)innerTask:(void(^)(id data,BOOL finish,CGFloat progress))taskInfoCallback;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/UploadTask.h:
--------------------------------------------------------------------------------
1 | //
2 | // UploadTask.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/7/10.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "BaseTask.h"
10 |
11 | @class ProjectModel;
12 | @interface UploadTask : BaseTask
13 | -(instancetype)initWithProject:(ProjectModel *)project;
14 | @end
15 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/UploadTask.m:
--------------------------------------------------------------------------------
1 | //
2 | // UploadTask.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/7/10.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "UploadTask.h"
10 | #import "HttpRequestManager.h"
11 | #import "ProjectModel.h"
12 |
13 | @interface UploadTask()
14 |
15 | @property(nonatomic,weak)ProjectModel * project;
16 |
17 | @end
18 |
19 |
20 | @implementation UploadTask
21 | -(instancetype)initWithProject:(ProjectModel *)project {
22 | self = [super init];
23 | if (self) {
24 | self.mode = BaseTaskiInnerTask;
25 | self.project = project;
26 | self.taskInfo = @"上传ipa包到蒲公英";
27 | }
28 | return self;
29 | }
30 |
31 | -(void)innerTask:(void (^)(id, BOOL, CGFloat))taskInfoCallback{
32 | NSString * ukey = self.project.uKey;
33 | NSString * apikey = self.project.api_key;
34 | NSInteger installType = self.project.authority;
35 | NSString * password = @"";
36 | if (installType!=DownLoadAuthorityPublic) {
37 | password = self.project.password;
38 | }
39 | NSString * description = self.project.updataMessage;
40 | NSDictionary * params = @{@"uKey":ukey,@"_api_key":apikey,@"installType":@(installType),@"password":password,@"updateDescription":description};
41 | [[HttpRequestManager defaultManager]uploadFile:[NSString stringWithFormat:@"%@/%@/%@.ipa",self.project.ipaPath,self.project.projectName,self.project.projectName] params:params conpletion:^(id response,CGFloat progress) {
42 | if ((NSInteger)progress == 1) {
43 | taskInfoCallback(response,YES,1);
44 | }else{
45 | taskInfoCallback(nil,NO,progress);
46 | }
47 |
48 | }];
49 | }
50 | @end
51 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/XCBuildTask.h:
--------------------------------------------------------------------------------
1 | //
2 | // XCBuildTask.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BaseTask.h"
11 |
12 |
13 |
14 | @class ProjectModel;
15 |
16 | typedef NS_ENUM(NSUInteger, XCBuildTaskType) {
17 | XCBuildTaskTypeClean,
18 | XCBuildTaskTypeExportArchive,
19 | XCBuildTaskTypeExportIPA,
20 | };
21 |
22 | @interface XCBuildTask : BaseTask
23 |
24 | -(instancetype)initWithProject:(ProjectModel *)project taskType:(XCBuildTaskType)taskType;
25 |
26 |
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/AutoBuildApp/BuildUnit/Model/XCBuildTask.m:
--------------------------------------------------------------------------------
1 | //
2 | // XCBuildTask.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/27.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "XCBuildTask.h"
10 | #import "ProjectModel.h"
11 |
12 | #define SCRIPT_FORMAT_STRING_CLEAN @"do shell script \"xcodebuild clean -%@ %@ -scheme %@ CONFIGURATION=%@\""
13 |
14 | #define SCRIPT_FORMAT_STRING_ARCHIVE @"do shell script \"xcodebuild archive -%@ %@ -scheme %@ -archivePath %@/%@ CONFIGURATION=%@\""
15 |
16 | #define SCRIPT_FORMAT_STRING_IPA @"do shell script \"xcodebuild -exportArchive -archivePath %@/%@.xcarchive -exportPath %@/%@ -exportOptionsPlist %@\""
17 |
18 | @interface XCBuildTask()
19 |
20 | @property(nonatomic,weak)ProjectModel * project;
21 | @property(nonatomic,assign)XCBuildTaskType type;
22 |
23 | @end
24 |
25 |
26 | @implementation XCBuildTask
27 |
28 | -(instancetype)initWithProject:(ProjectModel *)project taskType:(XCBuildTaskType)taskType{
29 | self = [super init];
30 | if (self) {
31 | self.type = taskType;
32 | self.project = project;
33 | self.mode = BaseTaskModeShell;
34 | [self createFormatStringAndInfo];
35 | }
36 | return self;
37 | }
38 |
39 | -(void)createFormatStringAndInfo{
40 | if (self.type == XCBuildTaskTypeClean) {
41 | self.scriptFormat = [NSString stringWithFormat:SCRIPT_FORMAT_STRING_CLEAN,self.project.projectType,self.project.projectPath,self.project.scheme,self.project.buildConfiguration];
42 | self.taskInfo = @"clean工程";
43 | }else if (self.type == XCBuildTaskTypeExportArchive){
44 | self.taskInfo = @"导出Archive文件";
45 | self.scriptFormat = [NSString stringWithFormat:SCRIPT_FORMAT_STRING_ARCHIVE,self.project.projectType,self.project.projectPath,self.project.scheme,self.project.archivePath,self.project.projectName,self.project.buildConfiguration];
46 |
47 | }else if (self.type == XCBuildTaskTypeExportIPA){
48 | self.taskInfo = @"导出IPA安装包";
49 | self.scriptFormat = [NSString stringWithFormat:SCRIPT_FORMAT_STRING_IPA,self.project.archivePath,self.project.projectName,self.project.ipaPath,self.project.projectName,[self getPlist]];
50 | }else{
51 | self.scriptFormat = @"";
52 | }
53 | }
54 |
55 | -(NSString *)getPlist{
56 | NSString * type = self.project.ipaType;
57 | NSDictionary * dic = @{@"compileBitcode":@NO,
58 | @"method":type};
59 | [dic writeToFile:[NSString stringWithFormat:@"%@/config.plist",self.project.archivePath] atomically:NO];
60 | return [NSString stringWithFormat:@"%@/config.plist",self.project.archivePath];
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/DB/DBManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // DBManager.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/23.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class ProjectModel;
12 |
13 | @interface DBManager : NSObject
14 |
15 | +(instancetype)defaultManager;
16 |
17 | -(NSArray*)getAllProjects;
18 |
19 | -(BOOL)addProject:(ProjectModel*)project;
20 |
21 | -(void)deleteProject:(ProjectModel *)project;
22 |
23 | -(void)refreshProject:(ProjectModel*)project;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/DB/DBManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // DBManager.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/23.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "DBManager.h"
10 | #import "ProjectModel.h"
11 |
12 | #define DBMANAGER_VERSION @"1.0"
13 |
14 | @interface DBManager()
15 |
16 | @property(nonatomic,strong)NSMutableArray * projectArray;
17 |
18 | @end
19 |
20 | @implementation DBManager
21 |
22 |
23 | +(instancetype)defaultManager{
24 | static dispatch_once_t onceToken;
25 | static DBManager * manager = nil;
26 | dispatch_once(&onceToken, ^{
27 | if (!manager) {
28 | manager = [[DBManager alloc]init];
29 | }
30 | });
31 | return manager;
32 | }
33 |
34 | - (instancetype)init
35 | {
36 | self = [super init];
37 | if (self) {
38 | [self installDB];
39 | }
40 | return self;
41 | }
42 |
43 | -(void)installDB{
44 | NSData * data = [NSData dataWithContentsOfFile:[self dataBasePath]];
45 | if (data) {
46 | NSArray* array = [NSKeyedUnarchiver unarchiveObjectWithData:data];
47 | [self.projectArray removeAllObjects];
48 | [self.projectArray addObjectsFromArray:array];
49 | }
50 | }
51 |
52 | -(NSString *)dataBasePath{
53 | NSString * homeDic = NSHomeDirectory();
54 | NSString * homePath = [homeDic stringByAppendingPathComponent:[NSString stringWithFormat:@"AutoB-dataBase_%@.db",DBMANAGER_VERSION]];
55 | return homePath;
56 | }
57 |
58 | -(NSArray *)getAllProjects{
59 | return [self.projectArray copy];
60 | }
61 |
62 | -(BOOL)addProject:(ProjectModel *)project{
63 | __block BOOL error=NO;
64 | [self.projectArray enumerateObjectsUsingBlock:^(ProjectModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
65 | if ([obj.projectPath isEqualToString:project.projectPath]) {
66 | error = YES;
67 | *stop=YES;
68 | }
69 | }];
70 | if (error) {
71 | return NO;
72 | }
73 | [self.projectArray addObject:project];
74 | [self syncDB];
75 | return YES;
76 | }
77 |
78 | -(void)deleteProject:(ProjectModel *)project{
79 | __block int index = -1;
80 | [self.projectArray enumerateObjectsUsingBlock:^(ProjectModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
81 | if ([obj.projectPath isEqualToString:project.projectPath]) {
82 | index = (int)idx;
83 | *stop=YES;
84 | }
85 | }];
86 | if (index>=0) {
87 | [self.projectArray removeObjectAtIndex:index];
88 | [self syncDB];
89 | }
90 | }
91 |
92 | -(void)refreshProject:(ProjectModel *)project{
93 | __block int index = -1;
94 | [self.projectArray enumerateObjectsUsingBlock:^(ProjectModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
95 | if ([obj.projectPath isEqualToString:project.projectPath]) {
96 | index = (int)idx;
97 | *stop=YES;
98 | }
99 | }];
100 | if (index>=0) {
101 | [self.projectArray replaceObjectAtIndex:index withObject:project];
102 | [self syncDB];
103 | }
104 | }
105 |
106 | -(void)syncDB{
107 | NSData * data = [NSKeyedArchiver archivedDataWithRootObject:self.projectArray];
108 | [data writeToFile:[self dataBasePath] atomically:NO];
109 | }
110 |
111 | #pragma mark -- setter and getter
112 | -(NSMutableArray *)projectArray{
113 | if (!_projectArray) {
114 | _projectArray = [NSMutableArray new];
115 | }
116 | return _projectArray;
117 | }
118 |
119 |
120 | @end
121 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Project/ProjectManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectManager.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ProjectModel.h"
11 |
12 | @interface ProjectManager : NSObject
13 |
14 | +(instancetype)defaultManager;
15 |
16 |
17 | /**
18 | 获取所有项目
19 |
20 | @return 项目列表
21 | */
22 | -(NSArray *)getAllProject;
23 |
24 | /**
25 | 添加一个项目
26 |
27 | @param project 项目对象
28 | @return 是否成功 返回字符串 success表示成功 否则为错误信息
29 | */
30 | -(NSString *)addProject:(ProjectModel *)project;
31 |
32 | /**
33 | 删除一个项目
34 |
35 | @param project 项目对象
36 | */
37 | -(void)deleteProject:(ProjectModel *)project;
38 |
39 | /**
40 | 刷新项目配置 会同步数据库
41 |
42 | @param project 项目对象
43 | */
44 | -(void)refreshProject:(ProjectModel *)project;
45 |
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Project/ProjectManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectManager.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "ProjectManager.h"
10 | #import "DBManager.h"
11 |
12 | @interface ProjectManager()
13 |
14 | @property(nonatomic,strong)NSMutableArray * projectArray;
15 |
16 | @end
17 |
18 | @implementation ProjectManager
19 |
20 | +(instancetype)defaultManager{
21 | static dispatch_once_t onceToken;
22 | static ProjectManager * manager = nil;
23 | dispatch_once(&onceToken, ^{
24 | if (!manager) {
25 | manager = [[ProjectManager alloc]init];
26 | }
27 | });
28 | return manager;
29 | }
30 |
31 | -(NSArray *)getAllProject{
32 | return [self.projectArray copy];
33 | }
34 |
35 | -(NSString*)addProject:(ProjectModel *)project{
36 | for (ProjectModel* obj in self.projectArray) {
37 | if ([obj.projectPath isEqualToString:project.projectPath]) {
38 | return @"已存在项目";
39 | }
40 | }
41 | [self.projectArray addObject:project];
42 | [[DBManager defaultManager] addProject:project];
43 | return @"success";
44 | }
45 |
46 | -(void)deleteProject:(ProjectModel *)project{
47 | for (int i=(int)self.projectArray.count-1; i>=0; i--) {
48 | if ([self.projectArray[i].projectPath isEqualToString:project.projectPath]) {
49 | [self.projectArray removeObjectAtIndex:i];
50 | [[DBManager defaultManager]deleteProject:project];
51 | }
52 | }
53 | }
54 |
55 | -(void)refreshProject:(ProjectModel *)project{
56 | for (int i=(int)self.projectArray.count-1; i>=0; i--) {
57 | if ([self.projectArray[i].projectPath isEqualToString:project.projectPath]) {
58 | [self.projectArray replaceObjectAtIndex:i withObject:project];
59 | [[DBManager defaultManager]refreshProject:project];
60 | }
61 | }
62 | }
63 |
64 | #pragma mark -- setter and getter
65 | -(NSMutableArray *)projectArray{
66 | if (!_projectArray) {
67 | _projectArray = [[NSMutableArray alloc]init];
68 | [_projectArray addObjectsFromArray:[[DBManager defaultManager] getAllProjects]];
69 | }
70 | return _projectArray;
71 | }
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Project/ProjectModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectModel.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, ProjectBuildModel) {
12 | ProjectUserOwnerModel = 1, //自助模式
13 | ProjectSemiAuto, //半自动
14 | ProjectAuto, //全自动
15 | };
16 |
17 | typedef NS_ENUM(NSUInteger, DownLoadAuthority) {
18 | DownLoadAuthorityPublic =1,
19 | DownLoadAuthorityprivate, //need password
20 | };
21 |
22 | @interface ProjectModel : NSObject
23 |
24 | @property(nonatomic,strong)NSString * projectPath;
25 | @property(nonatomic,strong)NSString * projectName;
26 |
27 | #pragma mark -- build Property
28 | @property(nonatomic,strong)NSString * scheme; //default == projectRealName
29 | @property(nonatomic,strong)NSString * archivePath;
30 | @property(nonatomic,strong)NSString * buildConfiguration;//Debug or Release default debug
31 | @property(nonatomic,strong)NSString * ipaPath;
32 | @property(nonatomic,assign)ProjectBuildModel buildModel; //defaule == UserOwnerModel
33 | @property(nonatomic,strong)NSString * ipaType;// ad-hoc app-store development
34 |
35 | #pragma mark -- git Progerty
36 | @property(nonatomic,strong)NSArray * gitBranchList;
37 |
38 | #pragma mark -- upload file
39 | @property(nonatomic,strong)NSString * uKey;
40 | @property(nonatomic,strong)NSString * api_key;
41 | @property(nonatomic,assign)DownLoadAuthority authority; //default public
42 | @property(nonatomic,strong)NSString * password;
43 | @property(nonatomic,strong)NSString * updataMessage;
44 |
45 |
46 | #pragma mark -- mark noemal
47 | @property(nonatomic,strong)NSString * log; //log message
48 |
49 | #pragma mark -- inner property
50 | @property(nonatomic,strong)NSString * projectRealName;
51 | @property(nonatomic,strong)NSString * projectType; //project or workspace
52 | @property(nonatomic,strong,readonly)NSString * gitFilePath;
53 | @property(nonatomic,strong)NSString * selectGitBranch; //default this first of branch list
54 |
55 | #pragma mark -- moment property
56 | //下面这些属性不进行持久化 只进行临时存储
57 |
58 |
59 | -(BOOL)couldStartPeoject:(NSString **)error;
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Project/ProjectModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectModel.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "ProjectModel.h"
10 |
11 | #define GIT_BRANCH_NULL_TIP @"请重新刷新分支列表"
12 |
13 | @implementation ProjectModel
14 |
15 | - (instancetype)initWithCoder:(NSCoder *)coder
16 | {
17 | self = [super init];
18 | if (self) {
19 | _projectName = [coder decodeObjectForKey:@"projectName"];
20 | _projectPath = [coder decodeObjectForKey:@"projectPath"];
21 | _projectRealName = [coder decodeObjectForKey:@"projectRealName"];
22 | _scheme = [coder decodeObjectForKey:@"scheme"];
23 | _archivePath = [coder decodeObjectForKey:@"archivePath"];
24 | _buildConfiguration = [coder decodeObjectForKey:@"buildConfiguration"];
25 | _ipaPath = [coder decodeObjectForKey:@"ipaPath"];
26 | _buildModel = [coder decodeIntegerForKey:@"buildModel"];
27 | _projectType = [coder decodeObjectForKey:@"projectType"];
28 | _log = [coder decodeObjectForKey:@"log"];
29 | _ipaType = [coder decodeObjectForKey:@"ipaType"];
30 | _gitBranchList = [coder decodeObjectForKey:@"gitBranchList"];
31 | _selectGitBranch = [coder decodeObjectForKey:@"selectGitBranch"];
32 | _uKey = [coder decodeObjectForKey:@"uKey"];
33 | _api_key = [coder decodeObjectForKey:@"api_key"];
34 | _authority = [coder decodeIntegerForKey:@"authority"];
35 | _password = [coder decodeObjectForKey:@"password"];
36 | _updataMessage = [coder decodeObjectForKey:@"updataMessage"];
37 | }
38 | return self;
39 | }
40 |
41 | - (void)encodeWithCoder:(NSCoder *)coder
42 | {
43 | [coder encodeObject:_projectName forKey:@"projectName"];
44 | [coder encodeObject:_projectPath forKey:@"projectPath"];
45 | [coder encodeObject:_projectRealName forKey:@"projectRealName"];
46 | [coder encodeObject:_scheme forKey:@"scheme"];
47 | [coder encodeObject:_archivePath forKey:@"archivePath"];
48 | [coder encodeObject:_buildConfiguration forKey:@"buildConfiguration"];
49 | [coder encodeObject:_ipaPath forKey:@"ipaPath"];
50 | [coder encodeInteger:_buildModel forKey:@"buildModel"];
51 | [coder encodeObject:_projectType forKey:@"projectType"];
52 | [coder encodeObject:_log forKey:@"log"];
53 | [coder encodeObject:_ipaType forKey:@"ipaType"];
54 | [coder encodeObject:_gitBranchList forKey:@"gitBranchList"];
55 | [coder encodeObject:_selectGitBranch forKey:@"selectGitBranch"];
56 | [coder encodeObject:_uKey forKey:@"uKey"];
57 | [coder encodeObject:_api_key forKey:@"api_key"];
58 | [coder encodeInteger:_authority forKey:@"authority"];
59 | [coder encodeObject:_password forKey:@"password"];
60 | [coder encodeObject:_updataMessage forKey:@"updataMessage"];
61 | }
62 |
63 |
64 | #pragma mark -- getter and setter
65 |
66 | -(NSString *)scheme{
67 | if (!_scheme) {
68 | if (self.projectRealName) {
69 | _scheme = self.projectRealName;
70 | }else{
71 | _scheme=@"";
72 | }
73 | }
74 | return _scheme;
75 | }
76 |
77 | -(NSString *)archivePath{
78 | if (!_archivePath) {
79 | _archivePath = @"";
80 | }
81 | return _archivePath;
82 | }
83 |
84 | -(NSString *)buildConfiguration{
85 | if (!_buildConfiguration) {
86 | _buildConfiguration = @"Debug";
87 | }
88 | return _buildConfiguration;
89 | }
90 |
91 | -(NSString *)ipaPath{
92 | if (!_ipaPath) {
93 | _ipaPath=@"";
94 | }
95 | return _ipaPath;
96 | }
97 |
98 | -(ProjectBuildModel)buildModel{
99 | if (!_buildModel) {
100 | _buildModel = ProjectUserOwnerModel;
101 | }
102 | return _buildModel;
103 | }
104 |
105 | -(NSString *)projectType{
106 | if (!_projectType) {
107 | _projectType = @"";
108 | }
109 | return _projectType;
110 | }
111 |
112 | -(NSString *)log{
113 | if (!_log) {
114 | _log = @"开始构建你的自动化打包工程吧!Have fun! @^_^@";
115 | }
116 | return _log;
117 | }
118 |
119 | -(NSString *)ipaType{
120 | if (!_ipaType) {
121 | _ipaType = @"ad-hoc";
122 | }
123 | return _ipaType;
124 | }
125 |
126 | -(NSString *)gitFilePath{
127 | NSArray * strs = [self.projectPath componentsSeparatedByString:@"/"];
128 | NSMutableArray * newStrs = [NSMutableArray arrayWithArray:strs];
129 | [newStrs removeLastObject];
130 | NSString * string = [newStrs componentsJoinedByString:@"/"];
131 | return [NSString stringWithFormat:@"%@/.git",string];
132 | }
133 |
134 | -(NSArray *)gitBranchList{
135 | if (!_gitBranchList) {
136 | _gitBranchList = @[GIT_BRANCH_NULL_TIP];
137 | }
138 | return _gitBranchList;
139 | }
140 |
141 | -(NSString *)selectGitBranch{
142 | if (!_selectGitBranch) {
143 | _selectGitBranch = self.gitBranchList.firstObject;
144 | }
145 | return _selectGitBranch;
146 | }
147 |
148 | -(NSString *)uKey{
149 | if (!_uKey) {
150 | _uKey = @"";
151 | }
152 | return _uKey;
153 | }
154 |
155 | -(NSString *)api_key{
156 | if (!_api_key) {
157 | _api_key = @"";
158 | }
159 | return _api_key;
160 | }
161 |
162 | -(DownLoadAuthority)authority{
163 | if (_authority==0) {
164 | _authority = DownLoadAuthorityPublic;
165 | }
166 | return _authority;
167 | }
168 |
169 | -(NSString *)password{
170 | if (!_password) {
171 | _password = @"";
172 | }
173 | return _password;
174 | }
175 |
176 | -(NSString *)updataMessage{
177 | if (!_updataMessage) {
178 | _updataMessage = @"";
179 | }
180 | return _updataMessage;
181 | }
182 |
183 | #pragma mark -- mathod
184 | -(BOOL)couldStartPeoject:(NSString *__autoreleasing *)error{
185 | switch (self.buildModel) {
186 | case ProjectAuto:
187 | {
188 | if ([self.selectGitBranch isEqualToString:GIT_BRANCH_NULL_TIP]) {
189 | *error = @"您必须配置一个自动化构建的Git分支";
190 | return NO;
191 | }
192 | }
193 | case ProjectSemiAuto:
194 | {
195 | if (self.uKey.length==0) {
196 | *error = @"您必须配置蒲公英平台的uKey凭证";
197 | return NO;
198 | }
199 | if (self.api_key.length==0) {
200 | *error = @"您必须配置蒲公英平台的api_key凭证";
201 | return NO;
202 | }
203 | if (self.authority==DownLoadAuthorityprivate && self.password.length==0) {
204 | *error = @"您必须设置下载密码";
205 | return NO;
206 | }
207 | }
208 | case ProjectUserOwnerModel:
209 | {
210 | if (self.scheme.length==0) {
211 | *error = @"必须填写项目的Scheme";
212 | return NO;
213 | }
214 | if (self.archivePath.length==0) {
215 | *error = @"必须设置Archive文件的输出目录";
216 | return NO;
217 | }
218 | if (self.ipaPath.length==0) {
219 | *error = @"必须设置IPA文件的输出目录";
220 | return NO;
221 | }
222 | return YES;
223 | }
224 |
225 | }
226 | return NO;
227 | }
228 |
229 | @end
230 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Request/HttpRequestManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // HttpRequestManager.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/7/10.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^UploadFileCompleted)(id response,CGFloat progress);
12 |
13 | @interface HttpRequestManager : NSObject
14 |
15 | +(instancetype)defaultManager;
16 |
17 | -(void)uploadFile:(NSString*)filePath params:(NSDictionary *)paramsDic conpletion:(UploadFileCompleted)completed;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/AutoBuildApp/DataUnit/Request/HttpRequestManager.m:
--------------------------------------------------------------------------------
1 |
2 |
3 | //
4 | // HttpRequestManager.m
5 | // AutoBuildApp
6 | //
7 | // Created by jaki on 2017/7/10.
8 | // Copyright © 2017年 jaki. All rights reserved.
9 | //
10 |
11 | #import "HttpRequestManager.h"
12 | #import
13 |
14 | @interface HttpRequestManager()
15 |
16 | @property(nonatomic,strong)AFURLSessionManager * manager;
17 |
18 | @property(nonatomic,strong)NSURLRequest * request;
19 |
20 | @end
21 |
22 | @implementation HttpRequestManager
23 |
24 | +(instancetype)defaultManager{
25 | static dispatch_once_t onceToken;
26 | static HttpRequestManager * manager = nil;
27 | dispatch_once(&onceToken, ^{
28 | if (!manager) {
29 | manager = [[HttpRequestManager alloc]init];
30 | }
31 | });
32 | return manager;
33 | }
34 |
35 | -(void)uploadFile:(NSString *)filePath params:(NSDictionary *)paramsDic conpletion:(UploadFileCompleted)completed{
36 | self.request = [[AFHTTPRequestSerializer serializer]multipartFormRequestWithMethod:@"POST" URLString:@"https://qiniu-storage.pgyer.com/apiv1/app/upload" parameters:paramsDic constructingBodyWithBlock:^(id _Nonnull formData) {
37 | [formData appendPartWithFileURL:[NSURL fileURLWithPath:filePath] name:@"file" fileName:@"VSVipUnion.ipa" mimeType:@"application/octet-stream" error:nil];
38 | } error:nil];
39 | [[self.manager uploadTaskWithStreamedRequest:self.request progress:^(NSProgress * _Nonnull uploadProgress) {
40 | CGFloat pro = (CGFloat)uploadProgress.completedUnitCount/uploadProgress.totalUnitCount;
41 | completed(nil,pro);
42 | } completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
43 | completed(responseObject,1);
44 | }] resume];
45 | }
46 |
47 | #pragma mark -- setter and getter
48 | -(AFURLSessionManager *)manager{
49 | if (!_manager) {
50 | _manager = [[AFURLSessionManager alloc]initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
51 | }
52 | return _manager;
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/AutoBuildApp/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2017年 jaki. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GUC.h:
--------------------------------------------------------------------------------
1 | //
2 | // GUC.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/25.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #ifndef GUC_h
10 | #define GUC_h
11 |
12 |
13 | #endif /* GUC_h */
14 |
15 | #import "GreatUserInterfaceControl.h"
16 | #import "GreatUserInterfaceControlAlert.h"
17 | #import "GreatUserInterfaveControlPanel.h"
18 |
19 | #define GUC_REFRESH(viewId) [[GreatUserInterfaceControl defaultControl]refreshView:viewId]
20 |
21 | #define GUC_ADD_OBSERVER(ob,viewId,sel) [[GreatUserInterfaceControl defaultControl]addObserver:ob inViewID:viewId withAction:sel]
22 |
23 | #define GUC_REMOVE_OBSERVER_ID(ob,viewId) [[GreatUserInterfaceControl defaultControl] removeObserver:ob inViewID:viewId]
24 |
25 | #define GUC_REMOVE_OBSERVER(ob) [[GreatUserInterfaceControl defaultControl]removeObserver:ob]
26 |
27 |
28 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GreatUserInterfaceControl.h:
--------------------------------------------------------------------------------
1 | //
2 | // GreatUserInterfaceControl.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/25.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | // 全局UI控制
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, GUCViewID) {
12 | GUCMainView=0
13 | };
14 |
15 | @interface GreatUserInterfaceControl : NSObject
16 |
17 | +(instancetype)defaultControl;
18 |
19 | -(void)addObserver:(id)observer inViewID:(GUCViewID)viewID withAction:(SEL)sel;
20 |
21 | -(void)removeObserver:(id)observer inViewID:(GUCViewID)viewID;
22 |
23 | -(void)removeObserver:(id)observer;
24 |
25 | -(void)refreshView:(GUCViewID)viewID;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GreatUserInterfaceControl.m:
--------------------------------------------------------------------------------
1 | //
2 | // GreatUserInterfaceControl.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/25.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "GreatUserInterfaceControl.h"
10 |
11 | #define MainViewShouldReloadData @"MainViewShouldReloadData"
12 |
13 | @interface GreatUserInterfaceControl()
14 |
15 | @property (nonatomic,strong)NSMutableArray * observerList;
16 |
17 | @property (nonatomic,strong)NSArray * viewIDToNotification;
18 |
19 | @end
20 |
21 | @implementation GreatUserInterfaceControl
22 |
23 | +(instancetype)defaultControl{
24 | static dispatch_once_t onceToken;
25 | static GreatUserInterfaceControl * control = nil;
26 | dispatch_once(&onceToken, ^{
27 | if (!control) {
28 | control = [[GreatUserInterfaceControl alloc]init];
29 | }
30 | });
31 | return control;
32 | }
33 |
34 | -(void)addObserver:(id)observer inViewID:(GUCViewID)viewID withAction:(SEL)sel{
35 | NSArray * array = self.observerList[viewID];
36 | BOOL has = NO;
37 | for (id obj in array) {
38 | if (obj == observer) {
39 | has = YES;
40 | }
41 | }
42 | if (!has) {
43 | NSArray * array = self.observerList[viewID];
44 | NSMutableArray * newArray = [[NSMutableArray alloc]initWithArray:array];
45 | [newArray addObject:observer];
46 | [self.observerList replaceObjectAtIndex:viewID withObject:newArray];
47 | [[NSNotificationCenter defaultCenter]addObserver:observer selector:sel name:self.viewIDToNotification[viewID] object:nil];
48 | }
49 | }
50 |
51 | -(void)removeObserver:(id)observer inViewID:(GUCViewID)viewID{
52 | NSArray * array = self.observerList[viewID];
53 | NSMutableArray * newArray = [[NSMutableArray alloc]initWithArray:array];
54 | BOOL has = NO;
55 | for (id obj in newArray) {
56 | if (obj == observer) {
57 | has = YES;
58 | }
59 | }
60 | if (has) {
61 | [[NSNotificationCenter defaultCenter]removeObserver:observer name:self.viewIDToNotification[viewID] object:nil];
62 | [newArray removeObject:observer];
63 | [self.observerList replaceObjectAtIndex:viewID withObject:newArray];
64 | }
65 |
66 | }
67 |
68 | -(void)removeObserver:(id)observer{
69 | for (int i=0; i
10 | #import
11 |
12 | @interface GreatUserInterfaceControlAlert : NSObject
13 |
14 | +(void)alertInWiondow:(NSWindow *)window withTitle:(NSString *)title message:(NSString*)message callBack:(void(^)(int))callBack buttons:(NSString *)button,...NS_REQUIRES_NIL_TERMINATION;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GreatUserInterfaceControlAlert.m:
--------------------------------------------------------------------------------
1 | //
2 | // GreatUserInterfaceControlAlert.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/26.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "GreatUserInterfaceControlAlert.h"
10 |
11 | @implementation GreatUserInterfaceControlAlert
12 |
13 | +(void)alertInWiondow:(NSWindow *)window withTitle:(NSString *)title message:(NSString *)message callBack:(void(^)(int))callBack buttons:(NSString *)button, ...{
14 | NSAlert * alert = [[NSAlert alloc]init];
15 | [alert setMessageText:title];
16 | [alert setInformativeText:message];
17 | [alert setAlertStyle:NSAlertStyleWarning];
18 | va_list list;
19 | va_start(list, button);
20 | NSString * btn = button;
21 | while (btn!=nil) {
22 | [alert addButtonWithTitle:btn];
23 | btn = va_arg(list, NSString*);
24 | }
25 | va_end(list);//关闭列表指针
26 | [alert beginSheetModalForWindow:window completionHandler:^(NSModalResponse returnCode) {
27 | if (returnCode==NSAlertFirstButtonReturn) {
28 | if (callBack) {
29 | callBack(0);
30 | }
31 | return ;
32 | }
33 | if (returnCode==NSAlertSecondButtonReturn) {
34 | if (callBack) {
35 | callBack(1);
36 | }
37 | return;
38 | }
39 | if (returnCode==NSAlertThirdButtonReturn) {
40 | if (callBack) {
41 | callBack(2);
42 | }
43 | return;
44 | }
45 | if (callBack) {
46 | callBack((int)returnCode);
47 | }
48 | }];
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GreatUserInterfaveControlPanel.h:
--------------------------------------------------------------------------------
1 | //
2 | // GreatUserInterfaveControlPanel.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/26.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface GreatUserInterfaveControlPanel : NSObject
13 |
14 | +(NSString*)modalFilePanelUseDictionary:(BOOL)dic userFile:(BOOL)file couldCreate:(BOOL)canCreate withTitle:(NSString *)title okButton:(NSString *)ok;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Control/GreatUserInterfaveControlPanel.m:
--------------------------------------------------------------------------------
1 | //
2 | // GreatUserInterfaveControlPanel.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/26.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "GreatUserInterfaveControlPanel.h"
10 |
11 | @implementation GreatUserInterfaveControlPanel
12 |
13 | +(NSString*)modalFilePanelUseDictionary:(BOOL)dic userFile:(BOOL)file couldCreate:(BOOL)canCreate withTitle:(NSString *)title okButton:(NSString *)ok{
14 | NSOpenPanel * panel = [NSOpenPanel openPanel];
15 | [panel setMessage:title];
16 | [panel setPrompt:ok];
17 | [panel setCanChooseDirectories:dic];//是否可选择目录
18 | [panel setCanCreateDirectories:canCreate];//是否可创建目录
19 | [panel setCanChooseFiles:file];//是否可选择文件
20 | NSString * path = nil;
21 | NSInteger result = [panel runModal];
22 | if (result == NSFileHandlingPanelOKButton) {
23 | path = [panel URL].path;
24 | }
25 | return path;
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Route/RouteManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // RouteManager.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @class ProjectModel;
13 |
14 | @interface RouteManager : NSObject
15 |
16 |
17 | +(instancetype)defaultManager;
18 |
19 | -(void)presentAddProjectViewControllerWithVC:(NSViewController *)controller;
20 |
21 | -(void)showProjectDetailsWindow:(ProjectModel *)projectModel;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/Route/RouteManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // RouteManager.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "RouteManager.h"
10 | #import "AddProjectViewController.h"
11 | #import "ProjectDetailWindow.h"
12 | #import "ProjectModel.h"
13 | @interface RouteManager()
14 |
15 | @property(nonatomic,strong)AddProjectViewController * addProjectViewControllerRef;
16 | @property(nonatomic,strong)NSMutableDictionary *detailWindows;
17 |
18 |
19 | @end
20 |
21 | @implementation RouteManager
22 |
23 | +(instancetype)defaultManager{
24 | static dispatch_once_t onceToken;
25 | static RouteManager * manager = nil;
26 | dispatch_once(&onceToken, ^{
27 | if (!manager) {
28 | manager = [[RouteManager alloc]init];
29 | }
30 | });
31 | return manager;
32 | }
33 |
34 | #pragma mark -- centeral route
35 |
36 | -(void)presentAddProjectViewControllerWithVC:(NSViewController *)controller{
37 | [self.addProjectViewControllerRef clearUI];
38 | if (controller) {
39 | [controller presentViewControllerAsModalWindow:self.addProjectViewControllerRef];
40 | }else{
41 | [[NSApplication sharedApplication].keyWindow.contentViewController presentViewControllerAsModalWindow:self.addProjectViewControllerRef];
42 | }
43 | }
44 |
45 | -(void)showProjectDetailsWindow:(ProjectModel *)projectModel{
46 | for (NSString * proPath in self.detailWindows.allKeys) {
47 | if ([proPath isEqualToString:projectModel.projectPath]) {
48 | ProjectDetailWindow * window = self.detailWindows[proPath];
49 | [window updateViewWithModel:projectModel];
50 | [window showWindow:nil];
51 | return;
52 | }
53 | }
54 | ProjectDetailWindow * window = [[ProjectDetailWindow alloc]initWithWindowNibName:@"ProjectDetailWindow"];
55 | [window updateViewWithModel:projectModel];
56 | [window showWindow:nil];
57 | [self.detailWindows setObject:window forKey:projectModel.projectPath];
58 | }
59 |
60 |
61 | #pragma mark -- setter and getter
62 |
63 | -(AddProjectViewController *)addProjectViewControllerRef{
64 | if (!_addProjectViewControllerRef) {
65 | _addProjectViewControllerRef = [[AddProjectViewController alloc]init];
66 | }
67 | return _addProjectViewControllerRef;
68 | }
69 |
70 | -(NSMutableDictionary *)detailWindows{
71 | if (!_detailWindows) {
72 | _detailWindows = [NSMutableDictionary new];
73 | }
74 | return _detailWindows;
75 | }
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/ColorView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ColorView.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ColorView : NSView
12 | @property(nonatomic,strong)NSColor * backgroundColor;
13 | @end
14 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/ColorView.m:
--------------------------------------------------------------------------------
1 | //
2 | // ColorView.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "ColorView.h"
10 |
11 | @implementation ColorView
12 |
13 |
14 |
15 |
16 |
17 | - (void)drawRect:(NSRect)dirtyRect {
18 | [super drawRect:dirtyRect];
19 | [self.backgroundColor set];
20 | NSRectFill(dirtyRect);
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/MainTopBar.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainTopBar.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MainTopBar : NSView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/MainTopBar.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainTopBar.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "MainTopBar.h"
10 |
11 | @implementation MainTopBar
12 |
13 | - (void)drawRect:(NSRect)dirtyRect {
14 | [super drawRect:dirtyRect];
15 | [[NSColor colorWithRed:33.0/255.0 green:176.0/255.0 blue:275.0/255.0 alpha:1] set];
16 | NSRectFill(dirtyRect);
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/MainViewTableCellView.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewTableCellView.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MainViewTableCellModel.h"
11 |
12 | @interface MainViewTableCellView : NSTableCellView
13 |
14 | -(void)updateViewWithModel:(MainViewTableCellModel *)model;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/MainViewTableCellView.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewTableCellView.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "MainViewTableCellView.h"
10 | #import "ColorView.h"
11 |
12 | @interface MainViewTableCellView()
13 |
14 | @property (weak) IBOutlet NSTextField *logoLabel;
15 | @property (weak) IBOutlet ColorView *bottonLine;
16 | @property (weak) IBOutlet NSTextField *titleLabel;
17 | @property (weak) IBOutlet NSButton *modelButton;
18 | @property (weak) IBOutlet NSProgressIndicator *progressBar;
19 | @property (weak) IBOutlet NSProgressIndicator *indicator;
20 |
21 | @end
22 |
23 | @implementation MainViewTableCellView
24 |
25 | - (instancetype)initWithCoder:(NSCoder *)coder
26 | {
27 | self = [super initWithCoder:coder];
28 | if (self) {
29 | }
30 | return self;
31 | }
32 |
33 | -(void)awakeFromNib{
34 | [super awakeFromNib];
35 | [self installUI];
36 | }
37 |
38 | -(void)installUI{
39 | self.bottonLine.backgroundColor = [NSColor colorWithWhite:0.5 alpha:0.5];
40 | [self.bottonLine setNeedsDisplay:YES];
41 | [self.logoLabel setWantsLayer:YES];
42 | self.logoLabel.layer.masksToBounds = YES;
43 | self.logoLabel.layer.cornerRadius = 20;
44 | }
45 |
46 | - (IBAction)modelChangeAction:(NSButton *)sender {
47 |
48 | }
49 |
50 | -(void)updateViewWithModel:(MainViewTableCellModel *)model{
51 | self.logoLabel.layer.backgroundColor = [NSColor colorWithRed:((arc4random()%200)+55.0)/255.0 green:((arc4random()%200)+55.0)/255.0 blue:((arc4random()%200)+55.0)/255.0 alpha:1].CGColor;
52 | [self.logoLabel setStringValue:[model.title substringToIndex:1]];
53 | [self.titleLabel setStringValue:model.title];
54 | [self.modelButton setTitle:model.modelType];
55 | if (model.isRuning) {
56 | [self.indicator startAnimation:nil];
57 | [self.indicator setHidden:NO];
58 | }else{
59 | [self.indicator stopAnimation:nil];
60 | [self.indicator setHidden:YES];
61 | }
62 | }
63 |
64 |
65 | - (void)drawRect:(NSRect)dirtyRect {
66 | [super drawRect:dirtyRect];
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/View/MainViewTableCellView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/AddProjectViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AddProjectViewController.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AddProjectViewController : NSViewController
12 |
13 | -(void)clearUI;
14 |
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/AddProjectViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // AddProjectViewController.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "AddProjectViewController.h"
10 | #import "AddProjectViewModel.h"
11 | #import "ProjectManager.h"
12 | #import "ProjectModel.h"
13 | #import "GUC.h"
14 |
15 | #define WARNING_TITLE_STRING @"警告:您必须填写项目名称"
16 | #define WARNING_PROJECT_STRING @"警告:您必须选择一个Xcode项目(以xcodeproj或xcworkspace为后缀)"
17 | #define WARNING_PATH_STRING @"警告:您必须选择一个项目"
18 |
19 | @interface AddProjectViewController ()
20 |
21 | @property (weak) IBOutlet NSButton *addButton;
22 | @property (weak) IBOutlet NSButton *cancelButton;
23 | @property (nonatomic,strong)AddProjectViewModel * viewModel;
24 | @property (weak) IBOutlet NSTextField *projectPathTextField;
25 | @property (weak) IBOutlet NSTextField *projectTitleTextField;
26 | @property (weak) IBOutlet NSTextField *warningLabel;
27 |
28 |
29 | @end
30 |
31 | @implementation AddProjectViewController
32 |
33 |
34 |
35 | - (void)viewDidLoad {
36 | [super viewDidLoad];
37 | // Do view setup here.
38 | [self installUI];
39 | }
40 |
41 | -(void)installUI{
42 | self.title = @"添加新工程";
43 | }
44 | -(void)clearUI{
45 | [self.viewModel clearModel];
46 | [self.projectTitleTextField setStringValue:@""];
47 | [self.projectPathTextField setStringValue:@""];
48 | self.warningLabel.hidden = YES;
49 | }
50 |
51 | -(void)updateView{
52 | [self.projectPathTextField setStringValue:self.viewModel.projectPath];
53 | [self.projectTitleTextField setStringValue:self.viewModel.projectRealName];
54 | self.viewModel.projectName = self.viewModel.projectRealName;
55 | }
56 |
57 | #pragma mark -- action
58 |
59 | - (IBAction)cancel:(NSButton *)sender {
60 | [self dismissViewController:self];
61 | }
62 |
63 | - (IBAction)add:(NSButton *)sender {
64 | if (self.viewModel.projectPath.length==0) {
65 | [self.warningLabel setStringValue:WARNING_PATH_STRING];
66 | self.warningLabel.hidden= NO;
67 | return;
68 | }
69 | if (
70 | !([[self.viewModel.projectPath componentsSeparatedByString:@"."].lastObject isEqualToString:@"xcodeproj"]
71 | ||[[self.viewModel.projectPath componentsSeparatedByString:@"."].lastObject isEqualToString:@"xcworkspace"]
72 | )) {
73 | [self.warningLabel setStringValue:WARNING_PROJECT_STRING];
74 | self.warningLabel.hidden = NO;
75 | return;
76 | }
77 | if (self.projectTitleTextField.stringValue.length==0) {
78 | [self.warningLabel setStringValue:WARNING_TITLE_STRING];
79 | self.warningLabel.hidden = NO;
80 | return;
81 | }else{
82 | self.viewModel.projectName = self.projectTitleTextField.stringValue;
83 | }
84 |
85 | ProjectModel * newModel = [ProjectModel new];
86 | newModel.projectName = self.viewModel.projectName;
87 | newModel.projectPath = self.viewModel.projectPath;
88 | newModel.projectRealName = self.viewModel.projectRealName;
89 | if ([[self.viewModel.projectPath componentsSeparatedByString:@"."].lastObject isEqualToString:@"xcodeproj"]) {
90 | newModel.projectType = @"project";
91 | }else{
92 | newModel.projectType = @"workspace";
93 | }
94 | NSString * result = [[ProjectManager defaultManager] addProject:newModel];
95 | if (![result isEqualToString:@"success"]) {
96 | [self.warningLabel setStringValue:result];
97 | self.warningLabel.hidden = NO;
98 | }else{
99 | [self dismissViewController:self];
100 | GUC_REFRESH(GUCMainView);
101 | }
102 | }
103 |
104 | - (IBAction)choiceFile:(NSButton *)sender {
105 | NSString * path = [GreatUserInterfaveControlPanel modalFilePanelUseDictionary:NO userFile:YES couldCreate:NO withTitle:@"请选择Xcode工程文件" okButton:@"确定"];
106 | if (path.length>0) {
107 | self.viewModel.projectPath = path;
108 | self.viewModel.projectRealName = [[path componentsSeparatedByString:@"/"].lastObject componentsSeparatedByString:@"."].firstObject;
109 | [self updateView];
110 | }
111 | }
112 |
113 |
114 |
115 |
116 | #pragma mark -- setter and getter
117 |
118 | -(AddProjectViewModel *)viewModel{
119 | if (!_viewModel) {
120 | _viewModel = [[AddProjectViewModel alloc]init];
121 | }
122 | return _viewModel;
123 | }
124 |
125 |
126 |
127 | @end
128 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/ProjectDetailWindow.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectDetailWindow.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/24.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class ProjectModel;
12 |
13 | @interface ProjectDetailWindow : NSWindowController
14 |
15 | -(void)updateViewWithModel:(ProjectModel*)model;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : NSViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import
11 | #import "MainViewModel.h"
12 | #import "MainViewTableCellModel.h"
13 | #import "MainTopBar.h"
14 | #import "ProjectManager.h"
15 | #import "GUC.h"
16 | #import "XCBuildTaskManager.h"
17 | #import "ProjectTask.h"
18 |
19 | @interface ViewController()
20 |
21 | @property (weak) IBOutlet MainTopBar *topBarView;
22 | @property (nonatomic,strong)NSTableView * tableView;
23 | @property (nonatomic,strong)NSMenu * itemMenu;
24 |
25 | @property (nonatomic,strong)MainViewModel * controlModel;
26 |
27 | @end
28 |
29 | @implementation ViewController
30 |
31 | - (void)viewDidLoad {
32 | [super viewDidLoad];
33 | [self addNotification];
34 | [self installData];
35 | [self installView];
36 | }
37 |
38 | -(void)dealloc{
39 | GUC_REMOVE_OBSERVER(self);
40 | }
41 |
42 | -(void)addNotification{
43 | GUC_ADD_OBSERVER(self, GUCMainView, NSSelectorFromString(@"reloadData"));
44 | }
45 |
46 | -(void)installData{
47 | [self.controlModel.projectArray addObjectsFromArray:[[ProjectManager defaultManager] getAllProject]];
48 | [self.controlModel.dataArray addObjectsFromArray:[self createCellModelWithProject:[[ProjectManager defaultManager] getAllProject]]];
49 | [self.controlModel reloadData];
50 | }
51 |
52 | -(void)installView{
53 | //tableView
54 | NSScrollView * scrollView = [[NSScrollView alloc]init];
55 | scrollView.hasVerticalScroller = YES;
56 | [self.view addSubview:scrollView];
57 | [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
58 | make.leading.equalTo(@0);
59 | make.trailing.equalTo(@0);
60 | make.top.equalTo(self.topBarView.mas_bottom);
61 | make.bottom.equalTo(@0);
62 | }];
63 | scrollView.contentView.documentView = self.tableView;
64 | }
65 |
66 |
67 | -(NSArray*)createCellModelWithProject:(NSArray *)projects{
68 | NSMutableArray * res = [NSMutableArray new];
69 | for (int i=0; i
10 |
11 | @interface WindowController : NSWindowController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewController/WindowController.m:
--------------------------------------------------------------------------------
1 | //
2 | // WindowController.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "WindowController.h"
10 | #import
11 |
12 |
13 | @interface WindowController ()
14 |
15 | @end
16 |
17 | @implementation WindowController
18 |
19 | - (void)windowDidLoad {
20 | [super windowDidLoad];
21 | [self remakeTitleBar];
22 | }
23 |
24 | -(void)remakeTitleBar{
25 | self.window.titlebarAppearsTransparent = YES;
26 | self.window.titleVisibility = NSWindowTitleHidden;
27 | [self.window setMovableByWindowBackground:YES];
28 | [self.window setStyleMask:[self.window styleMask] | NSWindowStyleMaskFullSizeContentView];
29 | NSView * themeView = self.window.contentView.superview;
30 | NSView * titleView = themeView.subviews[1];
31 | titleView.autoresizesSubviews = YES;
32 | [titleView mas_remakeConstraints:^(MASConstraintMaker *make) {
33 | make.left.equalTo(@10);
34 | make.width.equalTo(@70);
35 | make.top.equalTo(@9);
36 | make.height.equalTo(@22);
37 | }];
38 | }
39 |
40 |
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/AddProjectViewModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // AddProjectViewModel.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AddProjectViewModel : NSObject
12 |
13 | @property(nonatomic,strong)NSString * projectPath;
14 | @property(nonatomic,strong)NSString * projectName;
15 |
16 | /*in line */
17 | @property(nonatomic,strong)NSString * projectRealName;
18 | -(void)clearModel;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/AddProjectViewModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // AddProjectViewModel.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/22.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "AddProjectViewModel.h"
10 |
11 | @implementation AddProjectViewModel
12 |
13 |
14 |
15 | -(void)clearModel{
16 | self.projectRealName = @"";
17 | self.projectPath = @"";
18 | self.projectName = @"";
19 | }
20 |
21 | #pragma mark -- setter and getter
22 |
23 | -(NSString *)projectName{
24 | if (!_projectName) {
25 | _projectName=@"";
26 | }
27 | return _projectName;
28 | }
29 |
30 | -(NSString *)projectPath{
31 | if (!_projectPath) {
32 | _projectPath=@"";
33 | }
34 | return _projectPath;
35 | }
36 |
37 | -(NSString *)projectRealName{
38 | if (!_projectRealName) {
39 | _projectRealName=@"";
40 | }
41 | return _projectRealName;
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/MainViewModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewModel.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "MainViewTableCellModel.h"
12 | #import "ProjectModel.h"
13 |
14 | @interface MainViewModel : NSObject
15 |
16 | @property(nonatomic,strong)NSMutableArray * projectArray;
17 |
18 | @property (nonatomic,strong)NSMutableArray * dataArray;
19 |
20 | @property (nonatomic,weak)id owner;
21 |
22 | -(void)registerTableView:(NSTableView *)tableView;
23 | -(void)reloadData;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/MainViewModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewModel.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "MainViewModel.h"
10 | #import "MainViewTableCellView.h"
11 | #import "RouteManager.h"
12 | #import "ProjectManager.h"
13 | #import "GUC.h"
14 |
15 | #define MAIN_TABLE_CELL_ID @"MainViewTableCellViewId"
16 |
17 |
18 | @interface MainViewModel()
19 | @property (nonatomic,weak)NSTableView * tableView;
20 | @end
21 |
22 | @implementation MainViewModel
23 |
24 |
25 | -(void)registerTableView:(NSTableView *)tableView{
26 | self.tableView = tableView;
27 | [self.tableView setTarget:self];
28 | [self.tableView setDoubleAction:@selector(clickCell:)];
29 | [tableView registerNib:[[NSNib alloc] initWithNibNamed:@"MainViewTableCellView" bundle:[NSBundle mainBundle]] forIdentifier:MAIN_TABLE_CELL_ID];
30 | }
31 |
32 | -(void)reloadData{
33 | [self.tableView reloadData];
34 | }
35 |
36 | -(void)clickCell:(id)sender{
37 | ProjectModel * model =self.projectArray[[self.tableView clickedRow]];
38 | [[RouteManager defaultManager] showProjectDetailsWindow:model];
39 | }
40 |
41 | -(void)deleteProject{
42 | ProjectModel * model =self.projectArray[[self.tableView clickedRow]];
43 | [GreatUserInterfaceControlAlert alertInWiondow:[NSApplication sharedApplication].keyWindow withTitle:@"警告" message:@"您是否真的要删除此项目" callBack:^(int index){
44 | if (index==1) {
45 | [[ProjectManager defaultManager]deleteProject:model];
46 | //需要刷新界面
47 | GUC_REFRESH(GUCMainView);
48 | }
49 | } buttons:@"取消",@"确认删除", nil];
50 |
51 | }
52 |
53 | #pragma mark -- tableView DataSource
54 |
55 | -(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView{
56 | return self.dataArray.count;
57 | }
58 |
59 | #pragma mark -- tableView Delegate
60 |
61 | -(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{
62 | MainViewTableCellView * rowView = [tableView makeViewWithIdentifier:MAIN_TABLE_CELL_ID owner:self];
63 | [rowView updateViewWithModel:self.dataArray[row]];
64 | return rowView;
65 | }
66 | -(CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row{
67 | return 60.0;
68 | }
69 |
70 | #pragma mark -- release
71 |
72 | -(void)dealloc{
73 | self.tableView.delegate = nil;
74 | self.tableView.dataSource =nil;
75 | self.owner = nil;
76 | }
77 |
78 | #pragma mark -- setter and getter
79 |
80 | -(NSMutableArray *)dataArray{
81 | if (!_dataArray) {
82 | _dataArray = [NSMutableArray new];
83 | }
84 | return _dataArray;
85 | }
86 |
87 | -(NSMutableArray *)projectArray{
88 | if (!_projectArray) {
89 | _projectArray = [NSMutableArray array];
90 | }
91 | return _projectArray;
92 | }
93 |
94 | @end
95 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/MainViewTableCellModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewTableCellModel.h
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ProjectModel.h"
11 |
12 | @interface MainViewTableCellModel : NSObject
13 |
14 | @property (nonatomic,strong)NSString * title;
15 | @property (nonatomic,strong)ProjectModel * projModel;
16 | @property (nonatomic,strong)NSString * modelType;
17 | @property (nonatomic,assign)BOOL isRuning;
18 | /*...other...*/
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/AutoBuildApp/UIUnit/ViewModel/MainViewTableCellModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewTableCellModel.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/21.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import "MainViewTableCellModel.h"
10 |
11 | @implementation MainViewTableCellModel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/AutoBuildApp/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // AutoBuildApp
4 | //
5 | // Created by jaki on 2017/6/20.
6 | // Copyright © 2017年 jaki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'AutoBuildApp' do
5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6 | # use_frameworks!
7 |
8 | # Pods for AutoBuildApp
9 | pod 'Masonry', '~> 1.0.2'
10 |
11 | pod 'AFNetworking'
12 |
13 | end
14 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (3.1.0):
3 | - AFNetworking/NSURLSession (= 3.1.0)
4 | - AFNetworking/Reachability (= 3.1.0)
5 | - AFNetworking/Security (= 3.1.0)
6 | - AFNetworking/Serialization (= 3.1.0)
7 | - AFNetworking/UIKit (= 3.1.0)
8 | - AFNetworking/NSURLSession (3.1.0):
9 | - AFNetworking/Reachability
10 | - AFNetworking/Security
11 | - AFNetworking/Serialization
12 | - AFNetworking/Reachability (3.1.0)
13 | - AFNetworking/Security (3.1.0)
14 | - AFNetworking/Serialization (3.1.0)
15 | - Masonry (1.0.2)
16 |
17 | DEPENDENCIES:
18 | - AFNetworking
19 | - Masonry (~> 1.0.2)
20 |
21 | SPEC CHECKSUMS:
22 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
23 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e
24 |
25 | PODFILE CHECKSUM: 122f0be6d2231db518fe6e5f7b901b9737f9f3a4
26 |
27 | COCOAPODS: 1.3.0.beta.2
28 |
--------------------------------------------------------------------------------
/Pods/AFNetworking/AFNetworking/AFNetworking.h:
--------------------------------------------------------------------------------
1 | // AFNetworking.h
2 | //
3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 | #import
25 | #import
26 |
27 | #ifndef _AFNETWORKING_
28 | #define _AFNETWORKING_
29 |
30 | #import "AFURLRequestSerialization.h"
31 | #import "AFURLResponseSerialization.h"
32 | #import "AFSecurityPolicy.h"
33 |
34 | #if !TARGET_OS_WATCH
35 | #import "AFNetworkReachabilityManager.h"
36 | #endif
37 |
38 | #import "AFURLSessionManager.h"
39 | #import "AFHTTPSessionManager.h"
40 |
41 | #endif /* _AFNETWORKING_ */
42 |
--------------------------------------------------------------------------------
/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h:
--------------------------------------------------------------------------------
1 | // AFSecurityPolicy.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 | #import
24 |
25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
26 | AFSSLPinningModeNone,
27 | AFSSLPinningModePublicKey,
28 | AFSSLPinningModeCertificate,
29 | };
30 |
31 | /**
32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
33 |
34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
35 | */
36 |
37 | NS_ASSUME_NONNULL_BEGIN
38 |
39 | @interface AFSecurityPolicy : NSObject
40 |
41 | /**
42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
43 | */
44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
45 |
46 | /**
47 | The certificates used to evaluate server trust according to the SSL pinning mode.
48 |
49 | By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
50 |
51 | Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
52 | */
53 | @property (nonatomic, strong, nullable) NSSet *pinnedCertificates;
54 |
55 | /**
56 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
57 | */
58 | @property (nonatomic, assign) BOOL allowInvalidCertificates;
59 |
60 | /**
61 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`.
62 | */
63 | @property (nonatomic, assign) BOOL validatesDomainName;
64 |
65 | ///-----------------------------------------
66 | /// @name Getting Certificates from the Bundle
67 | ///-----------------------------------------
68 |
69 | /**
70 | Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
71 |
72 | @return The certificates included in the given bundle.
73 | */
74 | + (NSSet *)certificatesInBundle:(NSBundle *)bundle;
75 |
76 | ///-----------------------------------------
77 | /// @name Getting Specific Security Policies
78 | ///-----------------------------------------
79 |
80 | /**
81 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys.
82 |
83 | @return The default security policy.
84 | */
85 | + (instancetype)defaultPolicy;
86 |
87 | ///---------------------
88 | /// @name Initialization
89 | ///---------------------
90 |
91 | /**
92 | Creates and returns a security policy with the specified pinning mode.
93 |
94 | @param pinningMode The SSL pinning mode.
95 |
96 | @return A new security policy.
97 | */
98 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
99 |
100 | /**
101 | Creates and returns a security policy with the specified pinning mode.
102 |
103 | @param pinningMode The SSL pinning mode.
104 | @param pinnedCertificates The certificates to pin against.
105 |
106 | @return A new security policy.
107 | */
108 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates;
109 |
110 | ///------------------------------
111 | /// @name Evaluating Server Trust
112 | ///------------------------------
113 |
114 | /**
115 | Whether or not the specified server trust should be accepted, based on the security policy.
116 |
117 | This method should be used when responding to an authentication challenge from a server.
118 |
119 | @param serverTrust The X.509 certificate trust of the server.
120 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
121 |
122 | @return Whether or not to trust the server.
123 | */
124 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
125 | forDomain:(nullable NSString *)domain;
126 |
127 | @end
128 |
129 | NS_ASSUME_NONNULL_END
130 |
131 | ///----------------
132 | /// @name Constants
133 | ///----------------
134 |
135 | /**
136 | ## SSL Pinning Modes
137 |
138 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
139 |
140 | enum {
141 | AFSSLPinningModeNone,
142 | AFSSLPinningModePublicKey,
143 | AFSSLPinningModeCertificate,
144 | }
145 |
146 | `AFSSLPinningModeNone`
147 | Do not used pinned certificates to validate servers.
148 |
149 | `AFSSLPinningModePublicKey`
150 | Validate host certificates against public keys of pinned certificates.
151 |
152 | `AFSSLPinningModeCertificate`
153 | Validate host certificates against pinned certificates.
154 | */
155 |
--------------------------------------------------------------------------------
/Pods/AFNetworking/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFNetworking.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFNetworking.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASCompositeConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraint+Private.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASConstraintMaker.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraintMaker.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASLayoutConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASUtilities.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASUtilities.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASViewAttribute.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASViewConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/Masonry.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/View+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/View+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFNetworking.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFNetworking.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h:
--------------------------------------------------------------------------------
1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASCompositeConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraint+Private.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASConstraintMaker.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASConstraintMaker.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASLayoutConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASUtilities.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASUtilities.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASViewAttribute.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/MASViewConstraint.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/Masonry.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/View+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/View+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (3.1.0):
3 | - AFNetworking/NSURLSession (= 3.1.0)
4 | - AFNetworking/Reachability (= 3.1.0)
5 | - AFNetworking/Security (= 3.1.0)
6 | - AFNetworking/Serialization (= 3.1.0)
7 | - AFNetworking/UIKit (= 3.1.0)
8 | - AFNetworking/NSURLSession (3.1.0):
9 | - AFNetworking/Reachability
10 | - AFNetworking/Security
11 | - AFNetworking/Serialization
12 | - AFNetworking/Reachability (3.1.0)
13 | - AFNetworking/Security (3.1.0)
14 | - AFNetworking/Serialization (3.1.0)
15 | - Masonry (1.0.2)
16 |
17 | DEPENDENCIES:
18 | - AFNetworking
19 | - Masonry (~> 1.0.2)
20 |
21 | SPEC CHECKSUMS:
22 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
23 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e
24 |
25 | PODFILE CHECKSUM: 122f0be6d2231db518fe6e5f7b901b9737f9f3a4
26 |
27 | COCOAPODS: 1.3.0.beta.2
28 |
--------------------------------------------------------------------------------
/Pods/Masonry/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | /**
13 | * A group of MASConstraint objects
14 | */
15 | @interface MASCompositeConstraint : MASConstraint
16 |
17 | /**
18 | * Creates a composite with a predefined array of children
19 | *
20 | * @param children child MASConstraints
21 | *
22 | * @return a composite constraint
23 | */
24 | - (id)initWithChildren:(NSArray *)children;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASCompositeConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASCompositeConstraint.h"
10 | #import "MASConstraint+Private.h"
11 |
12 | @interface MASCompositeConstraint ()
13 |
14 | @property (nonatomic, strong) id mas_key;
15 | @property (nonatomic, strong) NSMutableArray *childConstraints;
16 |
17 | @end
18 |
19 | @implementation MASCompositeConstraint
20 |
21 | - (id)initWithChildren:(NSArray *)children {
22 | self = [super init];
23 | if (!self) return nil;
24 |
25 | _childConstraints = [children mutableCopy];
26 | for (MASConstraint *constraint in _childConstraints) {
27 | constraint.delegate = self;
28 | }
29 |
30 | return self;
31 | }
32 |
33 | #pragma mark - MASConstraintDelegate
34 |
35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
36 | NSUInteger index = [self.childConstraints indexOfObject:constraint];
37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint];
39 | }
40 |
41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
42 | id strongDelegate = self.delegate;
43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
44 | newConstraint.delegate = self;
45 | [self.childConstraints addObject:newConstraint];
46 | return newConstraint;
47 | }
48 |
49 | #pragma mark - NSLayoutConstraint multiplier proxies
50 |
51 | - (MASConstraint * (^)(CGFloat))multipliedBy {
52 | return ^id(CGFloat multiplier) {
53 | for (MASConstraint *constraint in self.childConstraints) {
54 | constraint.multipliedBy(multiplier);
55 | }
56 | return self;
57 | };
58 | }
59 |
60 | - (MASConstraint * (^)(CGFloat))dividedBy {
61 | return ^id(CGFloat divider) {
62 | for (MASConstraint *constraint in self.childConstraints) {
63 | constraint.dividedBy(divider);
64 | }
65 | return self;
66 | };
67 | }
68 |
69 | #pragma mark - MASLayoutPriority proxy
70 |
71 | - (MASConstraint * (^)(MASLayoutPriority))priority {
72 | return ^id(MASLayoutPriority priority) {
73 | for (MASConstraint *constraint in self.childConstraints) {
74 | constraint.priority(priority);
75 | }
76 | return self;
77 | };
78 | }
79 |
80 | #pragma mark - NSLayoutRelation proxy
81 |
82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation {
83 | return ^id(id attr, NSLayoutRelation relation) {
84 | for (MASConstraint *constraint in self.childConstraints.copy) {
85 | constraint.equalToWithRelation(attr, relation);
86 | }
87 | return self;
88 | };
89 | }
90 |
91 | #pragma mark - attribute chaining
92 |
93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
95 | return self;
96 | }
97 |
98 | #pragma mark - Animator proxy
99 |
100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
101 |
102 | - (MASConstraint *)animator {
103 | for (MASConstraint *constraint in self.childConstraints) {
104 | [constraint animator];
105 | }
106 | return self;
107 | }
108 |
109 | #endif
110 |
111 | #pragma mark - debug helpers
112 |
113 | - (MASConstraint * (^)(id))key {
114 | return ^id(id key) {
115 | self.mas_key = key;
116 | int i = 0;
117 | for (MASConstraint *constraint in self.childConstraints) {
118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]);
119 | }
120 | return self;
121 | };
122 | }
123 |
124 | #pragma mark - NSLayoutConstraint constant setters
125 |
126 | - (void)setInsets:(MASEdgeInsets)insets {
127 | for (MASConstraint *constraint in self.childConstraints) {
128 | constraint.insets = insets;
129 | }
130 | }
131 |
132 | - (void)setOffset:(CGFloat)offset {
133 | for (MASConstraint *constraint in self.childConstraints) {
134 | constraint.offset = offset;
135 | }
136 | }
137 |
138 | - (void)setSizeOffset:(CGSize)sizeOffset {
139 | for (MASConstraint *constraint in self.childConstraints) {
140 | constraint.sizeOffset = sizeOffset;
141 | }
142 | }
143 |
144 | - (void)setCenterOffset:(CGPoint)centerOffset {
145 | for (MASConstraint *constraint in self.childConstraints) {
146 | constraint.centerOffset = centerOffset;
147 | }
148 | }
149 |
150 | #pragma mark - MASConstraint
151 |
152 | - (void)activate {
153 | for (MASConstraint *constraint in self.childConstraints) {
154 | [constraint activate];
155 | }
156 | }
157 |
158 | - (void)deactivate {
159 | for (MASConstraint *constraint in self.childConstraints) {
160 | [constraint deactivate];
161 | }
162 | }
163 |
164 | - (void)install {
165 | for (MASConstraint *constraint in self.childConstraints) {
166 | constraint.updateExisting = self.updateExisting;
167 | [constraint install];
168 | }
169 | }
170 |
171 | - (void)uninstall {
172 | for (MASConstraint *constraint in self.childConstraints) {
173 | [constraint uninstall];
174 | }
175 | }
176 |
177 | @end
178 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint+Private.h
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 29/04/14.
6 | // Copyright (c) 2014 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 |
11 | @protocol MASConstraintDelegate;
12 |
13 |
14 | @interface MASConstraint ()
15 |
16 | /**
17 | * Whether or not to check for an existing constraint instead of adding constraint
18 | */
19 | @property (nonatomic, assign) BOOL updateExisting;
20 |
21 | /**
22 | * Usually MASConstraintMaker but could be a parent MASConstraint
23 | */
24 | @property (nonatomic, weak) id delegate;
25 |
26 | /**
27 | * Based on a provided value type, is equal to calling:
28 | * NSNumber - setOffset:
29 | * NSValue with CGPoint - setPointOffset:
30 | * NSValue with CGSize - setSizeOffset:
31 | * NSValue with MASEdgeInsets - setInsets:
32 | */
33 | - (void)setLayoutConstantWithValue:(NSValue *)value;
34 |
35 | @end
36 |
37 |
38 | @interface MASConstraint (Abstract)
39 |
40 | /**
41 | * Sets the constraint relation to given NSLayoutRelation
42 | * returns a block which accepts one of the following:
43 | * MASViewAttribute, UIView, NSValue, NSArray
44 | * see readme for more details.
45 | */
46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation;
47 |
48 | /**
49 | * Override to set a custom chaining behaviour
50 | */
51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
52 |
53 | @end
54 |
55 |
56 | @protocol MASConstraintDelegate
57 |
58 | /**
59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example
60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks
61 | */
62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint;
63 |
64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASConstraintMaker.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraintBuilder.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | typedef NS_OPTIONS(NSInteger, MASAttribute) {
13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft,
14 | MASAttributeRight = 1 << NSLayoutAttributeRight,
15 | MASAttributeTop = 1 << NSLayoutAttributeTop,
16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom,
17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading,
18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing,
19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth,
20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight,
21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX,
22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
24 |
25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
26 |
27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline,
28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline,
29 |
30 | #endif
31 |
32 | #if TARGET_OS_IPHONE || TARGET_OS_TV
33 |
34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin,
37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin,
38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin,
39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin,
40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins,
41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins,
42 |
43 | #endif
44 |
45 | };
46 |
47 | /**
48 | * Provides factory methods for creating MASConstraints.
49 | * Constraints are collected until they are ready to be installed
50 | *
51 | */
52 | @interface MASConstraintMaker : NSObject
53 |
54 | /**
55 | * The following properties return a new MASViewConstraint
56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute
57 | */
58 | @property (nonatomic, strong, readonly) MASConstraint *left;
59 | @property (nonatomic, strong, readonly) MASConstraint *top;
60 | @property (nonatomic, strong, readonly) MASConstraint *right;
61 | @property (nonatomic, strong, readonly) MASConstraint *bottom;
62 | @property (nonatomic, strong, readonly) MASConstraint *leading;
63 | @property (nonatomic, strong, readonly) MASConstraint *trailing;
64 | @property (nonatomic, strong, readonly) MASConstraint *width;
65 | @property (nonatomic, strong, readonly) MASConstraint *height;
66 | @property (nonatomic, strong, readonly) MASConstraint *centerX;
67 | @property (nonatomic, strong, readonly) MASConstraint *centerY;
68 | @property (nonatomic, strong, readonly) MASConstraint *baseline;
69 |
70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
71 |
72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline;
73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline;
74 |
75 | #endif
76 |
77 | #if TARGET_OS_IPHONE || TARGET_OS_TV
78 |
79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin;
80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin;
81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin;
82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin;
83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin;
84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin;
85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins;
86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins;
87 |
88 | #endif
89 |
90 | /**
91 | * Returns a block which creates a new MASCompositeConstraint with the first item set
92 | * to the makers associated view and children corresponding to the set bits in the
93 | * MASAttribute parameter. Combine multiple attributes via binary-or.
94 | */
95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs);
96 |
97 | /**
98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges
99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right)
100 | * with the first item set to the makers associated view
101 | */
102 | @property (nonatomic, strong, readonly) MASConstraint *edges;
103 |
104 | /**
105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize
106 | * which generates the appropriate MASViewConstraint children (width, height)
107 | * with the first item set to the makers associated view
108 | */
109 | @property (nonatomic, strong, readonly) MASConstraint *size;
110 |
111 | /**
112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter
113 | * which generates the appropriate MASViewConstraint children (centerX, centerY)
114 | * with the first item set to the makers associated view
115 | */
116 | @property (nonatomic, strong, readonly) MASConstraint *center;
117 |
118 | /**
119 | * Whether or not to check for an existing constraint instead of adding constraint
120 | */
121 | @property (nonatomic, assign) BOOL updateExisting;
122 |
123 | /**
124 | * Whether or not to remove existing constraints prior to installing
125 | */
126 | @property (nonatomic, assign) BOOL removeExisting;
127 |
128 | /**
129 | * initialises the maker with a default view
130 | *
131 | * @param view any MASConstrait are created with this view as the first item
132 | *
133 | * @return a new MASConstraintMaker
134 | */
135 | - (id)initWithView:(MAS_VIEW *)view;
136 |
137 | /**
138 | * Calls install method on any MASConstraints which have been created by this maker
139 | *
140 | * @return an array of all the installed MASConstraints
141 | */
142 | - (NSArray *)install;
143 |
144 | - (MASConstraint * (^)(dispatch_block_t))group;
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * When you are debugging or printing the constraints attached to a view this subclass
13 | * makes it easier to identify which constraints have been created via Masonry
14 | */
15 | @interface MASLayoutConstraint : NSLayoutConstraint
16 |
17 | /**
18 | * a key to associate with this constraint
19 | */
20 | @property (nonatomic, strong) id mas_key;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASLayoutConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASLayoutConstraint.h"
10 |
11 | @implementation MASLayoutConstraint
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASUtilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASUtilities.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 19/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 |
13 | #if TARGET_OS_IPHONE || TARGET_OS_TV
14 |
15 | #import
16 | #define MAS_VIEW UIView
17 | #define MAS_VIEW_CONTROLLER UIViewController
18 | #define MASEdgeInsets UIEdgeInsets
19 |
20 | typedef UILayoutPriority MASLayoutPriority;
21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;
26 |
27 | #elif TARGET_OS_MAC
28 |
29 | #import
30 | #define MAS_VIEW NSView
31 | #define MASEdgeInsets NSEdgeInsets
32 |
33 | typedef NSLayoutPriority MASLayoutPriority;
34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired;
35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh;
36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow;
37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501;
38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut;
39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow;
40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow;
41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression;
42 |
43 | #endif
44 |
45 | /**
46 | * Allows you to attach keys to objects matching the variable names passed.
47 | *
48 | * view1.mas_key = @"view1", view2.mas_key = @"view2";
49 | *
50 | * is equivalent to:
51 | *
52 | * MASAttachKeys(view1, view2);
53 | */
54 | #define MASAttachKeys(...) \
55 | { \
56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \
57 | for (id key in keyPairs.allKeys) { \
58 | id obj = keyPairs[key]; \
59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \
60 | @"Cannot attach mas_key to %@", obj); \
61 | [obj setMas_key:key]; \
62 | } \
63 | }
64 |
65 | /**
66 | * Used to create object hashes
67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html
68 | */
69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger))
70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch)))
71 |
72 | /**
73 | * Given a scalar or struct value, wraps it in NSValue
74 | * Based on EXPObjectify: https://github.com/specta/expecta
75 | */
76 | static inline id _MASBoxValue(const char *type, ...) {
77 | va_list v;
78 | va_start(v, type);
79 | id obj = nil;
80 | if (strcmp(type, @encode(id)) == 0) {
81 | id actual = va_arg(v, id);
82 | obj = actual;
83 | } else if (strcmp(type, @encode(CGPoint)) == 0) {
84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint);
85 | obj = [NSValue value:&actual withObjCType:type];
86 | } else if (strcmp(type, @encode(CGSize)) == 0) {
87 | CGSize actual = (CGSize)va_arg(v, CGSize);
88 | obj = [NSValue value:&actual withObjCType:type];
89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) {
90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets);
91 | obj = [NSValue value:&actual withObjCType:type];
92 | } else if (strcmp(type, @encode(double)) == 0) {
93 | double actual = (double)va_arg(v, double);
94 | obj = [NSNumber numberWithDouble:actual];
95 | } else if (strcmp(type, @encode(float)) == 0) {
96 | float actual = (float)va_arg(v, double);
97 | obj = [NSNumber numberWithFloat:actual];
98 | } else if (strcmp(type, @encode(int)) == 0) {
99 | int actual = (int)va_arg(v, int);
100 | obj = [NSNumber numberWithInt:actual];
101 | } else if (strcmp(type, @encode(long)) == 0) {
102 | long actual = (long)va_arg(v, long);
103 | obj = [NSNumber numberWithLong:actual];
104 | } else if (strcmp(type, @encode(long long)) == 0) {
105 | long long actual = (long long)va_arg(v, long long);
106 | obj = [NSNumber numberWithLongLong:actual];
107 | } else if (strcmp(type, @encode(short)) == 0) {
108 | short actual = (short)va_arg(v, int);
109 | obj = [NSNumber numberWithShort:actual];
110 | } else if (strcmp(type, @encode(char)) == 0) {
111 | char actual = (char)va_arg(v, int);
112 | obj = [NSNumber numberWithChar:actual];
113 | } else if (strcmp(type, @encode(bool)) == 0) {
114 | bool actual = (bool)va_arg(v, int);
115 | obj = [NSNumber numberWithBool:actual];
116 | } else if (strcmp(type, @encode(unsigned char)) == 0) {
117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int);
118 | obj = [NSNumber numberWithUnsignedChar:actual];
119 | } else if (strcmp(type, @encode(unsigned int)) == 0) {
120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int);
121 | obj = [NSNumber numberWithUnsignedInt:actual];
122 | } else if (strcmp(type, @encode(unsigned long)) == 0) {
123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long);
124 | obj = [NSNumber numberWithUnsignedLong:actual];
125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) {
126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long);
127 | obj = [NSNumber numberWithUnsignedLongLong:actual];
128 | } else if (strcmp(type, @encode(unsigned short)) == 0) {
129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int);
130 | obj = [NSNumber numberWithUnsignedShort:actual];
131 | }
132 | va_end(v);
133 | return obj;
134 | }
135 |
136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value))
137 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASAttribute.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * An immutable tuple which stores the view and the related NSLayoutAttribute.
13 | * Describes part of either the left or right hand side of a constraint equation
14 | */
15 | @interface MASViewAttribute : NSObject
16 |
17 | /**
18 | * The view which the reciever relates to. Can be nil if item is not a view.
19 | */
20 | @property (nonatomic, weak, readonly) MAS_VIEW *view;
21 |
22 | /**
23 | * The item which the reciever relates to.
24 | */
25 | @property (nonatomic, weak, readonly) id item;
26 |
27 | /**
28 | * The attribute which the reciever relates to
29 | */
30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
31 |
32 | /**
33 | * Convenience initializer.
34 | */
35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
36 |
37 | /**
38 | * The designated initializer.
39 | */
40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
41 |
42 | /**
43 | * Determine whether the layoutAttribute is a size attribute
44 | *
45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
46 | */
47 | - (BOOL)isSizeAttribute;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewAttribute.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASAttribute.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 |
11 | @implementation MASViewAttribute
12 |
13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
15 | return self;
16 | }
17 |
18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
19 | self = [super init];
20 | if (!self) return nil;
21 |
22 | _view = view;
23 | _item = item;
24 | _layoutAttribute = layoutAttribute;
25 |
26 | return self;
27 | }
28 |
29 | - (BOOL)isSizeAttribute {
30 | return self.layoutAttribute == NSLayoutAttributeWidth
31 | || self.layoutAttribute == NSLayoutAttributeHeight;
32 | }
33 |
34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute {
35 | if ([viewAttribute isKindOfClass:self.class]) {
36 | return self.view == viewAttribute.view
37 | && self.layoutAttribute == viewAttribute.layoutAttribute;
38 | }
39 | return [super isEqual:viewAttribute];
40 | }
41 |
42 | - (NSUInteger)hash {
43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 | #import "MASUtilities.h"
13 |
14 | /**
15 | * A single constraint.
16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
17 | */
18 | @interface MASViewConstraint : MASConstraint
19 |
20 | /**
21 | * First item/view and first attribute of the NSLayoutConstraint
22 | */
23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
24 |
25 | /**
26 | * Second item/view and second attribute of the NSLayoutConstraint
27 | */
28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
29 |
30 | /**
31 | * initialises the MASViewConstraint with the first part of the equation
32 | *
33 | * @param firstViewAttribute view.mas_left, view.mas_width etc.
34 | *
35 | * @return a new view constraint
36 | */
37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
38 |
39 | /**
40 | * Returns all MASViewConstraints installed with this view as a first item.
41 | *
42 | * @param view A view to retrieve constraints for.
43 | *
44 | * @return An array of MASViewConstraints.
45 | */
46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Masonry.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for Masonry.
12 | FOUNDATION_EXPORT double MasonryVersionNumber;
13 |
14 | //! Project version string for Masonry.
15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
16 |
17 | #import "MASUtilities.h"
18 | #import "View+MASAdditions.h"
19 | #import "View+MASShorthandAdditions.h"
20 | #import "ViewController+MASAdditions.h"
21 | #import "NSArray+MASAdditions.h"
22 | #import "NSArray+MASShorthandAdditions.h"
23 | #import "MASConstraint.h"
24 | #import "MASCompositeConstraint.h"
25 | #import "MASViewAttribute.h"
26 | #import "MASViewConstraint.h"
27 | #import "MASConstraintMaker.h"
28 | #import "MASLayoutConstraint.h"
29 | #import "NSLayoutConstraint+MASDebugAdditions.h"
30 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.h
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | typedef NS_ENUM(NSUInteger, MASAxisType) {
14 | MASAxisTypeHorizontal,
15 | MASAxisTypeVertical
16 | };
17 |
18 | @interface NSArray (MASAdditions)
19 |
20 | /**
21 | * Creates a MASConstraintMaker with each view in the callee.
22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view
23 | *
24 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
25 | *
26 | * @return Array of created MASConstraints
27 | */
28 | - (NSArray *)mas_makeConstraints:(void (^)(MASConstraintMaker *make))block;
29 |
30 | /**
31 | * Creates a MASConstraintMaker with each view in the callee.
32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
33 | * If an existing constraint exists then it will be updated instead.
34 | *
35 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
36 | *
37 | * @return Array of created/updated MASConstraints
38 | */
39 | - (NSArray *)mas_updateConstraints:(void (^)(MASConstraintMaker *make))block;
40 |
41 | /**
42 | * Creates a MASConstraintMaker with each view in the callee.
43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
44 | * All constraints previously installed for the views will be removed.
45 | *
46 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
47 | *
48 | * @return Array of created/updated MASConstraints
49 | */
50 | - (NSArray *)mas_remakeConstraints:(void (^)(MASConstraintMaker *make))block;
51 |
52 | /**
53 | * distribute with fixed spacing
54 | *
55 | * @param axisType which axis to distribute items along
56 | * @param fixedSpacing the spacing between each item
57 | * @param leadSpacing the spacing before the first item and the container
58 | * @param tailSpacing the spacing after the last item and the container
59 | */
60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
61 |
62 | /**
63 | * distribute with fixed item size
64 | *
65 | * @param axisType which axis to distribute items along
66 | * @param fixedItemLength the fixed length of each item
67 | * @param leadSpacing the spacing before the first item and the container
68 | * @param tailSpacing the spacing after the last item and the container
69 | */
70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.m
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 | #import "View+MASAdditions.h"
11 |
12 | @implementation NSArray (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block {
15 | NSMutableArray *constraints = [NSMutableArray array];
16 | for (MAS_VIEW *view in self) {
17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]];
19 | }
20 | return constraints;
21 | }
22 |
23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block {
24 | NSMutableArray *constraints = [NSMutableArray array];
25 | for (MAS_VIEW *view in self) {
26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]];
28 | }
29 | return constraints;
30 | }
31 |
32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
33 | NSMutableArray *constraints = [NSMutableArray array];
34 | for (MAS_VIEW *view in self) {
35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]];
37 | }
38 | return constraints;
39 | }
40 |
41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
42 | if (self.count < 2) {
43 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
44 | return;
45 | }
46 |
47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
48 | if (axisType == MASAxisTypeHorizontal) {
49 | MAS_VIEW *prev;
50 | for (int i = 0; i < self.count; i++) {
51 | MAS_VIEW *v = self[i];
52 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
53 | if (prev) {
54 | make.width.equalTo(prev);
55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing);
56 | if (i == self.count - 1) {//last one
57 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
58 | }
59 | }
60 | else {//first one
61 | make.left.equalTo(tempSuperView).offset(leadSpacing);
62 | }
63 |
64 | }];
65 | prev = v;
66 | }
67 | }
68 | else {
69 | MAS_VIEW *prev;
70 | for (int i = 0; i < self.count; i++) {
71 | MAS_VIEW *v = self[i];
72 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
73 | if (prev) {
74 | make.height.equalTo(prev);
75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing);
76 | if (i == self.count - 1) {//last one
77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
78 | }
79 | }
80 | else {//first one
81 | make.top.equalTo(tempSuperView).offset(leadSpacing);
82 | }
83 |
84 | }];
85 | prev = v;
86 | }
87 | }
88 | }
89 |
90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
91 | if (self.count < 2) {
92 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
93 | return;
94 | }
95 |
96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
97 | if (axisType == MASAxisTypeHorizontal) {
98 | MAS_VIEW *prev;
99 | for (int i = 0; i < self.count; i++) {
100 | MAS_VIEW *v = self[i];
101 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
102 | make.width.equalTo(@(fixedItemLength));
103 | if (prev) {
104 | if (i == self.count - 1) {//last one
105 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
106 | }
107 | else {
108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
110 | }
111 | }
112 | else {//first one
113 | make.left.equalTo(tempSuperView).offset(leadSpacing);
114 | }
115 | }];
116 | prev = v;
117 | }
118 | }
119 | else {
120 | MAS_VIEW *prev;
121 | for (int i = 0; i < self.count; i++) {
122 | MAS_VIEW *v = self[i];
123 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
124 | make.height.equalTo(@(fixedItemLength));
125 | if (prev) {
126 | if (i == self.count - 1) {//last one
127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
128 | }
129 | else {
130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
132 | }
133 | }
134 | else {//first one
135 | make.top.equalTo(tempSuperView).offset(leadSpacing);
136 | }
137 | }];
138 | prev = v;
139 | }
140 | }
141 | }
142 |
143 | - (MAS_VIEW *)mas_commonSuperviewOfViews
144 | {
145 | MAS_VIEW *commonSuperview = nil;
146 | MAS_VIEW *previousView = nil;
147 | for (id object in self) {
148 | if ([object isKindOfClass:[MAS_VIEW class]]) {
149 | MAS_VIEW *view = (MAS_VIEW *)object;
150 | if (previousView) {
151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview];
152 | } else {
153 | commonSuperview = view;
154 | }
155 | previousView = view;
156 | }
157 | }
158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy.");
159 | return commonSuperview;
160 | }
161 |
162 | @end
163 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand array additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface NSArray (MASShorthandAdditions)
18 |
19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
22 |
23 | @end
24 |
25 | @implementation NSArray (MASShorthandAdditions)
26 |
27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
28 | return [self mas_makeConstraints:block];
29 | }
30 |
31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
32 | return [self mas_updateConstraints:block];
33 | }
34 |
35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
36 | return [self mas_remakeConstraints:block];
37 | }
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * makes debug and log output of NSLayoutConstraints more readable
13 | */
14 | @interface NSLayoutConstraint (MASDebugAdditions)
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSLayoutConstraint+MASDebugAdditions.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 |
13 | @implementation NSLayoutConstraint (MASDebugAdditions)
14 |
15 | #pragma mark - description maps
16 |
17 | + (NSDictionary *)layoutRelationDescriptionsByValue {
18 | static dispatch_once_t once;
19 | static NSDictionary *descriptionMap;
20 | dispatch_once(&once, ^{
21 | descriptionMap = @{
22 | @(NSLayoutRelationEqual) : @"==",
23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=",
24 | @(NSLayoutRelationLessThanOrEqual) : @"<=",
25 | };
26 | });
27 | return descriptionMap;
28 | }
29 |
30 | + (NSDictionary *)layoutAttributeDescriptionsByValue {
31 | static dispatch_once_t once;
32 | static NSDictionary *descriptionMap;
33 | dispatch_once(&once, ^{
34 | descriptionMap = @{
35 | @(NSLayoutAttributeTop) : @"top",
36 | @(NSLayoutAttributeLeft) : @"left",
37 | @(NSLayoutAttributeBottom) : @"bottom",
38 | @(NSLayoutAttributeRight) : @"right",
39 | @(NSLayoutAttributeLeading) : @"leading",
40 | @(NSLayoutAttributeTrailing) : @"trailing",
41 | @(NSLayoutAttributeWidth) : @"width",
42 | @(NSLayoutAttributeHeight) : @"height",
43 | @(NSLayoutAttributeCenterX) : @"centerX",
44 | @(NSLayoutAttributeCenterY) : @"centerY",
45 | @(NSLayoutAttributeBaseline) : @"baseline",
46 |
47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline",
49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline",
50 | #endif
51 |
52 | #if TARGET_OS_IPHONE || TARGET_OS_TV
53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin",
54 | @(NSLayoutAttributeRightMargin) : @"rightMargin",
55 | @(NSLayoutAttributeTopMargin) : @"topMargin",
56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin",
57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin",
58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin",
59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins",
60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins",
61 | #endif
62 |
63 | };
64 |
65 | });
66 | return descriptionMap;
67 | }
68 |
69 |
70 | + (NSDictionary *)layoutPriorityDescriptionsByValue {
71 | static dispatch_once_t once;
72 | static NSDictionary *descriptionMap;
73 | dispatch_once(&once, ^{
74 | #if TARGET_OS_IPHONE || TARGET_OS_TV
75 | descriptionMap = @{
76 | @(MASLayoutPriorityDefaultHigh) : @"high",
77 | @(MASLayoutPriorityDefaultLow) : @"low",
78 | @(MASLayoutPriorityDefaultMedium) : @"medium",
79 | @(MASLayoutPriorityRequired) : @"required",
80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size",
81 | };
82 | #elif TARGET_OS_MAC
83 | descriptionMap = @{
84 | @(MASLayoutPriorityDefaultHigh) : @"high",
85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window",
86 | @(MASLayoutPriorityDefaultMedium) : @"medium",
87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put",
88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window",
89 | @(MASLayoutPriorityDefaultLow) : @"low",
90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size",
91 | @(MASLayoutPriorityRequired) : @"required",
92 | };
93 | #endif
94 | });
95 | return descriptionMap;
96 | }
97 |
98 | #pragma mark - description override
99 |
100 | + (NSString *)descriptionForObject:(id)obj {
101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) {
102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]];
103 | }
104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj];
105 | }
106 |
107 | - (NSString *)description {
108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"];
109 |
110 | [description appendString:[self.class descriptionForObject:self]];
111 |
112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]];
113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) {
114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]];
115 | }
116 |
117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]];
118 |
119 | if (self.secondItem) {
120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]];
121 | }
122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) {
123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]];
124 | }
125 |
126 | if (self.multiplier != 1) {
127 | [description appendFormat:@" * %g", self.multiplier];
128 | }
129 |
130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) {
131 | [description appendFormat:@" %g", self.constant];
132 | } else {
133 | if (self.constant) {
134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)];
135 | }
136 | }
137 |
138 | if (self.priority != MASLayoutPriorityRequired) {
139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]];
140 | }
141 |
142 | [description appendString:@">"];
143 | return description;
144 | }
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | /**
14 | * Provides constraint maker block
15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs
16 | */
17 | @interface MAS_VIEW (MASAdditions)
18 |
19 | /**
20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute
21 | */
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX;
31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY;
32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr);
34 |
35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
36 |
37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline;
38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline;
39 |
40 | #endif
41 |
42 | #if TARGET_OS_IPHONE || TARGET_OS_TV
43 |
44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin;
49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin;
50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins;
51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins;
52 |
53 | #endif
54 |
55 | /**
56 | * a key to associate with this view
57 | */
58 | @property (nonatomic, strong) id mas_key;
59 |
60 | /**
61 | * Finds the closest common superview between this view and another view
62 | *
63 | * @param view other view
64 | *
65 | * @return returns nil if common superview could not be found
66 | */
67 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view;
68 |
69 | /**
70 | * Creates a MASConstraintMaker with the callee view.
71 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing
72 | *
73 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
74 | *
75 | * @return Array of created MASConstraints
76 | */
77 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block;
78 |
79 | /**
80 | * Creates a MASConstraintMaker with the callee view.
81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
82 | * If an existing constraint exists then it will be updated instead.
83 | *
84 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
85 | *
86 | * @return Array of created/updated MASConstraints
87 | */
88 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block;
89 |
90 | /**
91 | * Creates a MASConstraintMaker with the callee view.
92 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
93 | * All constraints previously installed for the view will be removed.
94 | *
95 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
96 | *
97 | * @return Array of created/updated MASConstraints
98 | */
99 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block;
100 |
101 | @end
102 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 | #import
11 |
12 | @implementation MAS_VIEW (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block {
15 | self.translatesAutoresizingMaskIntoConstraints = NO;
16 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
17 | block(constraintMaker);
18 | return [constraintMaker install];
19 | }
20 |
21 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block {
22 | self.translatesAutoresizingMaskIntoConstraints = NO;
23 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
24 | constraintMaker.updateExisting = YES;
25 | block(constraintMaker);
26 | return [constraintMaker install];
27 | }
28 |
29 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
30 | self.translatesAutoresizingMaskIntoConstraints = NO;
31 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
32 | constraintMaker.removeExisting = YES;
33 | block(constraintMaker);
34 | return [constraintMaker install];
35 | }
36 |
37 | #pragma mark - NSLayoutAttribute properties
38 |
39 | - (MASViewAttribute *)mas_left {
40 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft];
41 | }
42 |
43 | - (MASViewAttribute *)mas_top {
44 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop];
45 | }
46 |
47 | - (MASViewAttribute *)mas_right {
48 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight];
49 | }
50 |
51 | - (MASViewAttribute *)mas_bottom {
52 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom];
53 | }
54 |
55 | - (MASViewAttribute *)mas_leading {
56 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading];
57 | }
58 |
59 | - (MASViewAttribute *)mas_trailing {
60 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing];
61 | }
62 |
63 | - (MASViewAttribute *)mas_width {
64 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth];
65 | }
66 |
67 | - (MASViewAttribute *)mas_height {
68 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight];
69 | }
70 |
71 | - (MASViewAttribute *)mas_centerX {
72 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX];
73 | }
74 |
75 | - (MASViewAttribute *)mas_centerY {
76 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY];
77 | }
78 |
79 | - (MASViewAttribute *)mas_baseline {
80 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline];
81 | }
82 |
83 | - (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute
84 | {
85 | return ^(NSLayoutAttribute attr) {
86 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr];
87 | };
88 | }
89 |
90 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
91 |
92 | - (MASViewAttribute *)mas_firstBaseline {
93 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline];
94 | }
95 | - (MASViewAttribute *)mas_lastBaseline {
96 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline];
97 | }
98 |
99 | #endif
100 |
101 | #if TARGET_OS_IPHONE || TARGET_OS_TV
102 |
103 | - (MASViewAttribute *)mas_leftMargin {
104 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin];
105 | }
106 |
107 | - (MASViewAttribute *)mas_rightMargin {
108 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin];
109 | }
110 |
111 | - (MASViewAttribute *)mas_topMargin {
112 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin];
113 | }
114 |
115 | - (MASViewAttribute *)mas_bottomMargin {
116 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin];
117 | }
118 |
119 | - (MASViewAttribute *)mas_leadingMargin {
120 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin];
121 | }
122 |
123 | - (MASViewAttribute *)mas_trailingMargin {
124 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin];
125 | }
126 |
127 | - (MASViewAttribute *)mas_centerXWithinMargins {
128 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins];
129 | }
130 |
131 | - (MASViewAttribute *)mas_centerYWithinMargins {
132 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins];
133 | }
134 |
135 | #endif
136 |
137 | #pragma mark - associated properties
138 |
139 | - (id)mas_key {
140 | return objc_getAssociatedObject(self, @selector(mas_key));
141 | }
142 |
143 | - (void)setMas_key:(id)key {
144 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
145 | }
146 |
147 | #pragma mark - heirachy
148 |
149 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view {
150 | MAS_VIEW *closestCommonSuperview = nil;
151 |
152 | MAS_VIEW *secondViewSuperview = view;
153 | while (!closestCommonSuperview && secondViewSuperview) {
154 | MAS_VIEW *firstViewSuperview = self;
155 | while (!closestCommonSuperview && firstViewSuperview) {
156 | if (secondViewSuperview == firstViewSuperview) {
157 | closestCommonSuperview = secondViewSuperview;
158 | }
159 | firstViewSuperview = firstViewSuperview.superview;
160 | }
161 | secondViewSuperview = secondViewSuperview.superview;
162 | }
163 | return closestCommonSuperview;
164 | }
165 |
166 | @end
167 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/View+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand view additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface MAS_VIEW (MASShorthandAdditions)
18 |
19 | @property (nonatomic, strong, readonly) MASViewAttribute *left;
20 | @property (nonatomic, strong, readonly) MASViewAttribute *top;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *right;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *width;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *height;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr);
31 |
32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
33 |
34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline;
35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline;
36 |
37 | #endif
38 |
39 | #if TARGET_OS_IPHONE || TARGET_OS_TV
40 |
41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin;
42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin;
43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin;
44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins;
49 |
50 | #endif
51 |
52 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
53 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
54 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
55 |
56 | @end
57 |
58 | #define MAS_ATTR_FORWARD(attr) \
59 | - (MASViewAttribute *)attr { \
60 | return [self mas_##attr]; \
61 | }
62 |
63 | @implementation MAS_VIEW (MASShorthandAdditions)
64 |
65 | MAS_ATTR_FORWARD(top);
66 | MAS_ATTR_FORWARD(left);
67 | MAS_ATTR_FORWARD(bottom);
68 | MAS_ATTR_FORWARD(right);
69 | MAS_ATTR_FORWARD(leading);
70 | MAS_ATTR_FORWARD(trailing);
71 | MAS_ATTR_FORWARD(width);
72 | MAS_ATTR_FORWARD(height);
73 | MAS_ATTR_FORWARD(centerX);
74 | MAS_ATTR_FORWARD(centerY);
75 | MAS_ATTR_FORWARD(baseline);
76 |
77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
78 |
79 | MAS_ATTR_FORWARD(firstBaseline);
80 | MAS_ATTR_FORWARD(lastBaseline);
81 |
82 | #endif
83 |
84 | #if TARGET_OS_IPHONE || TARGET_OS_TV
85 |
86 | MAS_ATTR_FORWARD(leftMargin);
87 | MAS_ATTR_FORWARD(rightMargin);
88 | MAS_ATTR_FORWARD(topMargin);
89 | MAS_ATTR_FORWARD(bottomMargin);
90 | MAS_ATTR_FORWARD(leadingMargin);
91 | MAS_ATTR_FORWARD(trailingMargin);
92 | MAS_ATTR_FORWARD(centerXWithinMargins);
93 | MAS_ATTR_FORWARD(centerYWithinMargins);
94 |
95 | #endif
96 |
97 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute {
98 | return [self mas_attribute];
99 | }
100 |
101 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
102 | return [self mas_makeConstraints:block];
103 | }
104 |
105 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
106 | return [self mas_updateConstraints:block];
107 | }
108 |
109 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
110 | return [self mas_remakeConstraints:block];
111 | }
112 |
113 | @end
114 |
115 | #endif
116 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | #ifdef MAS_VIEW_CONTROLLER
14 |
15 | @interface MAS_VIEW_CONTROLLER (MASAdditions)
16 |
17 | /**
18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute
19 | */
20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom;
26 |
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Pods/Masonry/Masonry/ViewController+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "ViewController+MASAdditions.h"
10 |
11 | #ifdef MAS_VIEW_CONTROLLER
12 |
13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions)
14 |
15 | - (MASViewAttribute *)mas_topLayoutGuide {
16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
17 | }
18 | - (MASViewAttribute *)mas_topLayoutGuideTop {
19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop];
20 | }
21 | - (MASViewAttribute *)mas_topLayoutGuideBottom {
22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
23 | }
24 |
25 | - (MASViewAttribute *)mas_bottomLayoutGuide {
26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
27 | }
28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop {
29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
30 | }
31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom {
32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
33 | }
34 |
35 |
36 |
37 | @end
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/AFNetworking.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/Masonry.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/Pods-AutoBuildApp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/jaki.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | AFNetworking.xcscheme
8 |
9 | isShown
10 |
11 |
12 | Masonry.xcscheme
13 |
14 | isShown
15 |
16 |
17 | Pods-AutoBuildApp.xcscheme
18 |
19 | isShown
20 |
21 |
22 |
23 | SuppressBuildableAutocreation
24 |
25 | C928DF2FDD93545062C8196C599DD0CA
26 |
27 | primary
28 |
29 |
30 | CAC92B6551A2A24F710B0DF632500C7B
31 |
32 | primary
33 |
34 |
35 | E44AE298D538F76278421193C97E79C6
36 |
37 | primary
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_AFNetworking : NSObject
3 | @end
4 | @implementation PodsDummy_AFNetworking
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #ifndef TARGET_OS_IOS
14 | #define TARGET_OS_IOS TARGET_OS_IPHONE
15 | #endif
16 |
17 | #ifndef TARGET_OS_WATCH
18 | #define TARGET_OS_WATCH 0
19 | #endif
20 |
21 | #ifndef TARGET_OS_TV
22 | #define TARGET_OS_TV 0
23 | #endif
24 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry"
4 | OTHER_LDFLAGS = -framework "CoreServices" -framework "Security" -framework "SystemConfiguration"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Masonry : NSObject
3 | @end
4 | @implementation PodsDummy_Masonry
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Masonry/Masonry.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Masonry
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry"
4 | OTHER_LDFLAGS = -framework "AppKit" -framework "Foundation"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## AFNetworking
5 |
6 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | ## Masonry
28 |
29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in
39 | all copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 | THE SOFTWARE.
48 | Generated by CocoaPods - https://cocoapods.org
49 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | AFNetworking
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
47 |
48 | Permission is hereby granted, free of charge, to any person obtaining a copy
49 | of this software and associated documentation files (the "Software"), to deal
50 | in the Software without restriction, including without limitation the rights
51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
52 | copies of the Software, and to permit persons to whom the Software is
53 | furnished to do so, subject to the following conditions:
54 |
55 | The above copyright notice and this permission notice shall be included in
56 | all copies or substantial portions of the Software.
57 |
58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
64 | THE SOFTWARE.
65 | License
66 | MIT
67 | Title
68 | Masonry
69 | Type
70 | PSGroupSpecifier
71 |
72 |
73 | FooterText
74 | Generated by CocoaPods - https://cocoapods.org
75 | Title
76 |
77 | Type
78 | PSGroupSpecifier
79 |
80 |
81 | StringsTable
82 | Acknowledgements
83 | Title
84 | Acknowledgements
85 |
86 |
87 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_AutoBuildApp : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_AutoBuildApp
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Copies the dSYM of a vendored framework
58 | install_dsym() {
59 | local source="$1"
60 | if [ -r "$source" ]; then
61 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
62 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
63 | fi
64 | }
65 |
66 | # Signs a framework with the provided identity
67 | code_sign_if_enabled() {
68 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
69 | # Use the current code_sign_identitiy
70 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
71 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
72 |
73 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
74 | code_sign_cmd="$code_sign_cmd &"
75 | fi
76 | echo "$code_sign_cmd"
77 | eval "$code_sign_cmd"
78 | fi
79 | }
80 |
81 | # Strip invalid architectures
82 | strip_invalid_archs() {
83 | binary="$1"
84 | # Get architectures for current file
85 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
86 | stripped=""
87 | for arch in $archs; do
88 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
89 | # Strip non-valid architectures in-place
90 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
91 | stripped="$stripped $arch"
92 | fi
93 | done
94 | if [[ "$stripped" ]]; then
95 | echo "Stripped $binary of architectures:$stripped"
96 | fi
97 | }
98 |
99 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
100 | wait
101 | fi
102 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | 4)
25 | TARGET_DEVICE_ARGS="--target-device watch"
26 | ;;
27 | *)
28 | TARGET_DEVICE_ARGS="--target-device mac"
29 | ;;
30 | esac
31 |
32 | install_resource()
33 | {
34 | if [[ "$1" = /* ]] ; then
35 | RESOURCE_PATH="$1"
36 | else
37 | RESOURCE_PATH="${PODS_ROOT}/$1"
38 | fi
39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
40 | cat << EOM
41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
42 | EOM
43 | exit 1
44 | fi
45 | case $RESOURCE_PATH in
46 | *.storyboard)
47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
49 | ;;
50 | *.xib)
51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
53 | ;;
54 | *.framework)
55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
57 | echo "rsync --delete -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
58 | rsync --delete -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
59 | ;;
60 | *.xcdatamodel)
61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
63 | ;;
64 | *.xcdatamodeld)
65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
67 | ;;
68 | *.xcmappingmodel)
69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
71 | ;;
72 | *.xcassets)
73 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
75 | ;;
76 | *)
77 | echo "$RESOURCE_PATH" || true
78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
79 | ;;
80 | esac
81 | }
82 |
83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
87 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
88 | fi
89 | rm -f "$RESOURCES_TO_COPY"
90 |
91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
92 | then
93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
95 | while read line; do
96 | if [[ $line != "${PODS_ROOT}*" ]]; then
97 | XCASSET_FILES+=("$line")
98 | fi
99 | done <<<"$OTHER_XCASSETS"
100 |
101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
102 | fi
103 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Masonry"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -framework "AppKit" -framework "CoreServices" -framework "Foundation" -framework "Security" -framework "SystemConfiguration"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AutoBuildApp/Pods-AutoBuildApp.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Masonry"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -framework "AppKit" -framework "CoreServices" -framework "Foundation" -framework "Security" -framework "SystemConfiguration"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------