You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2019/03/10 20:55:41 UTC

[cordova-node-xcode] branch master updated: Update writeObjectsSections to match current Xcode format (#46)

This is an automated email from the ASF dual-hosted git repository.

brodybits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-node-xcode.git


The following commit(s) were added to refs/heads/master by this push:
     new a65e194  Update writeObjectsSections to match current Xcode format (#46)
a65e194 is described below

commit a65e1943ed8c71d93e4c673d0a7aabf4ebca7623
Author: Frederic Barthelemy <gi...@fbartho.com>
AuthorDate: Sun Mar 10 13:55:37 2019 -0700

    Update writeObjectsSections to match current Xcode format (#46)
    
    Tested on Xcode Version 10.1 (10B61)
    
    MINOR fix
---
 lib/pbxWriter.js                                                 | 9 ++-------
 test/parser/projects/build-config.pbxproj                        | 1 +
 test/parser/projects/build-files.pbxproj                         | 1 +
 test/parser/projects/empty-groups.pbxproj                        | 1 +
 .../expected/with_omit_empty_values_disabled_expected.pbxproj    | 1 +
 .../expected/with_omit_empty_values_enabled_expected.pbxproj     | 1 +
 test/parser/projects/fail.pbxproj                                | 1 +
 test/parser/projects/file-references.pbxproj                     | 1 +
 test/parser/projects/header-search.pbxproj                       | 1 +
 test/parser/projects/nested-object.pbxproj                       | 1 +
 test/parser/projects/section-entries.pbxproj                     | 1 +
 test/parser/projects/section-split.pbxproj                       | 1 +
 test/parser/projects/section.pbxproj                             | 1 +
 test/parser/projects/two-sections.pbxproj                        | 1 +
 test/parser/projects/with_omit_empty_values_disabled.pbxproj     | 1 +
 test/parser/projects/with_omit_empty_values_enabled.pbxproj      | 1 +
 16 files changed, 17 insertions(+), 7 deletions(-)

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.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];
 
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 @@ THIS SHOULD FAIL TO PARSE
     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 */; };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org