From f669411b55c8cc28d80f706c96fdfe359b4135e4 Mon Sep 17 00:00:00 2001
From: Maurice Parker <mo@vincode.io>
Date: Sun, 28 Jun 2020 17:43:20 -0500
Subject: [PATCH] Update project settings so that we can compile under xcode
 previews

---
 .../Account/Account.xcodeproj/project.pbxproj |  2 +-
 .../Articles.xcodeproj/project.pbxproj        |  2 +-
 .../project.pbxproj                           |  2 +-
 .../Secrets/Secrets.xcodeproj/project.pbxproj |  2 +-
 .../SyncDatabase.xcodeproj/project.pbxproj    |  2 +-
 Multiplatform/Shared/SceneModel.swift         | 11 +++++++++
 .../Shared/SceneNavigationView.swift          |  2 +-
 .../Shared/Sidebar/SidebarModel.swift         |  7 ++++++
 .../Shared/Sidebar/SidebarView.swift          | 24 +++++++++++++++++--
 submodules/RSCore                             |  2 +-
 submodules/RSDatabase                         |  2 +-
 submodules/RSParser                           |  2 +-
 submodules/RSTree                             |  2 +-
 submodules/RSWeb                              |  2 +-
 .../NetNewsWire_mac_target_common.xcconfig    |  1 +
 15 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/Frameworks/Account/Account.xcodeproj/project.pbxproj b/Frameworks/Account/Account.xcodeproj/project.pbxproj
index 68d13d48c..9057c3188 100644
--- a/Frameworks/Account/Account.xcodeproj/project.pbxproj
+++ b/Frameworks/Account/Account.xcodeproj/project.pbxproj
@@ -1165,7 +1165,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
+			shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n\nxcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
diff --git a/Frameworks/Articles/Articles.xcodeproj/project.pbxproj b/Frameworks/Articles/Articles.xcodeproj/project.pbxproj
index c8c0c3e3c..0882930f5 100644
--- a/Frameworks/Articles/Articles.xcodeproj/project.pbxproj
+++ b/Frameworks/Articles/Articles.xcodeproj/project.pbxproj
@@ -309,7 +309,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
+			shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n\nxcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
diff --git a/Frameworks/ArticlesDatabase/ArticlesDatabase.xcodeproj/project.pbxproj b/Frameworks/ArticlesDatabase/ArticlesDatabase.xcodeproj/project.pbxproj
index 4a7ef6045..b5a360a7e 100644
--- a/Frameworks/ArticlesDatabase/ArticlesDatabase.xcodeproj/project.pbxproj
+++ b/Frameworks/ArticlesDatabase/ArticlesDatabase.xcodeproj/project.pbxproj
@@ -517,7 +517,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
+			shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n\nxcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
diff --git a/Frameworks/Secrets/Secrets.xcodeproj/project.pbxproj b/Frameworks/Secrets/Secrets.xcodeproj/project.pbxproj
index 5cc15d12b..42386e90d 100644
--- a/Frameworks/Secrets/Secrets.xcodeproj/project.pbxproj
+++ b/Frameworks/Secrets/Secrets.xcodeproj/project.pbxproj
@@ -183,7 +183,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
+			shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n\nxcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
diff --git a/Frameworks/SyncDatabase/SyncDatabase.xcodeproj/project.pbxproj b/Frameworks/SyncDatabase/SyncDatabase.xcodeproj/project.pbxproj
index 69ca2e492..113fc6111 100644
--- a/Frameworks/SyncDatabase/SyncDatabase.xcodeproj/project.pbxproj
+++ b/Frameworks/SyncDatabase/SyncDatabase.xcodeproj/project.pbxproj
@@ -183,7 +183,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n\n";
+			shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n\nxcrun -sdk macosx swiftc -target x86_64-macosx10.11  ../../buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n   echo \"error: Build Setting were found in the project.pbxproj file.  Most likely you didn't intend to change this file and should revert it.\"\n   exit 1\nfi\n\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
diff --git a/Multiplatform/Shared/SceneModel.swift b/Multiplatform/Shared/SceneModel.swift
index 47a8c74ee..28f8e290d 100644
--- a/Multiplatform/Shared/SceneModel.swift
+++ b/Multiplatform/Shared/SceneModel.swift
@@ -7,9 +7,20 @@
 //
 
 import Foundation
+import Account
 
 final class SceneModel: ObservableObject {
 	
 	var sidebarModel: SidebarModel?
 	
 }
