From 91d40cbeea48239d90b26eccfd78347848593f0b Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 13 Apr 2023 14:58:58 -0500 Subject: [PATCH] [Previews] Adds DeltaPreviews target for previewing SwiftUI views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main Delta target cannot use SwiftUI Previews due to linker errors with Systems.framework, so we’ve made a separate target specifically for previewing SwiftUI views. --- Delta.xcodeproj/project.pbxproj | 173 ++++++++++++++++++ .../xcschemes/DeltaPreviews.xcscheme | 66 +++++++ DeltaPreviews/ContentView.swift | 21 +++ DeltaPreviews/DeltaPreviews.h | 19 ++ 4 files changed, 279 insertions(+) create mode 100644 Delta.xcodeproj/xcshareddata/xcschemes/DeltaPreviews.xcscheme create mode 100644 DeltaPreviews/ContentView.swift create mode 100644 DeltaPreviews/DeltaPreviews.h diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 85a665e..51197c5 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -171,6 +171,8 @@ D5011C48281B6E8B00A0760B /* CharacterSet+Filename.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5011C47281B6E8B00A0760B /* CharacterSet+Filename.swift */; }; D53415A5298C782A00FD67B1 /* ContributorsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D53415A4298C782A00FD67B1 /* ContributorsView.swift */; }; D53415A7298C78BC00FD67B1 /* Contributors.plist in Resources */ = {isa = PBXBuildFile; fileRef = D53415A6298C78BC00FD67B1 /* Contributors.plist */; }; + D539103229E88B6C0006B350 /* DeltaPreviews.h in Headers */ = {isa = PBXBuildFile; fileRef = D539103129E88B6C0006B350 /* DeltaPreviews.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D539104029E88BC40006B350 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D539103F29E88BC40006B350 /* ContentView.swift */; }; D5864970297734280081477E /* CheatMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = D586496F297734280081477E /* CheatMetadata.swift */; }; D586497229774ABD0081477E /* CheatBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D586497129774ABD0081477E /* CheatBase.swift */; }; D5864978297756CE0081477E /* CheatBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5864977297756CE0081477E /* CheatBaseView.swift */; }; @@ -377,6 +379,9 @@ D5011C47281B6E8B00A0760B /* CharacterSet+Filename.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CharacterSet+Filename.swift"; sourceTree = ""; }; D53415A4298C782A00FD67B1 /* ContributorsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContributorsView.swift; sourceTree = ""; }; D53415A6298C78BC00FD67B1 /* Contributors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Contributors.plist; sourceTree = ""; }; + D539102F29E88B6B0006B350 /* DeltaPreviews.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DeltaPreviews.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D539103129E88B6C0006B350 /* DeltaPreviews.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeltaPreviews.h; sourceTree = ""; }; + D539103F29E88BC40006B350 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; D586496F297734280081477E /* CheatMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheatMetadata.swift; sourceTree = ""; }; D586497129774ABD0081477E /* CheatBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheatBase.swift; sourceTree = ""; }; D5864977297756CE0081477E /* CheatBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheatBaseView.swift; sourceTree = ""; }; @@ -407,6 +412,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D539102C29E88B6B0006B350 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -833,6 +845,7 @@ isa = PBXGroup; children = ( BFFA71D91AAC406100EE9DD1 /* Delta */, + D539103029E88B6C0006B350 /* DeltaPreviews */, BF9F4FCD1AAD7B25004C9500 /* Frameworks */, BFEC732F1AAECCBD00650035 /* Resources */, BFFA71D81AAC406100EE9DD1 /* Products */, @@ -844,6 +857,7 @@ isa = PBXGroup; children = ( BFFA71D71AAC406100EE9DD1 /* Delta.app */, + D539102F29E88B6B0006B350 /* DeltaPreviews.framework */, ); name = Products; sourceTree = ""; @@ -913,6 +927,15 @@ path = Launch; sourceTree = ""; }; + D539103029E88B6C0006B350 /* DeltaPreviews */ = { + isa = PBXGroup; + children = ( + D539103129E88B6C0006B350 /* DeltaPreviews.h */, + D539103F29E88BC40006B350 /* ContentView.swift */, + ); + path = DeltaPreviews; + sourceTree = ""; + }; D586496E297734060081477E /* Cheats */ = { isa = PBXGroup; children = ( @@ -945,6 +968,17 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + D539102A29E88B6B0006B350 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D539103229E88B6C0006B350 /* DeltaPreviews.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ BFFA71D61AAC406100EE9DD1 /* Delta */ = { isa = PBXNativeTarget; @@ -971,6 +1005,24 @@ productReference = BFFA71D71AAC406100EE9DD1 /* Delta.app */; productType = "com.apple.product-type.application"; }; + D539102E29E88B6B0006B350 /* DeltaPreviews */ = { + isa = PBXNativeTarget; + buildConfigurationList = D539103729E88B6C0006B350 /* Build configuration list for PBXNativeTarget "DeltaPreviews" */; + buildPhases = ( + D539102A29E88B6B0006B350 /* Headers */, + D539102B29E88B6B0006B350 /* Sources */, + D539102C29E88B6B0006B350 /* Frameworks */, + D539102D29E88B6B0006B350 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DeltaPreviews; + productName = DeltaPreviews; + productReference = D539102F29E88B6B0006B350 /* DeltaPreviews.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1003,6 +1055,9 @@ }; }; }; + D539102E29E88B6B0006B350 = { + CreatedOnToolsVersion = 14.3; + }; }; }; buildConfigurationList = BFFA71D21AAC406100EE9DD1 /* Build configuration list for PBXProject "Delta" */; @@ -1025,6 +1080,7 @@ BFFA71D61AAC406100EE9DD1 /* Delta */, BF14D8941DE7A512002CA1BE /* mogenerator */, BF6E70B925D2187800E41CD1 /* Systems */, + D539102E29E88B6B0006B350 /* DeltaPreviews */, ); }; /* End PBXProject section */ @@ -1050,6 +1106,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D539102D29E88B6B0006B350 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -1290,6 +1353,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D539102B29E88B6B0006B350 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D539104029E88BC40006B350 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -1547,6 +1618,99 @@ }; name = Release; }; + D539103829E88B6C0006B350 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Riley Testut. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.DeltaPreviews; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D539103929E88B6C0006B350 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Riley Testut. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.DeltaPreviews; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1586,6 +1750,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D539103729E88B6C0006B350 /* Build configuration list for PBXNativeTarget "DeltaPreviews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D539103829E88B6C0006B350 /* Debug */, + D539103929E88B6C0006B350 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/Delta.xcodeproj/xcshareddata/xcschemes/DeltaPreviews.xcscheme b/Delta.xcodeproj/xcshareddata/xcschemes/DeltaPreviews.xcscheme new file mode 100644 index 0000000..ea06507 --- /dev/null +++ b/Delta.xcodeproj/xcshareddata/xcschemes/DeltaPreviews.xcscheme @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DeltaPreviews/ContentView.swift b/DeltaPreviews/ContentView.swift new file mode 100644 index 0000000..8f25022 --- /dev/null +++ b/DeltaPreviews/ContentView.swift @@ -0,0 +1,21 @@ +// +// ContentView.swift +// DeltaPreviews +// +// Created by Riley Testut on 4/13/23. +// Copyright © 2023 Riley Testut. All rights reserved. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/DeltaPreviews/DeltaPreviews.h b/DeltaPreviews/DeltaPreviews.h new file mode 100644 index 0000000..a667ff0 --- /dev/null +++ b/DeltaPreviews/DeltaPreviews.h @@ -0,0 +1,19 @@ +// +// DeltaPreviews.h +// DeltaPreviews +// +// Created by Riley Testut on 4/13/23. +// Copyright © 2023 Riley Testut. All rights reserved. +// + +#import + +//! Project version number for DeltaPreviews. +FOUNDATION_EXPORT double DeltaPreviewsVersionNumber; + +//! Project version string for DeltaPreviews. +FOUNDATION_EXPORT const unsigned char DeltaPreviewsVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +