Debian Codegraph @

XCode/PBXContainerItemProxy.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 <Foundation/NSFileManager.h>
26
27 #import "PBXCommon.h"
28 #import "PBXContainerItemProxy.h"
29 #import "PBXCoder.h"
30 #import "PBXContainer.h"
31 #import "GSXCBuildContext.h"
32
33 @implementation PBXContainerItemProxy
34
35 - (void) dealloc
36 {
37 RELEASE(proxyType);
38 RELEASE(remoteGlobalIDString);
39 RELEASE(containerPortal);
40 RELEASE(remoteInfo);
41
42 [super dealloc];
43 }
44
45 // Methods....
46 - (NSString *) proxyType // getter
47 {
48 return proxyType;
49 }
50
51 - (void) setProxyType: (NSString *)object; // setter
52 {
53 ASSIGN(proxyType,object);
54 }
55
56 - (NSString *) remoteGlobalIDString // getter
57 {
58 return remoteGlobalIDString;
59 }
60
61 - (void) setRemoteGlobalIDString: (NSString *)object; // setter
62 {
63 ASSIGN(remoteGlobalIDString,object);
64 }
65
66 - (id) containerPortal // getter
67 {
68 return containerPortal;
69 }
70
71 - (void) setContainerPortal: (id)object; // setter
72 {
73 ASSIGN(containerPortal,object);
74 }
75
76 - (NSString *) remoteInfo // getter
77 {
78 return remoteInfo;
79 }
80
81 - (void) setRemoteInfo: (NSString *)object; // setter
82 {
83 ASSIGN(remoteInfo,object);
84 }
85
86 - (BOOL) build
87 {
88 PBXContainer *currentContainer = [[GSXCBuildContext sharedBuildContext] objectForKey: @"CONTAINER"];
89 NSFileManager *mgr = [NSFileManager defaultManager];
90
91 containerPortal = [[currentContainer objects] objectForKey: containerPortal];
92 if([containerPortal isKindOfClass: [PBXFileReference class]])
93 {
94 xcputs([[NSString stringWithFormat: @"=== Proxy Reading %s%@%s", GREEN, [containerPortal path], RESET] cString]);
95 NSString *dir = [mgr currentDirectoryPath];
96 PBXCoder *coder = [[PBXCoder alloc] initWithProjectFile: [containerPortal path]];
97 [mgr changeCurrentDirectoryPath: [coder projectRoot]];
98 PBXContainer *container = [coder unarchive];
99 [container setFilename: [containerPortal path]];
100 BOOL result = [container build];
101 [mgr changeCurrentDirectoryPath: dir];
102
103 return result;
104 }
105 else
106 {
107 return YES;
108 }
109
110 return NO;
111 }
112
113 - (BOOL) save
114 {
115 return YES;
116 }
117
118 - (BOOL) generate
119 {
120 return YES;
121 }
122
123 - (BOOL) clean
124 {
125 return YES;
126 }
127
128 @end