Skip to content

Commit f2514b5

Browse files
committed
pbxFile: Added support for product files, based on the "explicitFileType" property.
1 parent f16baa8 commit f2514b5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/pbxFile.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function pbxFile(filepath, opt) {
150150
var opt = opt || {};
151151

152152
this.lastKnownFileType = opt.lastKnownFileType || detectType(filepath);
153+
this.group = defaultGroup(this);
153154

154155
// for custom frameworks
155156
if (opt.customFramework == true) {
@@ -158,11 +159,21 @@ function pbxFile(filepath, opt) {
158159
}
159160

160161
this.basename = path.basename(filepath);
161-
this.path = correctPath(this, filepath);
162-
this.group = correctGroup(this);
162+
this.path = defaultPath(this, filepath);
163+
this.defaultEncoding = opt.defaultEncoding || defaultEncoding(this);
164+
165+
166+
// When referencing products / build output files
167+
if (opt.explicitFileType) {
168+
this.explicitFileType = opt.explicitFileType;
169+
this.basename = this.basename + '.' + defaultExtension(this);
170+
delete this.path;
171+
delete this.lastKnownFileType;
172+
delete this.group;
173+
delete this.defaultEncoding;
174+
}
163175

164-
this.sourceTree = opt.sourceTree || defaultSourceTree(this);
165-
this.fileEncoding = opt.fileEncoding || fileEncoding(this);
176+
this.sourceTree = opt.sourceTree || defaultSourcetree(this);
166177

167178
if (opt.weak && opt.weak === true)
168179
this.settings = { ATTRIBUTES: ['Weak'] };

0 commit comments

Comments
 (0)