Skip to content

Commit 4982ced

Browse files
author
Dimitar Kerezov
committed
Fix build phase uuid being written in the PBXproject
Upon adding a build phase an unnecessary property is added, namely uuid
1 parent 3085e40 commit 4982ced

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/pbxProject.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ pbxProject.prototype.addBuildPhase = function (filePathsArray, isa, comment) {
425425
section[commentKey] = comment;
426426
}
427427

428-
buildPhase.uuid = buildPhaseUuid;
429-
return buildPhase;
428+
return {uuid: buildPhaseUuid, buildPhase: buildPhase};
430429
}
431430

432431
// helper access functions

test/addBuildPhase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports.addBuildPhase = {
2626
test.done()
2727
},
2828
'should add all files to build phase': function (test) {
29-
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase');
29+
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase;
3030
for (var index = 0; index < buildPhase.files.length; index++) {
3131
var file = buildPhase.files[index];
3232
test.ok(file.value);
@@ -35,7 +35,7 @@ exports.addBuildPhase = {
3535
test.done()
3636
},
3737
'should add the PBXBuildPhase object correctly': function (test) {
38-
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase'),
38+
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
3939
buildPhaseInPbx = proj.buildPhaseObject('PBXResourcesBuildPhase', 'My build phase');
4040

4141
test.equal(buildPhaseInPbx, buildPhase);
@@ -45,7 +45,7 @@ exports.addBuildPhase = {
4545
test.done();
4646
},
4747
'should add each of the files to PBXBuildFile section': function (test) {
48-
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase'),
48+
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
4949
buildFileSection = proj.pbxBuildFileSection();
5050

5151
for (var index = 0; index < buildPhase.files.length; index++) {
@@ -56,7 +56,7 @@ exports.addBuildPhase = {
5656
test.done();
5757
},
5858
'should add each of the files to PBXFileReference section': function (test) {
59-
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase'),
59+
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
6060
fileRefSection = proj.pbxFileReferenceSection(),
6161
buildFileSection = proj.pbxBuildFileSection(),
6262
fileRefs = [];

0 commit comments

Comments
 (0)