ProjectManager  0.2
MakeBuilder.h
1 /*
2  MakeBuilder.h
3 
4  Interface declaration of the MakeBuilder class for the ProjectManager
5  application.
6 
7  Copyright (C) 2005 Saso Kiselkov
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23 
24 #import <Foundation/NSObject.h>
25 #import "../../ProjectModule.h"
26 
27 @class NSString,
28  NSMutableArray,
29  NSFileHandle,
30  NSNotification;
31 
32 @class NSView,
33  NSTableView,
34  NSTableColumn,
35  NSTask;
36 
37 @protocol MakeBuilderDelegate;
38 
47 #define MakeBuilderBuildDidBeginNotification \
48  @"MakeBuilderBuildDidBeginNotification"
49 
59 #define MakeBuilderBuildDidEndNotification \
60  @"MakeBuilderBuildDidEndNotification"
61 
70 #define MakeBuilderCleanDidBeginNotification \
71  @"MakeBuilderCleanDidBeginNotification"
72 
82 #define MakeBuilderCleanDidEndNotification \
83  @"MakeBuilderCleanDidEndNotification"
84 
85 typedef enum {
86  MakeBuilderReady,
87  MakeBuilderBuilding,
88  MakeBuilderCleaning
89 } MakeBuilderState;
90 
91 @interface MakeBuilder : NSObject <ProjectModule>
92 {
93  // weak reference
94  ProjectDocument * document;
95 
96  NSDictionary * info;
97 
98  id bogusWindow, view;
99 
100  id buildOutput;
101  id buildArgs;
102  id buildArgsManipulationMatrix;
103  id buildArgsMovementMatrix;
104  id buildErrors;
105  id buildTarget;
106  id verboseBuild;
107  id warnings;
108  id allWarnings;
109 
110  NSArray * targets;
111  NSMutableArray * buildArguments;
112  NSMutableArray * buildErrorList;
113  NSString * lastIncompleteOutputLine;
114  NSString * lastIncompleteErrorLine;
115 
116  // This stack holds the directories as the build processes passes through
117  // subprojects. When a line of format "make[*Entering directory `*" is
118  // received, the new build directory is put on top of this stack, and once
119  // a "make[*Leaving directory`*" line received, the top element is popped
120  // off. This way the builder can correctly follow the building process
121  // when we have subprojects (which reside in subdirectories).
122  NSMutableArray * buildDirectoryStack;
123 
124  MakeBuilderState state;
125 
126  NSTask * task;
127  NSFileHandle * outputFileHandle, * errorFileHandle;
128 
129  id <MakeBuilderDelegate> delegate; // weak reference
130 }
131 
132 - (void) build: sender;
133 - (void) buildTarget: (NSString *) target;
134 
135 - (void) clean: sender;
136 - (void) cleanTarget: (NSString *) target;
137 
138 - (void) stopOperation: sender;
139 
140 - (BOOL) isBusy;
141 
142 - (void) addBuildArgument: (id)sender;
143 - (void) removeBuildArgument: (id)sender;
144 - (void) moveBuildArgumentUp: sender;
145 - (void) moveBuildArgumentDown: sender;
146 
147 - (void) openErrorFile: sender;
148 
149 - (int) numberOfRowsInTableView: (NSTableView *)aTableView;
150 - (id) tableView: (NSTableView *)aTableView
151 objectValueForTableColumn: (NSTableColumn *)aTableColumn
152  row: (int)rowIndex;
153 - (void) tableView: (NSTableView *)aTableView
154  setObjectValue: (id)anObject
155  forTableColumn: (NSTableColumn *)aTableColumn
156  row: (int)rowIndex;
157 
158 - (void) collectOutput: (NSNotification *) notif;
159 - (void) collectErrorOutput: (NSNotification *) notif;
160 
161 - (void) buildCompleted: (NSNotification *) notif;
162 - (void) cleanCompleted: (NSNotification *) notif;
163 
164 - (void) buildOptionChanged: sender;
165 
166 @end
ProjectDocument
Definition: ProjectDocument.h:43
ProjectModule-p
This protocol declares methods which project modules must implement.
Definition: ProjectModule.h:44
MakeBuilderDelegate-p
Definition: MakeBuilderDelegate.h:25
MakeBuilder
Definition: MakeBuilder.h:91