Skip to content

Commit a65e194

Browse files
fbarthoChris Brody
authored and
Chris Brody
committed
Update writeObjectsSections to match current Xcode format (apache#46)
Tested on Xcode Version 10.1 (10B61) MINOR fix
1 parent 4159249 commit a65e194

16 files changed

+17
-7
lines changed

lib/pbxWriter.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,10 @@ pbxWriter.prototype.writeObject = function (object) {
178178
}
179179

180180
pbxWriter.prototype.writeObjectsSections = function (objects) {
181-
var first = true,
182-
key, obj;
181+
var key, obj;
183182

184183
for (key in objects) {
185-
if (!first) {
186-
this.writeFlush("\n")
187-
} else {
188-
first = false;
189-
}
184+
this.writeFlush("\n")
190185

191186
obj = objects[key];
192187

test/parser/projects/build-config.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 45;
77
objects = {
8+
89
/* Begin XCBuildConfiguration section */
910
1D6058940D05DD3E006BFB54 /* Debug */ = {
1011
isa = XCBuildConfiguration;

test/parser/projects/build-files.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 45;
77
objects = {
8+
89
/* Begin PBXBuildFile section */
910
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1011
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };

test/parser/projects/empty-groups.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 45;
77
objects = {
8+
89
/* Begin PBXFileReference section */
910
/* End PBXFileReference section */
1011
/* Begin PBXBuildFile section */

test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 46;
77
objects = {
8+
89
/* Begin PBXBuildFile section */
910
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1011
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };

test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 46;
77
objects = {
8+
89
/* Begin PBXBuildFile section */
910
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1011
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };

test/parser/projects/fail.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ THIS SHOULD FAIL TO PARSE
77
objectVersion = 45;
88
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
99
objects = {
10+
1011
/* Begin PBXTargetDependency section */
1112
301BF551109A68C00062928A /* PBXTargetDependency */ = {
1213
isa = PBXTargetDependency;

test/parser/projects/file-references.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 45;
77
objects = {
8+
89
/* Begin PBXFileReference section */
910
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1011
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };

test/parser/projects/header-search.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 46;
77
objects = {
8+
89
/* Begin XCBuildConfiguration section */
910
C01FCF4F08A954540054247B /* Debug */ = {
1011
isa = XCBuildConfiguration;

test/parser/projects/nested-object.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 45;
77
objects = {
8+
89
/* Begin PBXProject section */
910
29B97313FDCFA39411CA2CEA /* Project object */ = {
1011
isa = PBXProject;

test/parser/projects/section-entries.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
objectVersion = 45;
77
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
88
objects = {
9+
910
/* Begin PBXVariantGroup section */
1011
1F766FDC13BBADB100FB74C0 /* Localizable.strings */ = {
1112
isa = PBXVariantGroup;

test/parser/projects/section-split.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
objectVersion = 45;
77
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
88
objects = {
9+
910
/* Begin PBXTargetDependency section */
1011
301BF551109A68C00062928A /* PBXTargetDependency */ = {
1112
isa = PBXTargetDependency;

test/parser/projects/section.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
objectVersion = 45;
77
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
88
objects = {
9+
910
/* Begin PBXTargetDependency section */
1011
301BF551109A68C00062928A /* PBXTargetDependency */ = {
1112
isa = PBXTargetDependency;

test/parser/projects/two-sections.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
objectVersion = 45;
77
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
88
objects = {
9+
910
/* Begin PBXTargetDependency section */
1011
301BF551109A68C00062928A /* PBXTargetDependency */ = {
1112
isa = PBXTargetDependency;

test/parser/projects/with_omit_empty_values_disabled.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 46;
77
objects = {
8+
89
/* Begin PBXBuildFile section */
910
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1011
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };

test/parser/projects/with_omit_empty_values_enabled.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
};
66
objectVersion = 46;
77
objects = {
8+
89
/* Begin PBXBuildFile section */
910
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1011
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };

0 commit comments

Comments
 (0)