Skip to content

Commit

Permalink
Update writeObjectsSections to match current Xcode format (#46)
Browse files Browse the repository at this point in the history
Tested on Xcode Version 10.1 (10B61)

MINOR fix
  • Loading branch information
fbartho authored and Chris Brody committed Mar 10, 2019
1 parent 4159249 commit a65e194
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/pbxWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,10 @@ pbxWriter.prototype.writeObject = function (object) {
}

pbxWriter.prototype.writeObjectsSections = function (objects) {
var first = true,
key, obj;
var key, obj;

for (key in objects) {
if (!first) {
this.writeFlush("\n")
} else {
first = false;
}
this.writeFlush("\n")

obj = objects[key];

Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/build-config.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {

/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/build-files.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {

/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/empty-groups.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {

/* Begin PBXFileReference section */
/* End PBXFileReference section */
/* Begin PBXBuildFile section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/fail.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ THIS SHOULD FAIL TO PARSE
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {

/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/file-references.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {

/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/header-search.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {

/* Begin XCBuildConfiguration section */
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/nested-object.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {

/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/section-entries.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {

/* Begin PBXVariantGroup section */
1F766FDC13BBADB100FB74C0 /* Localizable.strings */ = {
isa = PBXVariantGroup;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/section-split.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {

/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/section.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {

/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
Expand Down
1 change: 1 addition & 0 deletions test/parser/projects/two-sections.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {

/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
Expand Down

0 comments on commit a65e194

Please sign in to comment.