diff --git a/.travis.yml b/.travis.yml index 47f73a77..4732cd46 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ os: osx -osx_image: xcode11.3 +osx_image: xcode12.2 before_install: - bash -e ./Scripts/before_install.sh script: diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 7a118b49..00000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" diff --git a/Speculid.xcodeproj/project.pbxproj b/Speculid.xcodeproj/project.pbxproj index 88123fe8..7f44914b 100644 --- a/Speculid.xcodeproj/project.pbxproj +++ b/Speculid.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -14,27 +14,15 @@ B347128924B64968001CCCFD /* ClassicDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = B347128824B64968001CCCFD /* ClassicDocument.swift */; }; B347128B24B668DE001CCCFD /* ClassicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B347128A24B668DE001CCCFD /* ClassicView.swift */; }; B34B6BC224BE354D00F4EE6B /* BookmarkURLCollectionObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34B6BC124BE354D00F4EE6B /* BookmarkURLCollectionObject.swift */; }; - B3796B7C2432C50100E5F5F9 /* speculid in CopyFiles */ = {isa = PBXBuildFile; fileRef = B3DB4824243166FC00B1DA4F /* speculid */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - B3B6A4D124B15292009C6E32 /* doc_appApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B364623E24B14DBB0089382E /* doc_appApp.swift */; }; + B3B6A4D124B15292009C6E32 /* SpeculidApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B364623E24B14DBB0089382E /* SpeculidApp.swift */; }; B3DB48142431642600B1DA4F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B3DB48132431642600B1DA4F /* Assets.xcassets */; }; B3DB48172431642600B1DA4F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B3DB48162431642600B1DA4F /* Preview Assets.xcassets */; }; B3DB481A2431642600B1DA4F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B3DB48182431642600B1DA4F /* Main.storyboard */; }; B3E1707C24C1DBF700784D20 /* LabeledOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3E1707B24C1DBF700784D20 /* LabeledOption.swift */; }; B3E1707E24C1DC1100784D20 /* ResizeOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3E1707D24C1DC1100784D20 /* ResizeOption.swift */; }; B3E1708024C1DC6C00784D20 /* ClassicObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3E1707F24C1DC6C00784D20 /* ClassicObject.swift */; }; - B3E8D6B22434D71000B34464 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3DB4826243166FC00B1DA4F /* main.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - B3796B7D2432C87600E5F5F9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B3DB47FD243162DA00B1DA4F /* Project object */; - proxyType = 1; - remoteGlobalIDString = B3DB4823243166FC00B1DA4F; - remoteInfo = speculid; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ B324D41624C49F500047ED11 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -52,16 +40,6 @@ buildActionMask = 8; dstPath = Contents/Helpers; dstSubfolderSpec = 1; - files = ( - B3796B7C2432C50100E5F5F9 /* speculid in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; - B3DB4822243166FC00B1DA4F /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; @@ -74,7 +52,7 @@ B347128824B64968001CCCFD /* ClassicDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassicDocument.swift; sourceTree = ""; }; B347128A24B668DE001CCCFD /* ClassicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassicView.swift; sourceTree = ""; }; B34B6BC124BE354D00F4EE6B /* BookmarkURLCollectionObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkURLCollectionObject.swift; sourceTree = ""; }; - B364623E24B14DBB0089382E /* doc_appApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = doc_appApp.swift; sourceTree = ""; }; + B364623E24B14DBB0089382E /* SpeculidApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeculidApp.swift; sourceTree = ""; }; B3796B792432B7FF00E5F5F9 /* Command.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Command.entitlements; sourceTree = ""; }; B37A52372435014400FEA6E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B37B472124B93CB900AE2021 /* CairoSVG.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = CairoSVG.xcframework; path = packages/SpeculidKit/packages/CairoSVG/build/CairoSVG.xcframework; sourceTree = ""; }; @@ -86,7 +64,6 @@ B3DB48192431642600B1DA4F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; B3DB481B2431642600B1DA4F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B3DB481C2431642600B1DA4F /* Speculid.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Speculid.entitlements; sourceTree = ""; }; - B3DB4824243166FC00B1DA4F /* speculid */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = speculid; sourceTree = BUILT_PRODUCTS_DIR; }; B3DB4826243166FC00B1DA4F /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; B3E1707B24C1DBF700784D20 /* LabeledOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabeledOption.swift; sourceTree = ""; }; B3E1707D24C1DC1100784D20 /* ResizeOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResizeOption.swift; sourceTree = ""; }; @@ -103,13 +80,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - B3DB4821243166FC00B1DA4F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -155,7 +125,6 @@ isa = PBXGroup; children = ( B3DB48072431642100B1DA4F /* Speculid.app */, - B3DB4824243166FC00B1DA4F /* speculid */, ); name = Products; sourceTree = ""; @@ -163,7 +132,7 @@ B3DB48092431642100B1DA4F /* Speculid */ = { isa = PBXGroup; children = ( - B364623E24B14DBB0089382E /* doc_appApp.swift */, + B364623E24B14DBB0089382E /* SpeculidApp.swift */, B3DB480E2431642100B1DA4F /* ContentView.swift */, B3DB48132431642600B1DA4F /* Assets.xcassets */, B3DB48182431642600B1DA4F /* Main.storyboard */, @@ -201,11 +170,11 @@ B3DB48052431642100B1DA4F /* Resources */, B3796B7A2432C33600E5F5F9 /* CopyFiles */, B324D41624C49F500047ED11 /* Embed Frameworks */, + B33E6494252F612700A12CFD /* ShellScript */, ); buildRules = ( ); dependencies = ( - B3796B7E2432C87600E5F5F9 /* PBXTargetDependency */, ); name = Speculid; packageProductDependencies = ( @@ -215,23 +184,6 @@ productReference = B3DB48072431642100B1DA4F /* Speculid.app */; productType = "com.apple.product-type.application"; }; - B3DB4823243166FC00B1DA4F /* speculid */ = { - isa = PBXNativeTarget; - buildConfigurationList = B3DB4828243166FC00B1DA4F /* Build configuration list for PBXNativeTarget "speculid" */; - buildPhases = ( - B3DB4820243166FC00B1DA4F /* Sources */, - B3DB4821243166FC00B1DA4F /* Frameworks */, - B3DB4822243166FC00B1DA4F /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = speculid; - productName = speculid; - productReference = B3DB4824243166FC00B1DA4F /* speculid */; - productType = "com.apple.product-type.tool"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -244,13 +196,10 @@ B3DB48062431642100B1DA4F = { CreatedOnToolsVersion = 11.4; }; - B3DB4823243166FC00B1DA4F = { - CreatedOnToolsVersion = 11.4; - }; }; }; buildConfigurationList = B3DB4800243162DA00B1DA4F /* Build configuration list for PBXProject "Speculid" */; - compatibilityVersion = "Xcode 9.3"; + compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -263,7 +212,6 @@ projectRoot = ""; targets = ( B3DB48062431642100B1DA4F /* Speculid */, - B3DB4823243166FC00B1DA4F /* speculid */, ); }; /* End PBXProject section */ @@ -281,6 +229,26 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + B33E6494252F612700A12CFD /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "swiftformat --lint . && swiftlint\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ B3DB48032431642100B1DA4F /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -292,29 +260,13 @@ B3E1707C24C1DBF700784D20 /* LabeledOption.swift in Sources */, B347128924B64968001CCCFD /* ClassicDocument.swift in Sources */, B3326D4324C1CFF000629F70 /* Tooltip.swift in Sources */, - B3B6A4D124B15292009C6E32 /* doc_appApp.swift in Sources */, + B3B6A4D124B15292009C6E32 /* SpeculidApp.swift in Sources */, B3E1708024C1DC6C00784D20 /* ClassicObject.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - B3DB4820243166FC00B1DA4F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B3E8D6B22434D71000B34464 /* main.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - B3796B7E2432C87600E5F5F9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = B3DB4823243166FC00B1DA4F /* speculid */; - targetProxy = B3796B7D2432C87600E5F5F9 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ B3DB48182431642600B1DA4F /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -357,7 +309,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.16; + MACOSX_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; }; name = Debug; @@ -391,7 +343,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.16; + MACOSX_DEPLOYMENT_TARGET = 11.0; }; name = Release; }; @@ -433,7 +385,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 13; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_ASSET_PATHS = "\"Speculid/Preview Content\""; DEVELOPMENT_TEAM = MLT7M394S7; @@ -533,7 +485,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 13; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "\"Speculid/Preview Content\""; DEVELOPMENT_TEAM = MLT7M394S7; @@ -588,145 +540,6 @@ }; name = Release; }; - B3DB4829243166FC00B1DA4F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_ENTITLEMENTS = command/Command.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 12; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = MLT7M394S7; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "$(SRCROOT)/command/Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.brightdigit.Speculid-macOS-Cmd"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - B3DB482A243166FC00B1DA4F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_ENTITLEMENTS = command/Command.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 12; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = MLT7M394S7; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "$(SRCROOT)/command/Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.brightdigit.Speculid-macOS-Cmd"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -748,15 +561,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B3DB4828243166FC00B1DA4F /* Build configuration list for PBXNativeTarget "speculid" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B3DB4829243166FC00B1DA4F /* Debug */, - B3DB482A243166FC00B1DA4F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ diff --git a/Speculid.xcodeproj/xcshareddata/xcschemes/Speculid.xcscheme b/Speculid.xcodeproj/xcshareddata/xcschemes/Speculid.xcscheme deleted file mode 100644 index 62ae0026..00000000 --- a/Speculid.xcodeproj/xcshareddata/xcschemes/Speculid.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Speculid/BookmarkURLCollectionObject.swift b/Speculid/BookmarkURLCollectionObject.swift index f2d95b8a..a1db2e0b 100644 --- a/Speculid/BookmarkURLCollectionObject.swift +++ b/Speculid/BookmarkURLCollectionObject.swift @@ -55,12 +55,12 @@ public class BookmarkURLCollectionObject: ObservableObject, Sandbox { public func bookmarkURL(fromURL url: URL) throws -> URL { var isStale: Bool = false let fromURLResult: Result - let fromURLCurrentResult = Self.shared.bookmarks?[url.path].map { - data in - Result { - try URL(resolvingBookmarkData: data, options: .withSecurityScope, relativeTo: nil, bookmarkDataIsStale: &isStale) + let fromURLCurrentResult = Self.shared.bookmarks?[url.path] + .map { data in + Result { + try URL(resolvingBookmarkData: data, options: .withSecurityScope, relativeTo: nil, bookmarkDataIsStale: &isStale) + } } - } if isStale { saveBookmark(url) } diff --git a/Speculid/ClassicDocument.swift b/Speculid/ClassicDocument.swift index c8151311..151d2f04 100644 --- a/Speculid/ClassicDocument.swift +++ b/Speculid/ClassicDocument.swift @@ -9,47 +9,89 @@ extension UTType { } } -struct ClassicDocument: FileDocument { - var document: SpeculidMutableSpecificationsFile - - init(document: SpeculidSpecificationsFile = SpeculidSpecificationsFile()) { - self.document = SpeculidMutableSpecificationsFile(source: document) +class ClassicDocument: FileDocument, SpeculidSpecificationsFileProtocol, ObservableObject { + @Published public var assetDirectoryRelativePath: String + @Published public var sourceImageRelativePath: String + @Published public var geometry: Geometry? + @Published public var background: NSColor? + @Published public var removeAlpha: Bool + @Published public var url: URL? + + // var document: SpeculidMutableSpecificationsFile + + init(source: SpeculidSpecificationsFile = SpeculidSpecificationsFile()) { + assetDirectoryRelativePath = source.assetDirectoryRelativePath + sourceImageRelativePath = source.sourceImageRelativePath + geometry = source.geometry + background = source.background + removeAlpha = source.removeAlpha } static var readableContentTypes: [UTType] { [.speculidImageDocument] } + static var writableContentTypes: [UTType] { [.speculidImageDocument] } - init(fileWrapper: FileWrapper, contentType _: UTType) throws { + required init(configuration: ReadConfiguration) throws { let decoder = JSONDecoder() - guard let data = fileWrapper.regularFileContents + guard let data = configuration.file.regularFileContents else { throw CocoaError(.fileReadCorruptFile) } - let document = try decoder.decode(SpeculidSpecificationsFile.self, from: data) - self.document = SpeculidMutableSpecificationsFile(source: document) + let source = try decoder.decode(SpeculidSpecificationsFile.self, from: data) + + assetDirectoryRelativePath = source.assetDirectoryRelativePath + sourceImageRelativePath = source.sourceImageRelativePath + geometry = source.geometry + background = source.background + removeAlpha = source.removeAlpha } - func write(to fileWrapper: inout FileWrapper, contentType _: UTType) throws { - let document = SpeculidSpecificationsFile(source: self.document) +// func write(to fileWrapper: inout FileWrapper, contentType _: UTType) throws { +// let document = SpeculidSpecificationsFile(source: self.document) +// let encoder = JSONEncoder() +// let data = try encoder.encode(document) +// fileWrapper = FileWrapper(regularFileWithContents: data) +// } + + func fileWrapper(configuration _: WriteConfiguration) throws -> FileWrapper { + debugPrint(assetDirectoryRelativePath) + let document = SpeculidSpecificationsFile(source: self) let encoder = JSONEncoder() + encoder.outputFormatting = [.prettyPrinted, .withoutEscapingSlashes] + let data = try encoder.encode(document) - fileWrapper = FileWrapper(regularFileWithContents: data) + let wrapper = FileWrapper(regularFileWithContents: data) + if let url = self.url { + try wrapper.write(to: url, options: .withNameUpdating, originalContentsURL: nil) + } + + return wrapper } func build(fromURL url: URL, inSandbox sandbox: Sandbox) { let document: SpeculidDocument do { - document = try SpeculidDocument(sandboxedFromFile: self.document, withURL: url, decoder: JSONDecoder(), withManager: sandbox) + document = try SpeculidDocument(sandboxedFromFile: self, withURL: url, decoder: JSONDecoder(), withManager: sandbox) } catch { debugPrint(error) debugPrint(error.localizedDescription) return } - let destinationFileNames = document.assetFile.document.images.map { - asset in - (asset, document.destinationName(forImage: asset)) + let file = SpeculidSpecificationsFile(source: self) + let encoder = JSONEncoder() + encoder.outputFormatting = [.prettyPrinted, .withoutEscapingSlashes] + + if let url = self.url, let data = try? encoder.encode(file) { + try? data.write(to: url) } + // self.fileWrapper(configuration: WriteConfiguration) + + let destinationFileNames = document.assetFile.document.images + .map { asset in + (asset, document.destinationName(forImage: asset)) + } + let urlMap = destinationFileNames.map { asset, fileName in (asset, fileName, document.destinationURL(forFileName: fileName)) } @@ -58,12 +100,12 @@ struct ClassicDocument: FileDocument { } func processImages(fromURL url: URL, management: Sandbox, document: SpeculidDocument, sandboxMap: [(AssetSpecificationProtocol, String, URL)]) { - let assetDirectoryURL = url.deletingLastPathComponent().appendingPathComponent(self.document.assetDirectoryRelativePath) + let assetDirectoryURL = url.deletingLastPathComponent().appendingPathComponent(assetDirectoryRelativePath) let imageSpecificationBuilder = SpeculidImageSpecificationBuilder() - let imageSpecifications: [ImageSpecification] + let imageSpecifications: [ImageSpecificationObject] do { - imageSpecifications = try sandboxMap.map { (asset, _, url) -> ImageSpecification in + imageSpecifications = try sandboxMap.map { (asset, _, url) -> ImageSpecificationObject in try imageSpecificationBuilder.imageSpecification(forURL: url, withSpecifications: document.specificationsFile, andAsset: asset) } } catch { @@ -71,7 +113,7 @@ struct ClassicDocument: FileDocument { return // callback(error) } - let service = Service() + let service = ServiceObject() let sourceURL: URL do { sourceURL = try management.bookmarkURL(fromURL: document.sourceImageURL) diff --git a/Speculid/ClassicObject.swift b/Speculid/ClassicObject.swift index affb5704..376b76b4 100644 --- a/Speculid/ClassicObject.swift +++ b/Speculid/ClassicObject.swift @@ -4,7 +4,7 @@ import SpeculidKit import SwiftUI class ClassicObject: ObservableObject { - let url: URL? + @Published var url: URL? @Published var geometryValue: Float = 0.0 @Published var assetDirectoryRelativePath: String = "" @Published var sourceImageRelativePath: String = "" @@ -13,7 +13,7 @@ class ClassicObject: ObservableObject { @Published var resizeOption = ResizeOption.none.rawValue @Published var addBackground: Bool = false - var document: ClassicDocument + @Published var document: ClassicDocument var cancellables = [AnyCancellable]() var assetDirectoryURL: URL? { @@ -36,13 +36,13 @@ class ClassicObject: ObservableObject { self.url = url self.document = document - assetDirectoryRelativePath = self.document.document.assetDirectoryRelativePath - sourceImageRelativePath = self.document.document.sourceImageRelativePath - addBackground = self.document.document.background != nil - backgroundColor = self.document.document.background.map(Color.init) ?? .clear - geometryValue = self.document.document.geometry?.value ?? 0.0 - resizeOption = ResizeOption(geometryType: self.document.document.geometry?.dimension).rawValue - removeAlpha = self.document.document.removeAlpha + assetDirectoryRelativePath = self.document.assetDirectoryRelativePath + sourceImageRelativePath = self.document.sourceImageRelativePath + addBackground = self.document.background != nil + backgroundColor = self.document.background.map(Color.init) ?? .clear + geometryValue = self.document.geometry?.value ?? 0.0 + resizeOption = ResizeOption(geometryType: self.document.geometry?.dimension).rawValue + removeAlpha = self.document.removeAlpha let nscolorPub = $addBackground.combineLatest($backgroundColor) { $0 ? NSColor($1) : nil @@ -64,11 +64,15 @@ class ClassicObject: ObservableObject { assign($removeAlpha, documentProperty: \.removeAlpha) assign(nscolorPub, documentProperty: \.background) assign(geoPub, documentProperty: \.geometry) + assign($url, documentProperty: \.url) } - func assign(_ publisher: PublisherType, documentProperty: WritableKeyPath) where PublisherType.Output == ValueType, PublisherType.Failure == Never { + func assign( + _ publisher: PublisherType, + documentProperty: WritableKeyPath + ) where PublisherType.Output == ValueType, PublisherType.Failure == Never { publisher.sink { value in - self.document.document[keyPath: documentProperty] = value + self.document[keyPath: documentProperty] = value }.store(in: &cancellables) } } diff --git a/Speculid/ClassicView.swift b/Speculid/ClassicView.swift index 1bca41a3..48734285 100644 --- a/Speculid/ClassicView.swift +++ b/Speculid/ClassicView.swift @@ -1,11 +1,39 @@ import Combine import SpeculidKit import SwiftUI +extension URL { + func relativePath(from base: URL) -> String? { + // Ensure that both URLs represent files: + guard isFileURL, base.isFileURL else { + return nil + } + + // Remove/replace "." and "..", make paths absolute: + let destComponents = standardized.pathComponents + let baseComponents = base.standardized.pathComponents + + // Find number of common path components: + var index = 0 + while index < destComponents.count, + index < baseComponents.count, + destComponents[index] == baseComponents[index] + { + index += 1 + } + + // Build relative path: + var relComponents = Array(repeating: "..", count: baseComponents.count - index) + relComponents.append(contentsOf: destComponents[index...]) + return relComponents.joined(separator: "/") + } +} struct ClassicView: View { @StateObject var object: ClassicObject @EnvironmentObject var bookmarkCollection: BookmarkURLCollectionObject - @Environment(\.importFiles) var importFiles + @State private var isACImporting: Bool = false + @State private var isSourceImporting: Bool = false + @State private var isExporting: Bool = false init(url: URL?, document: ClassicDocument, documentBinding _: Binding) { _object = StateObject(wrappedValue: ClassicObject(url: url, document: document)) @@ -14,9 +42,9 @@ struct ClassicView: View { var canBuild: Bool { return object.url != nil && - bookmarkCollection.isAvailable(basedOn: object.url, relativePath: object.document.document.assetDirectoryRelativePath) && + bookmarkCollection.isAvailable(basedOn: object.url, relativePath: object.document.assetDirectoryRelativePath) && - bookmarkCollection.isAvailable(basedOn: object.url, relativePath: object.document.document.sourceImageRelativePath) + bookmarkCollection.isAvailable(basedOn: object.url, relativePath: object.document.sourceImageRelativePath) } var body: some View { @@ -27,15 +55,28 @@ struct ClassicView: View { Text("File Path:").frame(width: 75, alignment: .trailing) TextField("SVG of PNG File", text: self.$object.sourceImageRelativePath) .overlay(Image(systemName: "folder.fill").foregroundColor(.primary).padding(.trailing, 4.0), alignment: .trailing) - .disabled(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/).frame(width: 250).onTapGesture { - self.importFiles(singleOfType: [.svg, .png]) { result in - guard case let .success(url) = result else { - return - } - bookmarkCollection.saveBookmark(url) + .disabled(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/).frame(width: 250) + .fileImporter(isPresented: self.$isSourceImporting, allowedContentTypes: [.svg, .png]) { result in + + guard case let .success(url) = result, let baseURL = self.object.url?.deletingLastPathComponent() else { + return + } + guard let relativePath = url.relativePath(from: baseURL) else { + return } + bookmarkCollection.saveBookmark(url) + self.object.sourceImageRelativePath = relativePath + }.onTapGesture { + self.isSourceImporting = true } - Image(systemName: "lock.fill").foregroundColor(.yellow).opacity(self.bookmarkCollection.isAvailable(basedOn: self.object.url, relativePath: self.object.sourceImageRelativePath) ? 0.0 : 1.0) + Image( + systemName: "lock.fill") + .foregroundColor(.yellow) + .opacity(self.bookmarkCollection + .isAvailable( + basedOn: self.object.url, + relativePath: self.object.sourceImageRelativePath + ) ? 0.0 : 1.0) Spacer() } } @@ -46,15 +87,29 @@ struct ClassicView: View { Text("Folder:").frame(width: 75, alignment: .trailing) TextField(".appiconset or .imageset", text: self.$object.assetDirectoryRelativePath) .overlay(Image(systemName: "folder.fill").foregroundColor(.primary).padding(.trailing, 4.0), alignment: .trailing) - .disabled(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/).frame(width: 250).onTapGesture { - self.importFiles(singleOfType: [.directory]) { result in - guard case let .success(url) = result else { - return - } - bookmarkCollection.saveBookmark(url) + .disabled(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/).frame(width: 250) + .fileImporter(isPresented: self.$isACImporting, allowedContentTypes: [.directory]) { result in + guard case let .success(url) = result, let baseURL = self.object.url?.deletingLastPathComponent() else { + return } + guard let relativePath = url.relativePath(from: baseURL) else { + return + } + bookmarkCollection.saveBookmark(url) + // self.object.document.document.assetDirectoryRelativePath = url.path + self.object.assetDirectoryRelativePath = relativePath + + }.onTapGesture { + self.isACImporting = true } - Image(systemName: "lock.fill").foregroundColor(.yellow).opacity(self.bookmarkCollection.isAvailable(basedOn: self.object.url, relativePath: self.object.assetDirectoryRelativePath) ? 0.0 : 1.0) + Image( + systemName: "lock.fill") + .foregroundColor(.yellow) + .opacity(self.bookmarkCollection + .isAvailable( + basedOn: self.object.url, + relativePath: self.object.assetDirectoryRelativePath + ) ? 0.0 : 1.0) Spacer() } } @@ -63,6 +118,7 @@ struct ClassicView: View { HStack { VStack(alignment: .leading) { Toggle("Remove Alpha Channel", isOn: self.$object.removeAlpha) + // swiftlint:disable:next line_length Text("If this is intended for an iOS, watchOS, or tvOS App, then you should remove the alpha channel from the source graphic.").multilineTextAlignment(.leading).font(.subheadline).lineLimit(nil) } Spacer() @@ -70,9 +126,17 @@ struct ClassicView: View { VStack(alignment: .leading) { HStack { Toggle("Add a Background Color", isOn: self.$object.addBackground) - ColorPicker("", selection: self.$object.backgroundColor, supportsOpacity: false).labelsHidden().frame(width: 40, height: 25, alignment: .trailing).disabled(!self.object.addBackground).opacity(self.object.addBackground ? 1.0 : 0.5) + ColorPicker("", selection: self.$object.backgroundColor, supportsOpacity: false) + .labelsHidden() + .frame(width: 40, height: 25, alignment: .trailing) + .disabled(!self.object.addBackground) + .opacity(self.object.addBackground ? 1.0 : 0.5) } - Text("If this is intended for an iOS, watchOS, or tvOS App, then you should set a background color.").multilineTextAlignment(.leading).font(.subheadline).lineLimit(nil) + + Text("If this is intended for an iOS, watchOS, or tvOS App, then you should set a background color.") + .multilineTextAlignment(.leading) + .font(.subheadline) + .lineLimit(nil) } }.disabled(!self.object.isAppIcon).opacity(self.object.isAppIcon ? 1.0 : 0.5) Divider() @@ -84,10 +148,18 @@ struct ClassicView: View { } }.pickerStyle(SegmentedPickerStyle()) .frame(width: 150, alignment: .leading).labelsHidden() - TextField("Value", value: self.$object.geometryValue, formatter: NumberFormatter()).frame(width: 50, alignment: .leading).disabled(self.object.resizeOption == 0).opacity(self.object.resizeOption == 0 ? 0.5 : 1.0) + TextField("Value", value: self.$object.geometryValue, formatter: NumberFormatter()) + .frame(width: 50, alignment: .leading) + .disabled(self.object.resizeOption == 0) + .opacity(self.object.resizeOption == 0 ? 0.5 : 1.0) Text("px").opacity(self.object.resizeOption == 0 ? 0.5 : 1.0) } - Text("If you wish to render scaled PNG files for an image set, then specify either width or height and the image will be resized to that dimention while retaining its aspect ratio.\nOtherwise if you select \"None\", then only a PDF will be rendered. ").multilineTextAlignment(.leading).font(.subheadline).lineLimit(nil) + + // swiftlint:disable:next line_length + Text("If you wish to render scaled PNG files for an image set, then specify either width or height and the image will be resized to that dimention while retaining its aspect ratio.\nOtherwise if you select \"None\", then only a PDF will be rendered. ") + .multilineTextAlignment(.leading) + .font(.subheadline) + .lineLimit(nil) }.disabled(!self.object.isImageSet).opacity(self.object.isImageSet ? 1.0 : 0.5) Divider() Section { @@ -101,10 +173,26 @@ struct ClassicView: View { Image(systemName: "play.fill") Text("Build") } - } + }.disabled(!canBuild) } } - }.padding(.all, 40.0).frame(minWidth: 500, idealWidth: 500, maxWidth: 600, minHeight: 500, idealHeight: 500, maxHeight: .infinity, alignment: .center) + } + .padding(.all, 40.0) + .frame(minWidth: 500, idealWidth: 500, maxWidth: 600, minHeight: 500, idealHeight: 500, maxHeight: .infinity, alignment: .center) + + .fileExporter( + isPresented: $isExporting, + document: self.object.document, + contentType: .speculidImageDocument, + defaultFilename: self.object.url?.lastPathComponent ?? "" + ) { result in + guard case let .success(url) = result else { + return + } + self.object.url = url + }.onAppear { + self.isExporting = self.object.url == nil + } } } diff --git a/Speculid/doc_appApp.swift b/Speculid/SpeculidApp.swift similarity index 54% rename from Speculid/doc_appApp.swift rename to Speculid/SpeculidApp.swift index 4ee7aa7d..04508e81 100644 --- a/Speculid/doc_appApp.swift +++ b/Speculid/SpeculidApp.swift @@ -1,18 +1,20 @@ import SwiftUI @main -struct doc_appApp: App { +struct SpeculidApp: App { @StateObject private var bookmarkCollection = BookmarkURLCollectionObject() + @State private var isExporting: Bool = false @SceneBuilder var body: some Scene { -// -// DocumentGroup(newDocument: doc_appDocument()) { file in -// ContentView(document: file.$document) -// } - DocumentGroup(viewing: ClassicDocument.self) { file in - + DocumentGroup(newDocument: ClassicDocument()) { file in ClassicView(url: file.fileURL, document: file.document, documentBinding: file.$document).environmentObject(bookmarkCollection) - }.commands { + } + +// DocumentGroup(viewing: ClassicDocument.self) { file in +// +// ClassicView(url: file.fileURL, document: file.document, documentBinding: file.$document).environmentObject(bookmarkCollection) +// } + .commands { CommandMenu("Developer Tools") { Button("Reset Bookmarks") { self.bookmarkCollection.reset() diff --git a/packages/SpeculidKit b/packages/SpeculidKit index 4dde8dc3..a5ed9770 160000 --- a/packages/SpeculidKit +++ b/packages/SpeculidKit @@ -1 +1 @@ -Subproject commit 4dde8dc3ad6addcc4a9ea6a56011f074859bf085 +Subproject commit a5ed97704f864807c0bdc31189f577c256036a0e diff --git a/scripts/github-markdown-toc b/scripts/github-markdown-toc index 83fadb60..488f3100 160000 --- a/scripts/github-markdown-toc +++ b/scripts/github-markdown-toc @@ -1 +1 @@ -Subproject commit 83fadb60a7f1607c1c46e868ed2a866bb70b4c76 +Subproject commit 488f310064b16c1eb9c17862cc5844189ee65955 diff --git a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AccentColor.colorset/Contents.json b/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb878970..00000000 --- a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AppIcon.appiconset/Contents.json b/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 3f00db43..00000000 --- a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/Contents.json b/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/swiftuidoc.app/swiftuidoc.app/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/ContentView.swift b/swiftuidoc.app/swiftuidoc.app/ContentView.swift deleted file mode 100644 index 0cd4b442..00000000 --- a/swiftuidoc.app/swiftuidoc.app/ContentView.swift +++ /dev/null @@ -1,15 +0,0 @@ -import SwiftUI - -struct ContentView: View { - @Binding var document: swiftuidoc_appDocument - - var body: some View { - TextEditor(text: $document.text) - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView(document: .constant(swiftuidoc_appDocument())) - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/Info.plist b/swiftuidoc.app/swiftuidoc.app/Info.plist deleted file mode 100644 index da1b9998..00000000 --- a/swiftuidoc.app/swiftuidoc.app/Info.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDocumentTypes - - - CFBundleTypeRole - Editor - LSItemContentTypes - - com.example.plain-text - - NSUbiquitousDocumentUserActivityType - $(PRODUCT_BUNDLE_IDENTIFIER).example-document - - - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - UTImportedTypeDeclarations - - - UTTypeConformsTo - - public.plain-text - - UTTypeDescription - Example Text - UTTypeIdentifier - com.example.plain-text - UTTypeTagSpecification - - public.filename-extension - - exampletext - - - - - - diff --git a/swiftuidoc.app/swiftuidoc.app/Preview Content/Preview Assets.xcassets/Contents.json b/swiftuidoc.app/swiftuidoc.app/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/swiftuidoc.app/swiftuidoc.app/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_app.entitlements b/swiftuidoc.app/swiftuidoc.app/swiftuidoc_app.entitlements deleted file mode 100644 index 6d968edb..00000000 --- a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_app.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-write - - - diff --git a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appApp.swift b/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appApp.swift deleted file mode 100644 index 4a80c01c..00000000 --- a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appApp.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct swiftuidoc_appApp: App { - var body: some Scene { - DocumentGroup(newDocument: swiftuidoc_appDocument()) { file in - ContentView(document: file.$document) - } - } -} diff --git a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appDocument.swift b/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appDocument.swift deleted file mode 100644 index 09da1f22..00000000 --- a/swiftuidoc.app/swiftuidoc.app/swiftuidoc_appDocument.swift +++ /dev/null @@ -1,32 +0,0 @@ -import SwiftUI -import UniformTypeIdentifiers - -extension UTType { - static var exampleText: UTType { - UTType(importedAs: "com.example.plain-text") - } -} - -struct swiftuidoc_appDocument: FileDocument { - var text: String - - init(text: String = "Hello, world!") { - self.text = text - } - - static var readableContentTypes: [UTType] { [.exampleText] } - - init(fileWrapper: FileWrapper, contentType _: UTType) throws { - guard let data = fileWrapper.regularFileContents, - let string = String(data: data, encoding: .utf8) - else { - throw CocoaError(.fileReadCorruptFile) - } - text = string - } - - func write(to fileWrapper: inout FileWrapper, contentType _: UTType) throws { - let data = text.data(using: .utf8)! - fileWrapper = FileWrapper(regularFileWithContents: data) - } -}