Debian Codegraph @

XCode/PBXBuildFile.m

raw
1 /*
2 Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc.
3
4 Written by: Gregory John Casamento <[email protected]>
5 Date: 2022
6
7 This file is part of the GNUstep XCode Library
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 This library 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 GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free
21 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110 USA.
23 */
24
25 #import "PBXCommon.h"
26 #import "PBXBuildFile.h"
27 #import "PBXNativeTarget.h"
28
29 @implementation PBXBuildFile
30
31 // Methods....
32 - (void) setPlatformFilter: (NSString *)f
33 {
34 ASSIGN(_platformFilter, f);
35 }
36
37 - (PBXFileReference *) fileRef // getter
38 {
39 return _fileRef;
40 }
41
42 - (void) setFileRef: (PBXFileReference *)object; // setter
43 {
44 ASSIGN(_fileRef,object);
45 }
46
47 - (NSMutableDictionary *) settings // getter
48 {
49 return _settings;
50 }
51
52 - (void) setSettings: (NSMutableDictionary *)object; // setter
53 {
54 ASSIGN(_settings,object);
55 }
56
57 - (void) applySettings
58 {
59 // xcputs("%@",settings);
60 }
61
62 - (NSString *) buildPath
63 {
64 return [_fileRef buildPath];
65 }
66
67 - (NSString *) path
68 {
69 return [_fileRef path];
70 }
71
72 - (void) setTarget: (PBXNativeTarget *)t
73 {
74 _target = t;
75 }
76
77 - (void) setTotalFiles: (NSUInteger)t
78 {
79 _totalFiles = t;
80 }
81
82 - (void) setCurrentFile: (NSUInteger)n
83 {
84 _currentFile = n;
85 }
86
87 - (BOOL) build
88 {
89 [self applySettings];
90 [_fileRef setTarget: _target];
91 [_fileRef setTotalFiles: _totalFiles];
92 [_fileRef setCurrentFile: _currentFile];
93 return [_fileRef build];
94 }
95
96 - (BOOL) generate
97 {
98 [self applySettings];
99 xcputs([[NSString stringWithFormat: @"\t* Creating entry for %@",[_fileRef buildPath]] cString]);
100 [_fileRef setTarget: _target];
101 return [_fileRef generate];
102 }
103
104 - (NSString *) description
105 {
106 NSString *s = [super description];
107 return [s stringByAppendingFormat: @" <%@>", _fileRef];
108 }
109
110 @end