Skip to content

Commit 65a0c40

Browse files
committed
[proj] always add static libraries to build phases
1 parent 69e3cb6 commit 65a0c40

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/pbxProject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ pbxProject.prototype.addStaticLibrary = function (path, opt) {
214214

215215
if (!opt.plugin) {
216216
file.fileRef = this.generateUuid();
217-
this.addToPbxBuildFileSection(file); // PBXBuildFile
218217
this.addToPbxFileReferenceSection(file); // PBXFileReference
219218
}
220219

220+
this.addToPbxBuildFileSection(file); // PBXBuildFile
221221
this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
222222
this.ensureCorrectSearchPaths(file); // make sure it gets built!
223223

test/addStaticLibrary.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ exports.addStaticLibrary = {
6666

6767
test.done();
6868
},
69+
'should populate the PBXBuildFile section with 2 fields as plugin': function (test) {
70+
var newFile = proj.addStaticLibrary('libGoogleAnalytics.a',
71+
{ plugin: true });
72+
buildFileSection = proj.pbxBuildFileSection(),
73+
bfsLength = Object.keys(buildFileSection).length;
74+
75+
test.equal(60, bfsLength);
76+
test.ok(buildFileSection[newFile.uuid]);
77+
test.ok(buildFileSection[newFile.uuid + '_comment']);
78+
79+
test.done();
80+
},
6981
'should add the PBXBuildFile comment correctly': function (test) {
7082
var newFile = proj.addStaticLibrary('libGoogleAnalytics.a');
7183
commentKey = newFile.uuid + '_comment',

0 commit comments

Comments
 (0)