Update writeObjectsSections to match current Xcode format (#46)
Tested on Xcode Version 10.1 (10B61)
MINOR fix
diff --git a/lib/pbxWriter.js b/lib/pbxWriter.js
index 1f266d9..d297bc7 100644
--- a/lib/pbxWriter.js
+++ b/lib/pbxWriter.js
@@ -178,15 +178,10 @@
}
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];
diff --git a/test/parser/projects/build-config.pbxproj b/test/parser/projects/build-config.pbxproj
index aabffe4..d51d1a9 100644
--- a/test/parser/projects/build-config.pbxproj
+++ b/test/parser/projects/build-config.pbxproj
@@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {
+
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
diff --git a/test/parser/projects/build-files.pbxproj b/test/parser/projects/build-files.pbxproj
index a868217..8dcaa5c 100644
--- a/test/parser/projects/build-files.pbxproj
+++ b/test/parser/projects/build-files.pbxproj
@@ -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 */; };
diff --git a/test/parser/projects/empty-groups.pbxproj b/test/parser/projects/empty-groups.pbxproj
index 6322052..3bb2c9c 100644
--- a/test/parser/projects/empty-groups.pbxproj
+++ b/test/parser/projects/empty-groups.pbxproj
@@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {
+
/* Begin PBXFileReference section */
/* End PBXFileReference section */
/* Begin PBXBuildFile section */
diff --git a/test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj b/test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj
index da46b23..409a2d4 100644
--- a/test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj
+++ b/test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj
@@ -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 */; };
diff --git a/test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj b/test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj
index 4fd30d0..2c040a4 100644
--- a/test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj
+++ b/test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj
@@ -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 */; };
diff --git a/test/parser/projects/fail.pbxproj b/test/parser/projects/fail.pbxproj
index d670dd0..d2978ed 100644
--- a/test/parser/projects/fail.pbxproj
+++ b/test/parser/projects/fail.pbxproj
@@ -7,6 +7,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {
+
/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
diff --git a/test/parser/projects/file-references.pbxproj b/test/parser/projects/file-references.pbxproj
index 949810d..90a4c40 100644
--- a/test/parser/projects/file-references.pbxproj
+++ b/test/parser/projects/file-references.pbxproj
@@ -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>"; };
diff --git a/test/parser/projects/header-search.pbxproj b/test/parser/projects/header-search.pbxproj
index cf7386b..7392410 100755
--- a/test/parser/projects/header-search.pbxproj
+++ b/test/parser/projects/header-search.pbxproj
@@ -5,6 +5,7 @@
};
objectVersion = 46;
objects = {
+
/* Begin XCBuildConfiguration section */
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
diff --git a/test/parser/projects/nested-object.pbxproj b/test/parser/projects/nested-object.pbxproj
index 5d8d410..f482bba 100644
--- a/test/parser/projects/nested-object.pbxproj
+++ b/test/parser/projects/nested-object.pbxproj
@@ -5,6 +5,7 @@
};
objectVersion = 45;
objects = {
+
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
diff --git a/test/parser/projects/section-entries.pbxproj b/test/parser/projects/section-entries.pbxproj
index 933cd77..0dbe8ce 100644
--- a/test/parser/projects/section-entries.pbxproj
+++ b/test/parser/projects/section-entries.pbxproj
@@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {
+
/* Begin PBXVariantGroup section */
1F766FDC13BBADB100FB74C0 /* Localizable.strings */ = {
isa = PBXVariantGroup;
diff --git a/test/parser/projects/section-split.pbxproj b/test/parser/projects/section-split.pbxproj
index 7b7f2df..d51bfbe 100644
--- a/test/parser/projects/section-split.pbxproj
+++ b/test/parser/projects/section-split.pbxproj
@@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {
+
/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
diff --git a/test/parser/projects/section.pbxproj b/test/parser/projects/section.pbxproj
index 8d3ef56..5e53e75 100644
--- a/test/parser/projects/section.pbxproj
+++ b/test/parser/projects/section.pbxproj
@@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {
+
/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
diff --git a/test/parser/projects/two-sections.pbxproj b/test/parser/projects/two-sections.pbxproj
index 072b459..e3700b4 100644
--- a/test/parser/projects/two-sections.pbxproj
+++ b/test/parser/projects/two-sections.pbxproj
@@ -6,6 +6,7 @@
objectVersion = 45;
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
objects = {
+
/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
diff --git a/test/parser/projects/with_omit_empty_values_disabled.pbxproj b/test/parser/projects/with_omit_empty_values_disabled.pbxproj
index eaa1421..700242c 100644
--- a/test/parser/projects/with_omit_empty_values_disabled.pbxproj
+++ b/test/parser/projects/with_omit_empty_values_disabled.pbxproj
@@ -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 */; };
diff --git a/test/parser/projects/with_omit_empty_values_enabled.pbxproj b/test/parser/projects/with_omit_empty_values_enabled.pbxproj
index eaa1421..700242c 100644
--- a/test/parser/projects/with_omit_empty_values_enabled.pbxproj
+++ b/test/parser/projects/with_omit_empty_values_enabled.pbxproj
@@ -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 */; };