+
+// MARK: SidebarModelDelegate
+
+extension SceneModel: SidebarModelDelegate {
+	
+	func sidebarSelectionDidChange(_: SidebarModel, feeds: [Feed]?) {
+		print("**** sidebar selection changed ***")
+	}
+	
+}
diff --git a/Multiplatform/Shared/SceneNavigationView.swift b/Multiplatform/Shared/SceneNavigationView.swift
index 242609ac7..5205e3063 100644
--- a/Multiplatform/Shared/SceneNavigationView.swift
+++ b/Multiplatform/Shared/SceneNavigationView.swift
@@ -34,6 +34,6 @@ struct SceneNavigationView: View {
 
 struct NavigationView_Previews: PreviewProvider {
     static var previews: some View {
-        SceneNavigationView()
+		SceneNavigationView()
     }
 }
diff --git a/Multiplatform/Shared/Sidebar/SidebarModel.swift b/Multiplatform/Shared/Sidebar/SidebarModel.swift
index 33ec520c7..a3957a4f1 100644
--- a/Multiplatform/Shared/Sidebar/SidebarModel.swift
+++ b/Multiplatform/Shared/Sidebar/SidebarModel.swift
@@ -7,7 +7,14 @@
 //
 
 import Foundation
+import Account
+
+protocol SidebarModelDelegate: class {
+	func sidebarSelectionDidChange(_: SidebarModel, feeds: [Feed]?)
+}
 
 class SidebarModel: ObservableObject {
 	
+	weak var delegate: SidebarModelDelegate?
+	
 }
diff --git a/Multiplatform/Shared/Sidebar/SidebarView.swift b/Multiplatform/Shared/Sidebar/SidebarView.swift
index 81b65d7b3..f24f60d8c 100644
--- a/Multiplatform/Shared/Sidebar/SidebarView.swift
+++ b/Multiplatform/Shared/Sidebar/SidebarView.swift
@@ -9,9 +9,29 @@
 import SwiftUI
 
 struct SidebarView: View {
+	
+	@EnvironmentObject private var sceneModel: SceneModel
+	@StateObject private var sidebarModel = SidebarModel()
+	
     var body: some View {
-        Text("Sidebar View")
-    }
+        Text("Sidebar")
+			.onAppear {
+				sceneModel.sidebarModel = sidebarModel
+				sidebarModel.delegate = sceneModel
+			}
+
+//		List {
+//			ForEach(canvases) { canvas in
+//				Section(header: Text(canvas.name)) {
+//					OutlineGroup(canvas.graphics, children: \.children)
+//					{ graphic in
+//						GraphicRow(graphic)
+//					}
+//				}
+//			}
+//		}
+		
+	}
 }
 
 struct SidebarView_Previews: PreviewProvider {
diff --git a/submodules/RSCore b/submodules/RSCore
index 851b3b672..34c17b358 160000
--- a/submodules/RSCore
+++ b/submodules/RSCore
@@ -1 +1 @@
-Subproject commit 851b3b672763dc5d402c54caa5c10adb9f1a8eef
+Subproject commit 34c17b358b883936141a44db7cc5f3dd7e805267
diff --git a/submodules/RSDatabase b/submodules/RSDatabase
index de7753914..73b827736 160000
--- a/submodules/RSDatabase
+++ b/submodules/RSDatabase
@@ -1 +1 @@
-Subproject commit de7753914c4f47aa97adfbe7a121acf0d2f8cd40
+Subproject commit 73b8277369c4d2d3729b7bb33c11bdd7350d81cb
diff --git a/submodules/RSParser b/submodules/RSParser
index fcbd9a34e..93ccfb0ea 160000
--- a/submodules/RSParser
+++ b/submodules/RSParser
@@ -1 +1 @@
-Subproject commit fcbd9a34ecd8c080c6f26798a4b22ea0c98d8e74
+Subproject commit 93ccfb0ea5f46603045d0c3e726252b7c60b5060
diff --git a/submodules/RSTree b/submodules/RSTree
index 2fc9b9cff..8cd9e07de 160000
--- a/submodules/RSTree
+++ b/submodules/RSTree
@@ -1 +1 @@
-Subproject commit 2fc9b9cff60032a272303ff6d6df5b39ec297179
+Subproject commit 8cd9e07de4bddebd62f803ca00e761e57f806813
diff --git a/submodules/RSWeb b/submodules/RSWeb
index 90636c645..72754ca5b 160000
--- a/submodules/RSWeb
+++ b/submodules/RSWeb
@@ -1 +1 @@
-Subproject commit 90636c6458eaf883e6e890dfc46ae6c65530e2fe
+Subproject commit 72754ca5b699af22c80d4326ca7ad74ec4a22c89
diff --git a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig
index ea17077a6..ad1485973 100644
--- a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig
+++ b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig
@@ -6,3 +6,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
 COMBINE_HIDPI_IMAGES = YES
 MACOSX_DEPLOYMENT_TARGET = 10.15
+SDKROOT = macosx;