diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..917e0f7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# [1.1.0](https://github.com/MarcoEidinger/SwiftPlantUML-Xcode-Extension/releases/tag/1.1.0) + +## Features + +- [X] 🖥️ Use on macOS 10.15.7 and not only on macOS 11 + +## Internal Dependencies + +uses [SwiftPlantUML@0.4.0](https://github.com/MarcoEidinger/SwiftPlantUML/releases/tag/0.4.0) + +# [1.0.0](https://github.com/MarcoEidinger/SwiftPlantUML-Xcode-Extension/releases/tag/1.0.0) + +## Features + +- [X] 📊 Create class diagram from Swift file +- [X] 🔦 Create class diagram from selected Swift code + +## Internal Dependencies + +uses [SwiftPlantUML@0.2.0](https://github.com/MarcoEidinger/SwiftPlantUML/releases/tag/0.2.0) diff --git a/README.md b/README.md index 0611bca..5bad922 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This Source Editor Extension makes use of [SwiftPlantUML](https://github.com/Mar ![SwiftPlantUML Xcode Extension - Installation](.assets/installation.png) -## Technicla Details +## Technical Details This Source Editor Extension makes use of XPC service to run the app sandboxed and use `SwiftPlantUML` (and its dependency `SourceKitten`). Source Editor Extensions using `SourceKitten` (either directly or indirectly) have to either run in a non-sandboxed app (and could not be distributed via the App Store) or use XPC service to outsource the use of `SourceKitten` to a different process. diff --git a/SourceEditorExtension/Info.plist b/SourceEditorExtension/Info.plist index 7413d0f..3a41935 100644 --- a/SourceEditorExtension/Info.plist +++ b/SourceEditorExtension/Info.plist @@ -15,11 +15,11 @@ CFBundleName SwiftPlantUML CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) + XPC! CFBundleShortVersionString - 1.0 + 1.1 CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSExtension diff --git a/SwiftPlantUMLApp.xcodeproj/project.pbxproj b/SwiftPlantUMLApp.xcodeproj/project.pbxproj index 801aabe..2afb208 100644 --- a/SwiftPlantUMLApp.xcodeproj/project.pbxproj +++ b/SwiftPlantUMLApp.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 8A319170261911B900540446 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A31916F261911B900540446 /* AppDelegate.swift */; }; + 8A3191742619123F00540446 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A3191732619123F00540446 /* ViewController.swift */; }; + 8A3191792619124B00540446 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8A3191772619124B00540446 /* Main.storyboard */; }; 8A73D8CC25CAE974008DDEA3 /* SwiftPlantUMLAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A73D8CB25CAE974008DDEA3 /* SwiftPlantUMLAppApp.swift */; }; 8A73D8CE25CAE974008DDEA3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A73D8CD25CAE974008DDEA3 /* ContentView.swift */; }; 8A73D8D025CAE978008DDEA3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8A73D8CF25CAE978008DDEA3 /* Assets.xcassets */; }; @@ -97,6 +100,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8A31916F261911B900540446 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8A3191732619123F00540446 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8A3191782619124B00540446 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 8A73D8C825CAE974008DDEA3 /* SwiftPlantUMLApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftPlantUMLApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8A73D8CB25CAE974008DDEA3 /* SwiftPlantUMLAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftPlantUMLAppApp.swift; sourceTree = ""; }; 8A73D8CD25CAE974008DDEA3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -170,6 +176,9 @@ 8A73D8CA25CAE974008DDEA3 /* SwiftPlantUMLApp */ = { isa = PBXGroup; children = ( + 8A31916F261911B900540446 /* AppDelegate.swift */, + 8A3191732619123F00540446 /* ViewController.swift */, + 8A3191772619124B00540446 /* Main.storyboard */, 8A73D8CB25CAE974008DDEA3 /* SwiftPlantUMLAppApp.swift */, 8A73D8CD25CAE974008DDEA3 /* ContentView.swift */, 8A73D8CF25CAE978008DDEA3 /* Assets.xcassets */, @@ -332,6 +341,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8A3191792619124B00540446 /* Main.storyboard in Resources */, 8A73D8D325CAE978008DDEA3 /* Preview Assets.xcassets in Resources */, 8A73D8D025CAE978008DDEA3 /* Assets.xcassets in Resources */, ); @@ -358,7 +368,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8A319170261911B900540446 /* AppDelegate.swift in Sources */, 8A73D8CE25CAE974008DDEA3 /* ContentView.swift in Sources */, + 8A3191742619123F00540446 /* ViewController.swift in Sources */, 8A73D8CC25CAE974008DDEA3 /* SwiftPlantUMLAppApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -403,6 +415,17 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 8A3191772619124B00540446 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8A3191782619124B00540446 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 8A73D8D625CAE978008DDEA3 /* Debug */ = { isa = XCBuildConfiguration; @@ -455,7 +478,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 11.1; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -510,7 +533,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 11.1; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; @@ -526,10 +549,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = SwiftPlantUMLApp/SwiftPlantUMLApp.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"SwiftPlantUMLApp/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = SwiftPlantUMLApp/Info.plist; @@ -537,7 +562,8 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MARKETING_VERSION = 1.1; PRODUCT_BUNDLE_IDENTIFIER = us.eidinger.SwiftPlantUML; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -551,10 +577,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = SwiftPlantUMLApp/SwiftPlantUMLApp.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"SwiftPlantUMLApp/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = SwiftPlantUMLApp/Info.plist; @@ -562,7 +590,8 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MARKETING_VERSION = 1.1; PRODUCT_BUNDLE_IDENTIFIER = us.eidinger.SwiftPlantUML; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -575,7 +604,8 @@ CODE_SIGN_ENTITLEMENTS = SourceEditorExtension/SourceEditorExtension.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = SourceEditorExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -596,7 +626,8 @@ CODE_SIGN_ENTITLEMENTS = SourceEditorExtension/SourceEditorExtension.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = SourceEditorExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -615,9 +646,11 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = XPCService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -637,9 +670,11 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = 6V66CC3AN6; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = XPCService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -701,7 +736,7 @@ repositoryURL = "https://github.com/MarcoEidinger/SwiftPlantUML"; requirement = { kind = upToNextMinorVersion; - minimumVersion = 0.2.0; + minimumVersion = 0.4.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/SwiftPlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SwiftPlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index f62b3d1..18c08a2 100644 --- a/SwiftPlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/SwiftPlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/MarcoEidinger/SwiftPlantUML", "state": { "branch": null, - "revision": "d5e14cb280d553f10228cdfcb07d3e640f636dc7", - "version": "0.2.0" + "revision": "4cda284fa7f7ee914e6d0552f72f0b60cf980f5f", + "version": "0.4.0" } }, { diff --git a/SwiftPlantUMLApp/AppDelegate.swift b/SwiftPlantUMLApp/AppDelegate.swift new file mode 100644 index 0000000..1700800 --- /dev/null +++ b/SwiftPlantUMLApp/AppDelegate.swift @@ -0,0 +1,12 @@ +import Cocoa + +@main +class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_: Notification) { + // Insert code here to tear down your application + } +} diff --git a/SwiftPlantUMLApp/Base.lproj/Main.storyboard b/SwiftPlantUMLApp/Base.lproj/Main.storyboard new file mode 100644 index 0000000..37772d4 --- /dev/null +++ b/SwiftPlantUMLApp/Base.lproj/Main.storyboard @@ -0,0 +1,719 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftPlantUMLApp/Info.plist b/SwiftPlantUMLApp/Info.plist index 662915c..b41a180 100644 --- a/SwiftPlantUMLApp/Info.plist +++ b/SwiftPlantUMLApp/Info.plist @@ -15,14 +15,18 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + 1.1 CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2021 Marco Eidinger. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication diff --git a/SwiftPlantUMLApp/SwiftPlantUMLAppApp.swift b/SwiftPlantUMLApp/SwiftPlantUMLAppApp.swift index cb95b43..b9e8867 100644 --- a/SwiftPlantUMLApp/SwiftPlantUMLAppApp.swift +++ b/SwiftPlantUMLApp/SwiftPlantUMLAppApp.swift @@ -1,7 +1,7 @@ import SwiftUI -@main struct SwiftPlantUMLAppApp: App { + @available(OSX 11.0, *) var body: some Scene { WindowGroup { ContentView() diff --git a/SwiftPlantUMLApp/ViewController.swift b/SwiftPlantUMLApp/ViewController.swift new file mode 100644 index 0000000..33b0171 --- /dev/null +++ b/SwiftPlantUMLApp/ViewController.swift @@ -0,0 +1,21 @@ +import Cocoa +import SwiftUI + +class ViewController: NSViewController { + override func viewDidLoad() { + super.viewDidLoad() + + let swiftUIView = NSHostingView(rootView: ContentView()) + swiftUIView.translatesAutoresizingMaskIntoConstraints = false + + view.addSubview(swiftUIView) + swiftUIView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true + swiftUIView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true + } + + override var representedObject: Any? { + didSet { + // Update the view, if already loaded. + } + } +} diff --git a/XPCService/Info.plist b/XPCService/Info.plist index ed3474b..89ec982 100644 --- a/XPCService/Info.plist +++ b/XPCService/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + 1.1 CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright Copyright © 2021 Marco Eidinger. All rights reserved. XPCService