Skip to content

Commit 1d45718

Browse files
Dimitar Kerezove2l3n
authored andcommitted
Fix build phase uuid being written in the PBXproject
Upon adding a build phase an unnecessary property is added, namely uuid
1 parent 19b4a77 commit 1d45718

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/pbxProject.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ pbxProject.prototype.removeFromPbxFrameworksBuildPhase = function (file) {
410410
}
411411
}
412412

413-
<<<<<<< HEAD
414413
pbxProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) {
415414
var embeddedFrameworkAttributes = ['CodeSignOnCopy', 'RemoveHeadersOnCopy'];
416415

@@ -437,7 +436,8 @@ pbxProject.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file, op
437436
break;
438437
}
439438
}
440-
=======
439+
}
440+
441441
pbxProject.prototype.addBuildPhase = function (filePathsArray, isa, comment) {
442442
var section = this.hash.project.objects[isa],
443443
buildPhaseUuid = this.generateUuid(),
@@ -464,10 +464,8 @@ pbxProject.prototype.addBuildPhase = function (filePathsArray, isa, comment) {
464464
section[buildPhaseUuid] = buildPhase;
465465
section[commentKey] = comment;
466466
}
467-
468-
buildPhase.uuid = buildPhaseUuid;
469-
return buildPhase;
470-
>>>>>>> Introduce a way to add Build Phases
467+
468+
return {uuid: buildPhaseUuid, buildPhase: buildPhase};
471469
}
472470

473471
// 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)