From 2b90c37e57fdfda4797aec1773e283153b1e7456 Mon Sep 17 00:00:00 2001 From: Frederic Barthelemy Date: Fri, 8 Mar 2019 15:41:35 -0800 Subject: [PATCH 1/4] Update writeObjectsSections to match current Xcode format Tested on Xcode Version 10.1 (10B61) --- RELEASENOTES.md | 2 ++ 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 + .../with_omit_empty_values_disabled_expected.pbxproj | 1 + .../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 + .../projects/with_omit_empty_values_disabled.pbxproj | 1 + .../projects/with_omit_empty_values_enabled.pbxproj | 1 + 17 files changed, 19 insertions(+), 7 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e07fac2..ea54b67 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,8 @@ --> # Cordova-node-xcode Release Notes +* Updated `objects = {` to be followed by a blank line, matching current Xcode layout ([#42](https://github.com/apache/cordova-node-xcode/pull/46)) + ### 2.0.0 (Jan 15, 2019) * Updated to use ECMAScript 2015 Object.assign. ([#14](https://github.com/apache/cordova-node-xcode/pull/14)) * fix: simple-plist@1 update in dependencies ([#30](https://github.com/apache/cordova-node-xcode/pull/30)) 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 = ""; }; 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 */; }; From e402a33b5d168d7e5de7b1bc90f94731168195ae Mon Sep 17 00:00:00 2001 From: Frederic Barthelemy Date: Sun, 10 Mar 2019 11:38:51 -0700 Subject: [PATCH 2/4] Update RELEASENOTES.md - Fix URL Link --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ea54b67..97c72e3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,7 +20,7 @@ --> # Cordova-node-xcode Release Notes -* Updated `objects = {` to be followed by a blank line, matching current Xcode layout ([#42](https://github.com/apache/cordova-node-xcode/pull/46)) +* Updated `objects = {` to be followed by a blank line, matching current Xcode layout ([#46](https://github.com/apache/cordova-node-xcode/pull/46)) ### 2.0.0 (Jan 15, 2019) * Updated to use ECMAScript 2015 Object.assign. ([#14](https://github.com/apache/cordova-node-xcode/pull/14)) From 9230c9b46fcf331459ad7e74702b678622b3ecc6 Mon Sep 17 00:00:00 2001 From: Frederic Barthelemy Date: Sun, 10 Mar 2019 13:47:08 -0700 Subject: [PATCH 3/4] Update RELEASENOTES.md - remove too-early release note! --- RELEASENOTES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 97c72e3..f9cffe4 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,7 +20,6 @@ --> # Cordova-node-xcode Release Notes -* Updated `objects = {` to be followed by a blank line, matching current Xcode layout ([#46](https://github.com/apache/cordova-node-xcode/pull/46)) ### 2.0.0 (Jan 15, 2019) * Updated to use ECMAScript 2015 Object.assign. ([#14](https://github.com/apache/cordova-node-xcode/pull/14)) From 54fbfdad1da921476866efb784ea859b3e741ab0 Mon Sep 17 00:00:00 2001 From: Frederic Barthelemy Date: Sun, 10 Mar 2019 13:48:04 -0700 Subject: [PATCH 4/4] Update RELEASENOTES.md -- remove extra blank line --- RELEASENOTES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f9cffe4..e07fac2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,7 +20,6 @@ --> # Cordova-node-xcode Release Notes - ### 2.0.0 (Jan 15, 2019) * Updated to use ECMAScript 2015 Object.assign. ([#14](https://github.com/apache/cordova-node-xcode/pull/14)) * fix: simple-plist@1 update in dependencies ([#30](https://github.com/apache/cordova-node-xcode/pull/30))