Skip to content

Commit

Permalink
Support adding swift frameworks to project
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Skrepnek committed Jun 12, 2020
1 parent ecdbf56 commit ebca1c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pbxFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,18 @@ function detectSourcetree(fileRef) {
return sourcetree;
}

function defaultPath(fileRef, filePath) {
function defaultPath(fileRef, filePath, opt) {
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
defaultPath = PATH_BY_FILETYPE[unquoted(filetype)];

if (fileRef.customFramework) {
return filePath;
}

if (opt.swiftLib) {
return path.join('/usr/lib/swift', path.basename(filePath));
}

if (defaultPath) {
return path.join(defaultPath, path.basename(filePath));
}
Expand Down Expand Up @@ -196,7 +200,7 @@ function pbxFile(filepath, opt) {
this.dirname = path.dirname(filepath).replace(/\\/g, '/');
}

this.path = defaultPath(this, filepath).replace(/\\/g, '/');
this.path = defaultPath(this, filepath, opt).replace(/\\/g, '/');
this.fileEncoding = this.defaultEncoding = opt.defaultEncoding || defaultEncoding(this);

// When referencing products / build output files
Expand Down

0 comments on commit ebca1c1

Please sign in to comment.