From 75d189f8d2601d191075e0b0dbcbfda11beb5138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Mon, 11 Nov 2019 13:00:52 +0100 Subject: [PATCH 01/20] create modulemap for umbrella module update modulemap minor changes minor changes modulemap support and upgrade SPM to support it --- Package.swift | 24 +- project/{UI => }/Common/Array+Slice.swift | 0 project/{UI => }/Common/ConsoleReader.swift | 0 project/{UI => }/Common/PlaygroundUtils.swift | 0 project/{UI => }/Common/String+Path.swift | 0 .../{UI => }/Common/Support Files/Info.plist | 0 .../Support Files/NefCommon.h} | 0 .../NefCarbon/App/CarbonAppDelegate.swift | 2 +- .../NefCarbon/App/CarbonApplication.swift | 2 +- .../NefCarbon/App/CarbonAssembler.swift | 2 +- .../NefCarbon/App/CarbonSyncDownloader.swift | 2 +- project/Component/NefCarbon/Carbon.swift | 2 +- .../NefCarbon/Support Files/NefCarbon.h | 2 - project/Component/NefJekyll/Jekyll.swift | 2 +- project/Component/NefMarkdown/Markdown.swift | 2 +- .../NefModels/Support Files/NefModels.h | 1 - project/Component/module.modulemap | 23 ++ project/Component/nef/Support Files/Carbon.h | 12 + project/Component/nef/Support Files/Common.h | 12 + project/Component/nef/Support Files/Core.h | 12 + project/Component/nef/Support Files/Jekyll.h | 12 + .../Component/nef/Support Files/Markdown.h | 12 + project/Component/nef/Support Files/nef.h | 1 + .../Core/Support Files/{Core.h => NefCore.h} | 0 project/Tests/CoreTests/JekyllTests.swift | 12 +- project/Tests/CoreTests/MarkdownTests.swift | 12 +- project/Tests/CoreTests/SyntaxTests.swift | 38 +-- project/UI/Carbon/ConsoleOutput.swift | 2 +- project/UI/Carbon/main.swift | 4 +- project/UI/Jekyll/ConsoleOutput.swift | 2 +- project/UI/Jekyll/main.swift | 4 +- project/UI/Markdown/ConsoleOutput.swift | 2 +- project/UI/Markdown/main.swift | 4 +- project/nef.xcodeproj/project.pbxproj | 299 ++++++------------ .../contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/Core.xcscheme | 106 ------- .../xcshareddata/xcschemes/CoreTests.xcscheme | 52 +++ .../{Common.xcscheme => NefCore.xcscheme} | 27 +- .../xcshareddata/xcschemes/nef.xcscheme | 8 +- 39 files changed, 306 insertions(+), 393 deletions(-) rename project/{UI => }/Common/Array+Slice.swift (100%) rename project/{UI => }/Common/ConsoleReader.swift (100%) rename project/{UI => }/Common/PlaygroundUtils.swift (100%) rename project/{UI => }/Common/String+Path.swift (100%) rename project/{UI => }/Common/Support Files/Info.plist (100%) rename project/{UI/Common/Support Files/Common.h => Common/Support Files/NefCommon.h} (100%) create mode 100644 project/Component/module.modulemap create mode 100644 project/Component/nef/Support Files/Carbon.h create mode 100644 project/Component/nef/Support Files/Common.h create mode 100644 project/Component/nef/Support Files/Core.h create mode 100644 project/Component/nef/Support Files/Jekyll.h create mode 100644 project/Component/nef/Support Files/Markdown.h rename project/Core/Support Files/{Core.h => NefCore.h} (100%) delete mode 100644 project/nef.xcodeproj/xcshareddata/xcschemes/Core.xcscheme create mode 100644 project/nef.xcodeproj/xcshareddata/xcschemes/CoreTests.xcscheme rename project/nef.xcodeproj/xcshareddata/xcschemes/{Common.xcscheme => NefCore.xcscheme} (71%) diff --git a/Package.swift b/Package.swift index 3aa549cc..8b154f57 100644 --- a/Package.swift +++ b/Package.swift @@ -1,27 +1,27 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.1 import PackageDescription let package = Package( name: "nef", platforms: [ - .macOS(.v10_13), + .macOS(.v10_14), ], products: [ .library(name: "nef", targets: ["nef"]), ], targets: [ - .testTarget(name: "CoreTests", dependencies: ["Core"], path: "project/Tests/CoreTests"), - .target(name: "Core", dependencies: ["NefModels"], path: "project/Core"), + .testTarget(name: "CoreTests", dependencies: ["NefCore"], path: "project/Tests/CoreTests"), + .target(name: "NefCommon", path: "project/Common", publicHeadersPath: "project/Common"), + .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "project/Core"), .target(name: "NefModels", path: "project/Component/NefModels"), - .target(name: "NefCarbon", dependencies: ["Core"], path: "project/Component/NefCarbon"), - .target(name: "NefJekyll", dependencies: ["Core"], path: "project/Component/NefJekyll"), - .target(name: "NefMarkdown", dependencies: ["Core"], path: "project/Component/NefMarkdown"), - .target(name: "nef", dependencies: ["NefMarkdown", "NefJekyll", "NefCarbon", "NefModels"], path: "project/Component/nef"), + .target(name: "NefCarbon", dependencies: ["NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "project/Component/NefCarbon"), + .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "project/Component/NefJekyll"), + .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "project/Component/NefMarkdown"), + .target(name: "nef", dependencies: ["NefMarkdown", "NefJekyll", "NefCarbon", "NefModels"], path: "project/Component/nef", publicHeadersPath: "project"), - .target(name: "Common", path: "project/UI/Common"), - .target(name: "Markdown", dependencies: ["Core", "Common", "NefMarkdown"], path: "project/UI/Markdown"), - .target(name: "Jekyll", dependencies: ["Core", "Common", "NefJekyll"], path: "project/UI/Jekyll"), - .target(name: "Carbon", dependencies: ["Core", "Common", "NefCarbon"], path: "project/UI/Carbon"), + .target(name: "Markdown", dependencies: ["NefCore", "NefCommon", "NefMarkdown"], path: "project/UI/Markdown"), + .target(name: "Jekyll", dependencies: ["NefCore", "NefCommon", "NefJekyll"], path: "project/UI/Jekyll"), + .target(name: "Carbon", dependencies: ["NefCore", "NefCommon", "NefCarbon"], path: "project/UI/Carbon"), ] ) diff --git a/project/UI/Common/Array+Slice.swift b/project/Common/Array+Slice.swift similarity index 100% rename from project/UI/Common/Array+Slice.swift rename to project/Common/Array+Slice.swift diff --git a/project/UI/Common/ConsoleReader.swift b/project/Common/ConsoleReader.swift similarity index 100% rename from project/UI/Common/ConsoleReader.swift rename to project/Common/ConsoleReader.swift diff --git a/project/UI/Common/PlaygroundUtils.swift b/project/Common/PlaygroundUtils.swift similarity index 100% rename from project/UI/Common/PlaygroundUtils.swift rename to project/Common/PlaygroundUtils.swift diff --git a/project/UI/Common/String+Path.swift b/project/Common/String+Path.swift similarity index 100% rename from project/UI/Common/String+Path.swift rename to project/Common/String+Path.swift diff --git a/project/UI/Common/Support Files/Info.plist b/project/Common/Support Files/Info.plist similarity index 100% rename from project/UI/Common/Support Files/Info.plist rename to project/Common/Support Files/Info.plist diff --git a/project/UI/Common/Support Files/Common.h b/project/Common/Support Files/NefCommon.h similarity index 100% rename from project/UI/Common/Support Files/Common.h rename to project/Common/Support Files/NefCommon.h diff --git a/project/Component/NefCarbon/App/CarbonAppDelegate.swift b/project/Component/NefCarbon/App/CarbonAppDelegate.swift index 454a0ae7..3c1bae3c 100644 --- a/project/Component/NefCarbon/App/CarbonAppDelegate.swift +++ b/project/Component/NefCarbon/App/CarbonAppDelegate.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit -import Core +import NefCore class CarbonAppDelegate: NSObject, NSApplicationDelegate { private let main: (CarbonDownloader) -> Void diff --git a/project/Component/NefCarbon/App/CarbonApplication.swift b/project/Component/NefCarbon/App/CarbonApplication.swift index 6ec62c67..a03d828e 100644 --- a/project/Component/NefCarbon/App/CarbonApplication.swift +++ b/project/Component/NefCarbon/App/CarbonApplication.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit -import Core +import NefCore public class CarbonApplication { private static let app = NSApplication.shared diff --git a/project/Component/NefCarbon/App/CarbonAssembler.swift b/project/Component/NefCarbon/App/CarbonAssembler.swift index 21f79648..328ae8e8 100644 --- a/project/Component/NefCarbon/App/CarbonAssembler.swift +++ b/project/Component/NefCarbon/App/CarbonAssembler.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit -import Core +import NefCore public class CarbonAssembler: CarbonProvider, CarbonAppDelegateAssembler { public init() {} diff --git a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift index 35a7fb3f..e8bf70ec 100644 --- a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift +++ b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Core +import NefCore import NefModels class CarbonSyncDownloader: CarbonDownloader, CarbonViewDelegate { diff --git a/project/Component/NefCarbon/Carbon.swift b/project/Component/NefCarbon/Carbon.swift index f4715bd3..e8ca09d2 100644 --- a/project/Component/NefCarbon/Carbon.swift +++ b/project/Component/NefCarbon/Carbon.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Core +import NefCore import NefModels /// Renders a page into multiple Carbon images. diff --git a/project/Component/NefCarbon/Support Files/NefCarbon.h b/project/Component/NefCarbon/Support Files/NefCarbon.h index 081490f0..0617d1a0 100644 --- a/project/Component/NefCarbon/Support Files/NefCarbon.h +++ b/project/Component/NefCarbon/Support Files/NefCarbon.h @@ -9,5 +9,3 @@ FOUNDATION_EXPORT double NefCarbonVersionNumber; FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/project/Component/NefJekyll/Jekyll.swift b/project/Component/NefJekyll/Jekyll.swift index ee694370..094d4dc4 100644 --- a/project/Component/NefJekyll/Jekyll.swift +++ b/project/Component/NefJekyll/Jekyll.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Core +import NefCore /// Renders a page into Jekyll format. /// diff --git a/project/Component/NefMarkdown/Markdown.swift b/project/Component/NefMarkdown/Markdown.swift index 03e4df58..c29559e1 100644 --- a/project/Component/NefMarkdown/Markdown.swift +++ b/project/Component/NefMarkdown/Markdown.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Core +import NefCore /// Renders a page into Markdown format. /// diff --git a/project/Component/NefModels/Support Files/NefModels.h b/project/Component/NefModels/Support Files/NefModels.h index d15baac4..c3eee839 100644 --- a/project/Component/NefModels/Support Files/NefModels.h +++ b/project/Component/NefModels/Support Files/NefModels.h @@ -10,4 +10,3 @@ FOUNDATION_EXPORT const unsigned char NefModelsVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - diff --git a/project/Component/module.modulemap b/project/Component/module.modulemap new file mode 100644 index 00000000..4125d6ad --- /dev/null +++ b/project/Component/module.modulemap @@ -0,0 +1,23 @@ +framework module nef { + header "nef.h" + + explicit module Core { + header "Core.h" + header "Common.h" + } + + explicit module Markdown { + header "Markdown.h" + export Core + } + + explicit module Jekyll { + header "Jekyll.h" + export Core + } + + explicit module Carbon { + header "Carbon.h" + export Core + } +} diff --git a/project/Component/nef/Support Files/Carbon.h b/project/Component/nef/Support Files/Carbon.h new file mode 100644 index 00000000..1334c615 --- /dev/null +++ b/project/Component/nef/Support Files/Carbon.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefCarbon. +FOUNDATION_EXPORT double NefCarbonVersionNumber; + +//! Project version string for NefCarbon. +FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefCarbon.h" diff --git a/project/Component/nef/Support Files/Common.h b/project/Component/nef/Support Files/Common.h new file mode 100644 index 00000000..585c3782 --- /dev/null +++ b/project/Component/nef/Support Files/Common.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for Common. +FOUNDATION_EXPORT double CommonVersionNumber; + +//! Project version string for Common. +FOUNDATION_EXPORT const unsigned char CommonVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefCommon.h" diff --git a/project/Component/nef/Support Files/Core.h b/project/Component/nef/Support Files/Core.h new file mode 100644 index 00000000..42cc83c0 --- /dev/null +++ b/project/Component/nef/Support Files/Core.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for Markup. +FOUNDATION_EXPORT double MarkupVersionNumber; + +//! Project version string for Markup. +FOUNDATION_EXPORT const unsigned char MarkupVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefCore.h" diff --git a/project/Component/nef/Support Files/Jekyll.h b/project/Component/nef/Support Files/Jekyll.h new file mode 100644 index 00000000..c5d62add --- /dev/null +++ b/project/Component/nef/Support Files/Jekyll.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefJekyll. +FOUNDATION_EXPORT double NefJekyllVersionNumber; + +//! Project version string for NefJekyll. +FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefJekyll.h" diff --git a/project/Component/nef/Support Files/Markdown.h b/project/Component/nef/Support Files/Markdown.h new file mode 100644 index 00000000..c859e40d --- /dev/null +++ b/project/Component/nef/Support Files/Markdown.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefMarkdown. +FOUNDATION_EXPORT double NefMarkdownVersionNumber; + +//! Project version string for NefMarkdown. +FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefMarkdown.h" diff --git a/project/Component/nef/Support Files/nef.h b/project/Component/nef/Support Files/nef.h index 252fc43f..ff9a56ca 100644 --- a/project/Component/nef/Support Files/nef.h +++ b/project/Component/nef/Support Files/nef.h @@ -9,3 +9,4 @@ FOUNDATION_EXPORT double NefVersionNumber; FOUNDATION_EXPORT const unsigned char NefVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import +#import "NefModels.h" diff --git a/project/Core/Support Files/Core.h b/project/Core/Support Files/NefCore.h similarity index 100% rename from project/Core/Support Files/Core.h rename to project/Core/Support Files/NefCore.h diff --git a/project/Tests/CoreTests/JekyllTests.swift b/project/Tests/CoreTests/JekyllTests.swift index 4c4a046a..6879e079 100644 --- a/project/Tests/CoreTests/JekyllTests.swift +++ b/project/Tests/CoreTests/JekyllTests.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import XCTest -@testable import Core +@testable import NefCore class JekyllTests: XCTestCase { @@ -13,7 +13,7 @@ class JekyllTests: XCTestCase { """ let expected = "\n### This is a markup\n" - let result = Core.JekyllGenerator(permalink: "").render(content: input) + let result = NefCore.JekyllGenerator(permalink: "").render(content: input) XCTAssertEqual(result, expected) } @@ -30,7 +30,7 @@ class JekyllTests: XCTestCase { """ let expected = "\n### This is a Title with spaces\n text with spaces.\n\n## Title without spaces\n# Title with one space.\n" - let result = Core.JekyllGenerator(permalink: "").render(content: input) + let result = NefCore.JekyllGenerator(permalink: "").render(content: input) XCTAssertEqual(result, expected) } @@ -41,7 +41,7 @@ class JekyllTests: XCTestCase { """ let expected = "\n```swift\n\(input)```\n" - let result = Core.JekyllGenerator(permalink: "").render(content: input) + let result = NefCore.JekyllGenerator(permalink: "").render(content: input) XCTAssertEqual(result, expected) } @@ -67,7 +67,7 @@ class JekyllTests: XCTestCase { """ - let result = Core.JekyllGenerator(permalink: "permalink").render(content: input) + let result = NefCore.JekyllGenerator(permalink: "permalink").render(content: input) XCTAssertEqual(result, expected) } @@ -93,7 +93,7 @@ class JekyllTests: XCTestCase { """ - let result = Core.JekyllGenerator(permalink: "permalink").render(content: input) + let result = NefCore.JekyllGenerator(permalink: "permalink").render(content: input) XCTAssertEqual(result, expected) } diff --git a/project/Tests/CoreTests/MarkdownTests.swift b/project/Tests/CoreTests/MarkdownTests.swift index 50ddf701..dc049cf7 100644 --- a/project/Tests/CoreTests/MarkdownTests.swift +++ b/project/Tests/CoreTests/MarkdownTests.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import XCTest -@testable import Core +@testable import NefCore class MarkdownTests: XCTestCase { @@ -13,7 +13,7 @@ class MarkdownTests: XCTestCase { """ let expected = "\n### This is a markup\n" - let result = Core.MarkdownGenerator().render(content: input) + let result = NefCore.MarkdownGenerator().render(content: input) XCTAssertEqual(result, expected) } @@ -30,7 +30,7 @@ class MarkdownTests: XCTestCase { """ let expected = "\n### This is a Title with spaces\n text with spaces.\n\n## Title without spaces\n# Title with one space.\n" - let result = Core.MarkdownGenerator().render(content: input) + let result = NefCore.MarkdownGenerator().render(content: input) XCTAssertEqual(result, expected) } @@ -41,7 +41,7 @@ class MarkdownTests: XCTestCase { """ let expected = "\n```swift\n\(input)```\n" - let result = Core.MarkdownGenerator().render(content: input) + let result = NefCore.MarkdownGenerator().render(content: input) XCTAssertEqual(result, expected) } @@ -59,7 +59,7 @@ class MarkdownTests: XCTestCase { """ let expected = "" - let result = Core.MarkdownGenerator().render(content: input) + let result = NefCore.MarkdownGenerator().render(content: input) XCTAssertEqual(result, expected) } @@ -77,7 +77,7 @@ class MarkdownTests: XCTestCase { """ let expected = "\n```swift\n\(code)\n```\n" - let result = Core.MarkdownGenerator().render(content: input) + let result = NefCore.MarkdownGenerator().render(content: input) XCTAssertEqual(result, expected) } diff --git a/project/Tests/CoreTests/SyntaxTests.swift b/project/Tests/CoreTests/SyntaxTests.swift index 06fe4595..26c7a0cc 100644 --- a/project/Tests/CoreTests/SyntaxTests.swift +++ b/project/Tests/CoreTests/SyntaxTests.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import XCTest -@testable import Core +@testable import NefCore class SyntaxTests: XCTestCase { @@ -9,7 +9,7 @@ class SyntaxTests: XCTestCase { let input = "import Bow // testing\n" let expected: [Node] = [.block([.code("import Bow // testing\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -18,7 +18,7 @@ class SyntaxTests: XCTestCase { let input = "// import Bow // testing\n" let expected: [Node] = [.block([.comment("// import Bow // testing\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -32,7 +32,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.block([.comment(input)])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -41,7 +41,7 @@ class SyntaxTests: XCTestCase { let input = "//: This is a test\n" let expected: [Node] = [.markup(description: nil, "This is a test\n")] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -55,7 +55,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.markup(description: .some(""), "This is a test\n")] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -69,7 +69,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.markup(description: .some("information"), "This is a test\n")] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -89,7 +89,7 @@ class SyntaxTests: XCTestCase { let expected: [Node] = [.nef(command: .hidden, [.raw("This is a hidden markup\n")]), .markup(description: .some(""), "This is a visible markup multiline\n")] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -105,7 +105,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.markup(description: .some(""), "This is a visible 👀 markup multiline ©\n")] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -121,7 +121,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.block([.comment("/*\nThis is a visible comment multiline\n */\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -142,7 +142,7 @@ class SyntaxTests: XCTestCase { ]) ] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -158,7 +158,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.nef(command: .hidden, [.raw("This is a raw comment\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -174,7 +174,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.nef(command: .hidden, [.raw("This is a raw markup\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -189,7 +189,7 @@ class SyntaxTests: XCTestCase { """ - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, []) } @@ -205,7 +205,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -226,7 +226,7 @@ class SyntaxTests: XCTestCase { .code("public func add(_ a: Int, _ b: Int) -> Bool {\n return a + b\n}\n") ]) ] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } @@ -243,8 +243,8 @@ class SyntaxTests: XCTestCase { """ let input = "\n\n\n\n\n\(blockCode)\n\n" - let result = Core.SyntaxAnalyzer.parse(content: input) - let resultWithoutLeadingTrailingEmptyLines = Core.SyntaxAnalyzer.parse(content: blockCode) + let result = NefCore.SyntaxAnalyzer.parse(content: input) + let resultWithoutLeadingTrailingEmptyLines = NefCore.SyntaxAnalyzer.parse(content: blockCode) XCTAssertEqual(result, resultWithoutLeadingTrailingEmptyLines) } @@ -257,7 +257,7 @@ class SyntaxTests: XCTestCase { """ let expected: [Node] = [.nef(command: .invalid, [.raw("This is a nef block\n")])] - let result = Core.SyntaxAnalyzer.parse(content: input) + let result = NefCore.SyntaxAnalyzer.parse(content: input) XCTAssertEqual(result, expected) } diff --git a/project/UI/Carbon/ConsoleOutput.swift b/project/UI/Carbon/ConsoleOutput.swift index 69fded1b..c236f57f 100644 --- a/project/UI/Carbon/ConsoleOutput.swift +++ b/project/UI/Carbon/ConsoleOutput.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import NefCommon public class CarbonOutput: ConsoleOutput { diff --git a/project/UI/Carbon/main.swift b/project/UI/Carbon/main.swift index 87b84957..e7b51f2b 100644 --- a/project/UI/Carbon/main.swift +++ b/project/UI/Carbon/main.swift @@ -1,8 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common -import Core +import NefCommon +import NefCore import NefModels import NefCarbon diff --git a/project/UI/Jekyll/ConsoleOutput.swift b/project/UI/Jekyll/ConsoleOutput.swift index 58cc3f0e..befbbc5b 100644 --- a/project/UI/Jekyll/ConsoleOutput.swift +++ b/project/UI/Jekyll/ConsoleOutput.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import NefCommon class JekyllConsole: ConsoleOutput { diff --git a/project/UI/Jekyll/main.swift b/project/UI/Jekyll/main.swift index 5a5af018..537c92d6 100644 --- a/project/UI/Jekyll/main.swift +++ b/project/UI/Jekyll/main.swift @@ -1,8 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common -import Core +import NefCommon +import NefCore import NefJekyll let scriptName = "nef-jekyll-page" diff --git a/project/UI/Markdown/ConsoleOutput.swift b/project/UI/Markdown/ConsoleOutput.swift index 2c84f88b..ad5302f8 100644 --- a/project/UI/Markdown/ConsoleOutput.swift +++ b/project/UI/Markdown/ConsoleOutput.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import NefCommon class MarkdownConsole: ConsoleOutput { diff --git a/project/UI/Markdown/main.swift b/project/UI/Markdown/main.swift index 0ef72ad1..51c9324c 100644 --- a/project/UI/Markdown/main.swift +++ b/project/UI/Markdown/main.swift @@ -1,8 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common -import Core +import NefCommon +import NefCore import NefMarkdown let scriptName = "nef-markdown-page" diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index d71801e5..5ae53749 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -9,21 +9,20 @@ /* Begin PBXBuildFile section */ 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* Jekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* Jekyll.swift */; }; - 8B12D7B822D63EAD00D05A70 /* Common.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* Common.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8B12D7B922D63EAD00D05A70 /* Core.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* Core.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 8B12D7B822D63EAD00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 8B12D7B922D63EAD00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 8B12D7BA22D63EAD00D05A70 /* NefMarkdown.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B22248322D5EAD500C85856 /* NefMarkdown.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 8B12D7BB22D6404300D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BC22D645AA00D05A70 /* Common.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* Common.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BD22D645AE00D05A70 /* Core.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* Core.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 8B12D7BC22D645AA00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 8B12D7BD22D645AE00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B12D7BE22D645B300D05A70 /* NefJekyll.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B12D79B22D6235200D05A70 /* NefJekyll.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B12D7BF22D645B700D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C022D645EE00D05A70 /* Common.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* Common.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 8B12D7C022D645EE00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B12D7C122D645EE00D05A70 /* NefCarbon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C222D645EE00D05A70 /* Core.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* Core.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 8B12D7C222D645EE00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B12D7C322D645EE00D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; 8B22247C22D4C91B00C85856 /* NSImage+Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86422D392C000919F36 /* NSImage+Store.swift */; }; - 8B22249322D5EAD600C85856 /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B22249D22D5EC6B00C85856 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85B22D392C000919F36 /* Markdown.swift */; }; 8B3CB87F22D3931D00919F36 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85622D392C000919F36 /* ConsoleOutput.swift */; }; 8B3CB88022D3931D00919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85722D392C000919F36 /* main.swift */; }; @@ -42,7 +41,7 @@ 8B3CB8A722D393F100919F36 /* Syntax.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89E22D393C300919F36 /* Syntax.swift */; }; 8B3CB8A822D393F100919F36 /* MarkupNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89F22D393C300919F36 /* MarkupNode.swift */; }; 8B3CB8A922D393F100919F36 /* Lexical.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8A022D393C300919F36 /* Lexical.swift */; }; - 8B3CB8AA22D393F100919F36 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB89922D393C300919F36 /* Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B3CB8AA22D393F100919F36 /* NefCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB89922D393C300919F36 /* NefCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8B222D394E600919F36 /* SyntaxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8AD22D394E600919F36 /* SyntaxTests.swift */; }; 8B3CB8B322D394E600919F36 /* JekyllTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8AE22D394E600919F36 /* JekyllTests.swift */; }; 8B3CB8B522D394E600919F36 /* MarkdownTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8B122D394E600919F36 /* MarkdownTests.swift */; }; @@ -58,10 +57,16 @@ 8B3CB8C022D3963B00919F36 /* CarbonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84222D3929B00919F36 /* CarbonModel.swift */; }; 8B3CB8C122D3963B00919F36 /* NefModels.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84022D3929B00919F36 /* NefModels.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C222D3964000919F36 /* nef.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* nef.swift */; }; - 8B3CB8C322D3964000919F36 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB83C22D3929B00919F36 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B3CB8C622D396E300919F36 /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB86122D392C000919F36 /* Common.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B3CB8C622D396E300919F36 /* NefCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB86122D392C000919F36 /* NefCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; - 8B6B119D22CB9FDE0060177F /* Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* Core.framework */; }; + 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; + 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B9955192379A24F00C81A2A /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB83C22D3929B00919F36 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B9955542379BE4600C81A2A /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955522379BE4200C81A2A /* Carbon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B9955552379BE4600C81A2A /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B99554F2379BE4200C81A2A /* Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B9955562379BE4700C81A2A /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955502379BE4200C81A2A /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B9955572379BE4700C81A2A /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955532379BE4200C81A2A /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B9955582379BE4700C81A2A /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955512379BE4200C81A2A /* Markdown.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8BCDC72022F0455D00174A19 /* CarbonViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */; }; 8BF53F56235F09780081C27C /* nef+helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BF53F55235F09770081C27C /* nef+helpers.swift */; }; /* End PBXBuildFile section */ @@ -116,6 +121,13 @@ remoteGlobalIDString = 8B22248222D5EAD500C85856; remoteInfo = NefMarkdown; }; + 8B27832A237979870052189A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8B4F45A422CF9AF400E6F471; + remoteInfo = NefModels; + }; 8B4F45BC22CF9B4F00E6F471 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -223,9 +235,9 @@ dstPath = nef/frameworks/carbon; dstSubfolderSpec = 16; files = ( - 8B12D7C022D645EE00D05A70 /* Common.framework in CopyFiles */, + 8B12D7C022D645EE00D05A70 /* NefCommon.framework in CopyFiles */, 8B12D7C122D645EE00D05A70 /* NefCarbon.framework in CopyFiles */, - 8B12D7C222D645EE00D05A70 /* Core.framework in CopyFiles */, + 8B12D7C222D645EE00D05A70 /* NefCore.framework in CopyFiles */, 8B12D7C322D645EE00D05A70 /* NefModels.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -237,8 +249,8 @@ dstSubfolderSpec = 16; files = ( 8B12D7BB22D6404300D05A70 /* NefModels.framework in CopyFiles */, - 8B12D7B822D63EAD00D05A70 /* Common.framework in CopyFiles */, - 8B12D7B922D63EAD00D05A70 /* Core.framework in CopyFiles */, + 8B12D7B822D63EAD00D05A70 /* NefCommon.framework in CopyFiles */, + 8B12D7B922D63EAD00D05A70 /* NefCore.framework in CopyFiles */, 8B12D7BA22D63EAD00D05A70 /* NefMarkdown.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -251,8 +263,8 @@ files = ( 8B12D7BF22D645B700D05A70 /* NefModels.framework in CopyFiles */, 8B12D7BE22D645B300D05A70 /* NefJekyll.framework in CopyFiles */, - 8B12D7BD22D645AE00D05A70 /* Core.framework in CopyFiles */, - 8B12D7BC22D645AA00D05A70 /* Common.framework in CopyFiles */, + 8B12D7BD22D645AE00D05A70 /* NefCore.framework in CopyFiles */, + 8B12D7BC22D645AA00D05A70 /* NefCommon.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -291,7 +303,7 @@ 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleOutput.swift; sourceTree = ""; }; 8B3CB85D22D392C000919F36 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 8B3CB85F22D392C000919F36 /* String+Path.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Path.swift"; sourceTree = ""; }; - 8B3CB86122D392C000919F36 /* Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; + 8B3CB86122D392C000919F36 /* NefCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefCommon.h; sourceTree = ""; }; 8B3CB86222D392C000919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB86322D392C000919F36 /* ConsoleReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleReader.swift; sourceTree = ""; }; 8B3CB86422D392C000919F36 /* NSImage+Store.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Store.swift"; sourceTree = ""; }; @@ -301,7 +313,7 @@ 8B3CB89422D393C300919F36 /* Markdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Markdown.swift; sourceTree = ""; }; 8B3CB89522D393C300919F36 /* Node+Render.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Node+Render.swift"; sourceTree = ""; }; 8B3CB89622D393C300919F36 /* Jekyll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Jekyll.swift; sourceTree = ""; }; - 8B3CB89922D393C300919F36 /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; + 8B3CB89922D393C300919F36 /* NefCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefCore.h; sourceTree = ""; }; 8B3CB89A22D393C300919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB89C22D393C300919F36 /* String+Format.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Format.swift"; sourceTree = ""; }; 8B3CB89E22D393C300919F36 /* Syntax.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Syntax.swift; sourceTree = ""; }; @@ -314,13 +326,19 @@ 8B3CB8C722D3987500919F36 /* Carbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; 8B424B1F224E28FC00AF9010 /* Markdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Markdown; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B6B119422CB9FDE0060177F /* Core.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Core.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* Jekyll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Jekyll; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B99554F2379BE4200C81A2A /* Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; + 8B9955502379BE4200C81A2A /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; + 8B9955512379BE4200C81A2A /* Markdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; + 8B9955522379BE4200C81A2A /* Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; + 8B9955532379BE4200C81A2A /* Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; + 8B99555A2379C62300C81A2A /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Component/module.modulemap; sourceTree = SOURCE_ROOT; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF53F55235F09770081C27C /* nef+helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "nef+helpers.swift"; sourceTree = ""; }; - 8BF75F5722CA637B00EC53A1 /* Common.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Common.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCommon.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCarbon.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -333,20 +351,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8B12D79822D6235200D05A70 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B22248022D5EAD500C85856 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8B424B1C224E28FC00AF9010 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -354,25 +358,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8B4F45A222CF9AF400E6F471 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B6B119122CB9FDE0060177F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8B6B119922CB9FDE0060177F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8B6B119D22CB9FDE0060177F /* Core.framework in Frameworks */, + 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -383,27 +373,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8BF75F5422CA637B00EC53A1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8BF75F8222CA71E700EC53A1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8BF75FC322CA7DA500EC53A1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -469,6 +438,12 @@ isa = PBXGroup; children = ( 8B3CB83C22D3929B00919F36 /* nef.h */, + 8B9955512379BE4200C81A2A /* Markdown.h */, + 8B9955532379BE4200C81A2A /* Jekyll.h */, + 8B9955522379BE4200C81A2A /* Carbon.h */, + 8B9955502379BE4200C81A2A /* Core.h */, + 8B99554F2379BE4200C81A2A /* Common.h */, + 8B99555A2379C62300C81A2A /* module.modulemap */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -541,7 +516,6 @@ 8B3CB85A22D392C000919F36 /* Markdown */, 8B3CB85422D392C000919F36 /* Jekyll */, 8B3CB85822D392C000919F36 /* Carbon */, - 8B3CB85E22D392C000919F36 /* Common */, ); path = UI; sourceTree = ""; @@ -588,7 +562,7 @@ 8B3CB86022D392C000919F36 /* Support Files */ = { isa = PBXGroup; children = ( - 8B3CB86122D392C000919F36 /* Common.h */, + 8B3CB86122D392C000919F36 /* NefCommon.h */, 8B3CB86222D392C000919F36 /* Info.plist */, ); path = "Support Files"; @@ -619,7 +593,7 @@ 8B3CB89822D393C300919F36 /* Support Files */ = { isa = PBXGroup; children = ( - 8B3CB89922D393C300919F36 /* Core.h */, + 8B3CB89922D393C300919F36 /* NefCore.h */, 8B3CB89A22D393C300919F36 /* Info.plist */, ); path = "Support Files"; @@ -678,6 +652,7 @@ 8B3CB85322D392C000919F36 /* UI */, 8B3CB83822D3929B00919F36 /* Component */, 8B3CB88B22D393C300919F36 /* Core */, + 8B3CB85E22D392C000919F36 /* Common */, 8B3CB8AB22D394E600919F36 /* Tests */, 8B6FC656221EFF03008F7694 /* Frameworks */, 8B6FC586221ECE6A008F7694 /* Products */, @@ -690,10 +665,10 @@ 8B6FC585221ECE6A008F7694 /* Jekyll */, 8B424B1F224E28FC00AF9010 /* Markdown */, 8B0CA51622AE669600181BC0 /* Carbon */, - 8BF75F5722CA637B00EC53A1 /* Common.framework */, + 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */, 8BF75F8522CA71E700EC53A1 /* nef.framework */, 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */, - 8B6B119422CB9FDE0060177F /* Core.framework */, + 8B6B119422CB9FDE0060177F /* NefCore.framework */, 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */, 8B4F45A522CF9AF400E6F471 /* NefModels.framework */, 8B22248322D5EAD500C85856 /* NefMarkdown.framework */, @@ -724,7 +699,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8B22249322D5EAD600C85856 /* NefMarkdown.h in Headers */, + 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -740,7 +715,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8AA22D393F100919F36 /* Core.h in Headers */, + 8B3CB8AA22D393F100919F36 /* NefCore.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -748,7 +723,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8C622D396E300919F36 /* Common.h in Headers */, + 8B3CB8C622D396E300919F36 /* NefCommon.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -756,7 +731,12 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8C322D3964000919F36 /* nef.h in Headers */, + 8B9955572379BE4700C81A2A /* Jekyll.h in Headers */, + 8B9955192379A24F00C81A2A /* nef.h in Headers */, + 8B9955562379BE4700C81A2A /* Core.h in Headers */, + 8B9955552379BE4600C81A2A /* Common.h in Headers */, + 8B9955542379BE4600C81A2A /* Carbon.h in Headers */, + 8B9955582379BE4700C81A2A /* Markdown.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -797,14 +777,12 @@ buildPhases = ( 8B12D79622D6235200D05A70 /* Headers */, 8B12D79722D6235200D05A70 /* Sources */, - 8B12D79822D6235200D05A70 /* Frameworks */, - 8B12D79922D6235200D05A70 /* Resources */, ); buildRules = ( ); dependencies = ( - 8B12D7C522D6498900D05A70 /* PBXTargetDependency */, 8B12D7C722D6498900D05A70 /* PBXTargetDependency */, + 8B12D7C522D6498900D05A70 /* PBXTargetDependency */, ); name = NefJekyll; productName = NefJekyll; @@ -817,14 +795,12 @@ buildPhases = ( 8B22247E22D5EAD500C85856 /* Headers */, 8B22247F22D5EAD500C85856 /* Sources */, - 8B22248022D5EAD500C85856 /* Frameworks */, - 8B22248122D5EAD500C85856 /* Resources */, ); buildRules = ( ); dependencies = ( - 8B12D7C922D6498F00D05A70 /* PBXTargetDependency */, 8B12D7CB22D6498F00D05A70 /* PBXTargetDependency */, + 8B12D7C922D6498F00D05A70 /* PBXTargetDependency */, ); name = NefMarkdown; productName = NefMarkdown; @@ -857,8 +833,6 @@ buildPhases = ( 8B4F45A022CF9AF400E6F471 /* Headers */, 8B4F45A122CF9AF400E6F471 /* Sources */, - 8B4F45A222CF9AF400E6F471 /* Frameworks */, - 8B4F45A322CF9AF400E6F471 /* Resources */, ); buildRules = ( ); @@ -869,23 +843,21 @@ productReference = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; productType = "com.apple.product-type.framework"; }; - 8B6B119322CB9FDE0060177F /* Core */ = { + 8B6B119322CB9FDE0060177F /* NefCore */ = { isa = PBXNativeTarget; - buildConfigurationList = 8B6B11A522CB9FDE0060177F /* Build configuration list for PBXNativeTarget "Core" */; + buildConfigurationList = 8B6B11A522CB9FDE0060177F /* Build configuration list for PBXNativeTarget "NefCore" */; buildPhases = ( 8B6B118F22CB9FDE0060177F /* Headers */, 8B6B119022CB9FDE0060177F /* Sources */, - 8B6B119122CB9FDE0060177F /* Frameworks */, - 8B6B119222CB9FDE0060177F /* Resources */, ); buildRules = ( ); dependencies = ( 8B4F45BD22CF9B4F00E6F471 /* PBXTargetDependency */, ); - name = Core; + name = NefCore; productName = Markup; - productReference = 8B6B119422CB9FDE0060177F /* Core.framework */; + productReference = 8B6B119422CB9FDE0060177F /* NefCore.framework */; productType = "com.apple.product-type.framework"; }; 8B6B119B22CB9FDE0060177F /* CoreTests */ = { @@ -926,22 +898,20 @@ productReference = 8B6FC585221ECE6A008F7694 /* Jekyll */; productType = "com.apple.product-type.tool"; }; - 8BF75F5622CA637B00EC53A1 /* Common */ = { + 8BF75F5622CA637B00EC53A1 /* NefCommon */ = { isa = PBXNativeTarget; - buildConfigurationList = 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */; + buildConfigurationList = 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "NefCommon" */; buildPhases = ( 8BF75F5222CA637B00EC53A1 /* Headers */, 8BF75F5322CA637B00EC53A1 /* Sources */, - 8BF75F5422CA637B00EC53A1 /* Frameworks */, - 8BF75F5522CA637B00EC53A1 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = Common; + name = NefCommon; productName = Common; - productReference = 8BF75F5722CA637B00EC53A1 /* Common.framework */; + productReference = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; productType = "com.apple.product-type.framework"; }; 8BF75F8422CA71E700EC53A1 /* nef */ = { @@ -950,16 +920,15 @@ buildPhases = ( 8BF75F8022CA71E700EC53A1 /* Headers */, 8BF75F8122CA71E700EC53A1 /* Sources */, - 8BF75F8222CA71E700EC53A1 /* Frameworks */, - 8BF75F8322CA71E700EC53A1 /* Resources */, ); buildRules = ( ); dependencies = ( 8B6B11BD22CBA1770060177F /* PBXTargetDependency */, - 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, - 8B12D7A622D624D900D05A70 /* PBXTargetDependency */, + 8B27832B237979870052189A /* PBXTargetDependency */, 8B8AA94022D62266006BE290 /* PBXTargetDependency */, + 8B12D7A622D624D900D05A70 /* PBXTargetDependency */, + 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, ); name = nef; productName = Nef; @@ -972,8 +941,6 @@ buildPhases = ( 8BF75FC122CA7DA500EC53A1 /* Headers */, 8BF75FC222CA7DA500EC53A1 /* Sources */, - 8BF75FC322CA7DA500EC53A1 /* Frameworks */, - 8BF75FC422CA7DA500EC53A1 /* Resources */, ); buildRules = ( ); @@ -1050,47 +1017,19 @@ 8B424B1E224E28FC00AF9010 /* Markdown */, 8B6FC584221ECE6A008F7694 /* Jekyll */, 8B0CA51522AE669600181BC0 /* Carbon */, - 8BF75F5622CA637B00EC53A1 /* Common */, 8BF75F8422CA71E700EC53A1 /* nef */, 8B22248222D5EAD500C85856 /* NefMarkdown */, 8B12D79A22D6235200D05A70 /* NefJekyll */, 8BF75FC522CA7DA500EC53A1 /* NefCarbon */, 8B4F45A422CF9AF400E6F471 /* NefModels */, - 8B6B119322CB9FDE0060177F /* Core */, + 8B6B119322CB9FDE0060177F /* NefCore */, + 8BF75F5622CA637B00EC53A1 /* NefCommon */, 8B6B119B22CB9FDE0060177F /* CoreTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8B12D79922D6235200D05A70 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B22248122D5EAD500C85856 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B4F45A322CF9AF400E6F471 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B6B119222CB9FDE0060177F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8B6B119A22CB9FDE0060177F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1098,27 +1037,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8BF75F5522CA637B00EC53A1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8BF75F8322CA71E700EC53A1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8BF75FC422CA7DA500EC53A1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1251,22 +1169,22 @@ }; 8B12D7C522D6498900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B12D7C422D6498900D05A70 /* PBXContainerItemProxy */; }; 8B12D7C722D6498900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B12D7C622D6498900D05A70 /* PBXContainerItemProxy */; }; 8B12D7C922D6498F00D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B12D7C822D6498F00D05A70 /* PBXContainerItemProxy */; }; 8B12D7CB22D6498F00D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B12D7CA22D6498F00D05A70 /* PBXContainerItemProxy */; }; 8B22249C22D5EB2200C85856 /* PBXTargetDependency */ = { @@ -1274,6 +1192,11 @@ target = 8B22248222D5EAD500C85856 /* NefMarkdown */; targetProxy = 8B22249B22D5EB2200C85856 /* PBXContainerItemProxy */; }; + 8B27832B237979870052189A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8B4F45A422CF9AF400E6F471 /* NefModels */; + targetProxy = 8B27832A237979870052189A /* PBXContainerItemProxy */; + }; 8B4F45BD22CF9B4F00E6F471 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B4F45A422CF9AF400E6F471 /* NefModels */; @@ -1281,7 +1204,7 @@ }; 8B6B118822CB9E8F0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B6B118722CB9E8F0060177F /* PBXContainerItemProxy */; }; 8B6B118C22CB9EA20060177F /* PBXTargetDependency */ = { @@ -1291,17 +1214,17 @@ }; 8B6B119F22CB9FDE0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B119E22CB9FDE0060177F /* PBXContainerItemProxy */; }; 8B6B11BB22CBA1710060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11BA22CBA1710060177F /* PBXContainerItemProxy */; }; 8B6B11BD22CBA1770060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11BC22CBA1770060177F /* PBXContainerItemProxy */; }; 8B6B11BF22CBA1950060177F /* PBXTargetDependency */ = { @@ -1311,32 +1234,32 @@ }; 8B6B11C122CBA1AC0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B6B11C022CBA1AC0060177F /* PBXContainerItemProxy */; }; 8B6B11C322CBA1AC0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11C222CBA1AC0060177F /* PBXContainerItemProxy */; }; 8B6B11C522CBA1B90060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B6B11C422CBA1B90060177F /* PBXContainerItemProxy */; }; 8B6B11C722CBA1B90060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11C622CBA1B90060177F /* PBXContainerItemProxy */; }; 8B6B11C922CBA1BF0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; + target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; targetProxy = 8B6B11C822CBA1BF0060177F /* PBXContainerItemProxy */; }; 8B6B11CB22CBA1BF0060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* Core */; + target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11CA22CBA1BF0060177F /* PBXContainerItemProxy */; }; 8B8AA94022D62266006BE290 /* PBXTargetDependency */ = { @@ -1374,7 +1297,6 @@ 8B12D7A022D6235200D05A70 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1390,7 +1312,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.NefJekyll; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1403,7 +1324,6 @@ 8B12D7A122D6235200D05A70 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1419,7 +1339,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.NefJekyll; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1432,7 +1351,6 @@ 8B22249522D5EAD600C85856 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1461,7 +1379,6 @@ 8B22249622D5EAD600C85856 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1516,7 +1433,6 @@ 8B4F45B722CF9AF400E6F471 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1544,7 +1460,6 @@ 8B4F45B822CF9AF400E6F471 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1572,7 +1487,6 @@ 8B6B11A622CB9FDE0060177F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1591,7 +1505,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Core; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1602,7 +1515,6 @@ 8B6B11A722CB9FDE0060177F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1621,7 +1533,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Core; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1722,6 +1633,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + USE_HEADERMAP = YES; }; name = Debug; }; @@ -1777,6 +1689,7 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; + USE_HEADERMAP = YES; }; name = Release; }; @@ -1813,7 +1726,6 @@ 8BF75F6822CA637B00EC53A1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1822,7 +1734,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/ui/Common/Support Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Common/Support Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1841,7 +1753,6 @@ 8BF75F6922CA637B00EC53A1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1850,7 +1761,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/ui/Common/Support Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Common/Support Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1869,8 +1780,6 @@ 8BF75F9622CA71E700EC53A1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1886,6 +1795,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "$(SRCROOT)/Component/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1899,8 +1809,6 @@ 8BF75F9722CA71E700EC53A1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1916,6 +1824,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "$(SRCROOT)/Component/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1928,7 +1837,6 @@ 8BF75FD822CA7DA500EC53A1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1947,7 +1855,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.47deg.NefCarbon; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1958,7 +1865,6 @@ 8BF75FD922CA7DA500EC53A1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; @@ -1977,7 +1883,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.47deg.NefCarbon; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -2033,7 +1938,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8B6B11A522CB9FDE0060177F /* Build configuration list for PBXNativeTarget "Core" */ = { + 8B6B11A522CB9FDE0060177F /* Build configuration list for PBXNativeTarget "NefCore" */ = { isa = XCConfigurationList; buildConfigurations = ( 8B6B11A622CB9FDE0060177F /* Debug */, @@ -2069,7 +1974,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */ = { + 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "NefCommon" */ = { isa = XCConfigurationList; buildConfigurations = ( 8BF75F6822CA637B00EC53A1 /* Debug */, diff --git a/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata index e1e974b6..3f08cb44 100644 --- a/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:nef.xcodeproj"> diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/Core.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/Core.xcscheme deleted file mode 100644 index 374f1a24..00000000 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/Core.xcscheme +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/CoreTests.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/CoreTests.xcscheme new file mode 100644 index 00000000..621ab5cc --- /dev/null +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/CoreTests.xcscheme @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/Common.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/NefCore.xcscheme similarity index 71% rename from project/nef.xcodeproj/xcshareddata/xcschemes/Common.xcscheme rename to project/nef.xcodeproj/xcshareddata/xcschemes/NefCore.xcscheme index d57df04b..865528d3 100644 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/Common.xcscheme +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/NefCore.xcscheme @@ -1,6 +1,6 @@ @@ -29,8 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/nef.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/nef.xcscheme index dc6d7c25..d4f9650f 100644 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/nef.xcscheme +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/nef.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -27,10 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - @@ -53,8 +49,6 @@ ReferencedContainer = "container:nef.xcodeproj"> - - Date: Tue, 12 Nov 2019 13:14:00 +0100 Subject: [PATCH 02/20] Upgrade project and SPM to generate nef lib + executables --- Package.swift | 31 +- project/Component/module.modulemap | 23 -- .../nef/Support Files/{ => Private}/Carbon.h | 0 .../nef/Support Files/{ => Private}/Common.h | 0 .../nef/Support Files/{ => Private}/Core.h | 0 .../nef/Support Files/{ => Private}/Jekyll.h | 0 .../Support Files/{ => Private}/Markdown.h | 0 .../nef/Support Files/Public/module.modulemap | 40 +++ .../nef/Support Files/{ => Public}/nef.h | 0 project/UI/Carbon/ConsoleOutput.swift | 1 - project/UI/Carbon/main.swift | 2 +- project/UI/Jekyll/ConsoleOutput.swift | 1 - project/UI/Jekyll/main.swift | 1 - project/UI/Markdown/ConsoleOutput.swift | 1 - project/UI/Markdown/main.swift | 1 - project/nef.xcodeproj/project.pbxproj | 294 +++++------------- .../xcshareddata/xcschemes/NefJekyll.xcscheme | 67 ++++ .../xcschemes/NefMarkdown.xcscheme | 67 ++++ 18 files changed, 271 insertions(+), 258 deletions(-) delete mode 100644 project/Component/module.modulemap rename project/Component/nef/Support Files/{ => Private}/Carbon.h (100%) rename project/Component/nef/Support Files/{ => Private}/Common.h (100%) rename project/Component/nef/Support Files/{ => Private}/Core.h (100%) rename project/Component/nef/Support Files/{ => Private}/Jekyll.h (100%) rename project/Component/nef/Support Files/{ => Private}/Markdown.h (100%) create mode 100644 project/Component/nef/Support Files/Public/module.modulemap rename project/Component/nef/Support Files/{ => Public}/nef.h (100%) create mode 100644 project/nef.xcodeproj/xcshareddata/xcschemes/NefJekyll.xcscheme create mode 100644 project/nef.xcodeproj/xcshareddata/xcschemes/NefMarkdown.xcscheme diff --git a/Package.swift b/Package.swift index 8b154f57..cff5b6fb 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.0 import PackageDescription let package = Package( @@ -7,21 +7,24 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "nef", targets: ["nef"]), + .library(name: "nef", targets: ["NefModels", "nef"]), + .executable(name: "nef-markdown-page", targets: ["Markdown"]), + .executable(name: "nef-jekyll-page", targets: ["Jekyll"]), + .executable(name: "nef-carbon-page", targets: ["Carbon"]), ], targets: [ - .testTarget(name: "CoreTests", dependencies: ["NefCore"], path: "project/Tests/CoreTests"), - .target(name: "NefCommon", path: "project/Common", publicHeadersPath: "project/Common"), - .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "project/Core"), + .target(name: "NefCommon", path: "project/Common", publicHeadersPath: "Support Files"), + .target(name: "NefModels", path: "project/Component/NefModels", publicHeadersPath: "Support Files"), + .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "Support Files"), + .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "Support Files"), + .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "Support Files"), + .target(name: "NefCarbon", dependencies: ["NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "Support Files"), - .target(name: "NefModels", path: "project/Component/NefModels"), - .target(name: "NefCarbon", dependencies: ["NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "project/Component/NefCarbon"), - .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "project/Component/NefJekyll"), - .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "project/Component/NefMarkdown"), - .target(name: "nef", dependencies: ["NefMarkdown", "NefJekyll", "NefCarbon", "NefModels"], path: "project/Component/nef", publicHeadersPath: "project"), - - .target(name: "Markdown", dependencies: ["NefCore", "NefCommon", "NefMarkdown"], path: "project/UI/Markdown"), - .target(name: "Jekyll", dependencies: ["NefCore", "NefCommon", "NefJekyll"], path: "project/UI/Jekyll"), - .target(name: "Carbon", dependencies: ["NefCore", "NefCommon", "NefCarbon"], path: "project/UI/Carbon"), + .target(name: "nef", dependencies: ["NefModels", "NefMarkdown", "NefJekyll", "NefCarbon"], path: "project/Component/nef", publicHeadersPath: "Support Files/Public", cSettings: [.headerSearchPath("Support Files/Private")]), + .target(name: "Markdown", dependencies: ["NefCommon", "NefMarkdown"], path: "project/UI/Markdown"), + .target(name: "Jekyll", dependencies: ["NefCommon", "NefJekyll"], path: "project/UI/Jekyll"), + .target(name: "Carbon", dependencies: ["NefCommon", "NefModels", "NefCore", "NefCarbon"], path: "project/UI/Carbon"), + + .testTarget(name: "CoreTests", dependencies: ["nef"], path: "project/Tests/CoreTests"), ] ) diff --git a/project/Component/module.modulemap b/project/Component/module.modulemap deleted file mode 100644 index 4125d6ad..00000000 --- a/project/Component/module.modulemap +++ /dev/null @@ -1,23 +0,0 @@ -framework module nef { - header "nef.h" - - explicit module Core { - header "Core.h" - header "Common.h" - } - - explicit module Markdown { - header "Markdown.h" - export Core - } - - explicit module Jekyll { - header "Jekyll.h" - export Core - } - - explicit module Carbon { - header "Carbon.h" - export Core - } -} diff --git a/project/Component/nef/Support Files/Carbon.h b/project/Component/nef/Support Files/Private/Carbon.h similarity index 100% rename from project/Component/nef/Support Files/Carbon.h rename to project/Component/nef/Support Files/Private/Carbon.h diff --git a/project/Component/nef/Support Files/Common.h b/project/Component/nef/Support Files/Private/Common.h similarity index 100% rename from project/Component/nef/Support Files/Common.h rename to project/Component/nef/Support Files/Private/Common.h diff --git a/project/Component/nef/Support Files/Core.h b/project/Component/nef/Support Files/Private/Core.h similarity index 100% rename from project/Component/nef/Support Files/Core.h rename to project/Component/nef/Support Files/Private/Core.h diff --git a/project/Component/nef/Support Files/Jekyll.h b/project/Component/nef/Support Files/Private/Jekyll.h similarity index 100% rename from project/Component/nef/Support Files/Jekyll.h rename to project/Component/nef/Support Files/Private/Jekyll.h diff --git a/project/Component/nef/Support Files/Markdown.h b/project/Component/nef/Support Files/Private/Markdown.h similarity index 100% rename from project/Component/nef/Support Files/Markdown.h rename to project/Component/nef/Support Files/Private/Markdown.h diff --git a/project/Component/nef/Support Files/Public/module.modulemap b/project/Component/nef/Support Files/Public/module.modulemap new file mode 100644 index 00000000..6b2b662e --- /dev/null +++ b/project/Component/nef/Support Files/Public/module.modulemap @@ -0,0 +1,40 @@ +framework module nef { + umbrella header "nef.h" + link "NefModels" + export * + + explicit module Core { + header "Core.h" + header "Common.h" + link "NefCore" + link "NefCommon" + export * + } + + explicit module Markdown { + header "Markdown.h" + link "NefMarkdown" + link "NefCore" + link "NefCommon" + export Core + export * + } + + explicit module Jekyll { + header "Jekyll.h" + link "NefJekyll" + link "NefCore" + link "NefCommon" + export Core + export * + } + + explicit module Carbon { + header "Carbon.h" + link "NefCarbon" + link "NefCore" + link "NefCommon" + export Core + export * + } +} diff --git a/project/Component/nef/Support Files/nef.h b/project/Component/nef/Support Files/Public/nef.h similarity index 100% rename from project/Component/nef/Support Files/nef.h rename to project/Component/nef/Support Files/Public/nef.h diff --git a/project/UI/Carbon/ConsoleOutput.swift b/project/UI/Carbon/ConsoleOutput.swift index c236f57f..38bb98ba 100644 --- a/project/UI/Carbon/ConsoleOutput.swift +++ b/project/UI/Carbon/ConsoleOutput.swift @@ -1,6 +1,5 @@ // Copyright © 2019 The nef Authors. -import Foundation import NefCommon public class CarbonOutput: ConsoleOutput { diff --git a/project/UI/Carbon/main.swift b/project/UI/Carbon/main.swift index e7b51f2b..abe75773 100644 --- a/project/UI/Carbon/main.swift +++ b/project/UI/Carbon/main.swift @@ -2,8 +2,8 @@ import Foundation import NefCommon -import NefCore import NefModels +import NefCore import NefCarbon let scriptName = "nef-carbon-page" diff --git a/project/UI/Jekyll/ConsoleOutput.swift b/project/UI/Jekyll/ConsoleOutput.swift index befbbc5b..b98befcc 100644 --- a/project/UI/Jekyll/ConsoleOutput.swift +++ b/project/UI/Jekyll/ConsoleOutput.swift @@ -1,6 +1,5 @@ // Copyright © 2019 The nef Authors. -import Foundation import NefCommon class JekyllConsole: ConsoleOutput { diff --git a/project/UI/Jekyll/main.swift b/project/UI/Jekyll/main.swift index 537c92d6..ca23dd25 100644 --- a/project/UI/Jekyll/main.swift +++ b/project/UI/Jekyll/main.swift @@ -2,7 +2,6 @@ import Foundation import NefCommon -import NefCore import NefJekyll let scriptName = "nef-jekyll-page" diff --git a/project/UI/Markdown/ConsoleOutput.swift b/project/UI/Markdown/ConsoleOutput.swift index ad5302f8..ed844b07 100644 --- a/project/UI/Markdown/ConsoleOutput.swift +++ b/project/UI/Markdown/ConsoleOutput.swift @@ -1,6 +1,5 @@ // Copyright © 2019 The nef Authors. -import Foundation import NefCommon class MarkdownConsole: ConsoleOutput { diff --git a/project/UI/Markdown/main.swift b/project/UI/Markdown/main.swift index 51c9324c..a19c3dc9 100644 --- a/project/UI/Markdown/main.swift +++ b/project/UI/Markdown/main.swift @@ -2,7 +2,6 @@ import Foundation import NefCommon -import NefCore import NefMarkdown let scriptName = "nef-markdown-page" diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 5ae53749..3b34247f 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -9,18 +9,6 @@ /* Begin PBXBuildFile section */ 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* Jekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* Jekyll.swift */; }; - 8B12D7B822D63EAD00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8B12D7B922D63EAD00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8B12D7BA22D63EAD00D05A70 /* NefMarkdown.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B22248322D5EAD500C85856 /* NefMarkdown.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8B12D7BB22D6404300D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BC22D645AA00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BD22D645AE00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BE22D645B300D05A70 /* NefJekyll.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B12D79B22D6235200D05A70 /* NefJekyll.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7BF22D645B700D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C022D645EE00D05A70 /* NefCommon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C122D645EE00D05A70 /* NefCarbon.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C222D645EE00D05A70 /* NefCore.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8B12D7C322D645EE00D05A70 /* NefModels.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B4F45A522CF9AF400E6F471 /* NefModels.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; 8B22247C22D4C91B00C85856 /* NSImage+Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86422D392C000919F36 /* NSImage+Store.swift */; }; 8B22249D22D5EC6B00C85856 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85B22D392C000919F36 /* Markdown.swift */; }; @@ -59,14 +47,14 @@ 8B3CB8C222D3964000919F36 /* nef.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* nef.swift */; }; 8B3CB8C622D396E300919F36 /* NefCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB86122D392C000919F36 /* NefCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; + 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E99237A3CFE0059C9C7 /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B603EA4237A3CFE0059C9C7 /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9B237A3CFE0059C9C7 /* Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9C237A3CFE0059C9C7 /* Carbon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B603EA6237A3CFE0059C9C7 /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9D237A3CFE0059C9C7 /* Markdown.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9F237A3CFE0059C9C7 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B9955192379A24F00C81A2A /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB83C22D3929B00919F36 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B9955542379BE4600C81A2A /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955522379BE4200C81A2A /* Carbon.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B9955552379BE4600C81A2A /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B99554F2379BE4200C81A2A /* Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B9955562379BE4700C81A2A /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955502379BE4200C81A2A /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B9955572379BE4700C81A2A /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955532379BE4200C81A2A /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B9955582379BE4700C81A2A /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B9955512379BE4200C81A2A /* Markdown.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8BCDC72022F0455D00174A19 /* CarbonViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */; }; 8BF53F56235F09780081C27C /* nef+helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BF53F55235F09770081C27C /* nef+helpers.swift */; }; /* End PBXBuildFile section */ @@ -79,13 +67,6 @@ remoteGlobalIDString = 8B12D79A22D6235200D05A70; remoteInfo = NefJekyll; }; - 8B12D7A722D624E800D05A70 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B12D79A22D6235200D05A70; - remoteInfo = NefJekyll; - }; 8B12D7C422D6498900D05A70 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -114,13 +95,6 @@ remoteGlobalIDString = 8B6B119322CB9FDE0060177F; remoteInfo = Core; }; - 8B22249B22D5EB2200C85856 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B22248222D5EAD500C85856; - remoteInfo = NefMarkdown; - }; 8B27832A237979870052189A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -170,106 +144,43 @@ remoteGlobalIDString = 8B6B119322CB9FDE0060177F; remoteInfo = Markup; }; - 8B6B11BE22CBA1950060177F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8BF75FC522CA7DA500EC53A1; - remoteInfo = NefCarbon; - }; - 8B6B11C022CBA1AC0060177F /* PBXContainerItemProxy */ = { + 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; + remoteGlobalIDString = 8B22248222D5EAD500C85856; + remoteInfo = NefMarkdown; }; - 8B6B11C222CBA1AC0060177F /* PBXContainerItemProxy */ = { + 8B99556A2379D13400C81A2A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8B6B119322CB9FDE0060177F; - remoteInfo = Markup; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; }; - 8B6B11C422CBA1B90060177F /* PBXContainerItemProxy */ = { + 8B99556C2379D13A00C81A2A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; }; - 8B6B11C622CBA1B90060177F /* PBXContainerItemProxy */ = { + 8B9955752379E0D000C81A2A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8B6B119322CB9FDE0060177F; - remoteInfo = Markup; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; }; - 8B6B11C822CBA1BF0060177F /* PBXContainerItemProxy */ = { + 8BB47EEC237AC47200C6A960 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; - }; - 8B6B11CA22CBA1BF0060177F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B6B119322CB9FDE0060177F; - remoteInfo = Markup; - }; - 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B22248222D5EAD500C85856; - remoteInfo = NefMarkdown; + remoteInfo = NefCommon; }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - 8B0CA51422AE669600181BC0 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = nef/frameworks/carbon; - dstSubfolderSpec = 16; - files = ( - 8B12D7C022D645EE00D05A70 /* NefCommon.framework in CopyFiles */, - 8B12D7C122D645EE00D05A70 /* NefCarbon.framework in CopyFiles */, - 8B12D7C222D645EE00D05A70 /* NefCore.framework in CopyFiles */, - 8B12D7C322D645EE00D05A70 /* NefModels.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B424B1D224E28FC00AF9010 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = nef/frameworks/markdown; - dstSubfolderSpec = 16; - files = ( - 8B12D7BB22D6404300D05A70 /* NefModels.framework in CopyFiles */, - 8B12D7B822D63EAD00D05A70 /* NefCommon.framework in CopyFiles */, - 8B12D7B922D63EAD00D05A70 /* NefCore.framework in CopyFiles */, - 8B12D7BA22D63EAD00D05A70 /* NefMarkdown.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B6FC583221ECE6A008F7694 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = nef/frameworks/jekyll; - dstSubfolderSpec = 16; - files = ( - 8B12D7BF22D645B700D05A70 /* NefModels.framework in CopyFiles */, - 8B12D7BE22D645B300D05A70 /* NefJekyll.framework in CopyFiles */, - 8B12D7BD22D645AE00D05A70 /* NefCore.framework in CopyFiles */, - 8B12D7BC22D645AA00D05A70 /* NefCommon.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 8B0CA51622AE669600181BC0 /* Carbon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Carbon; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -279,7 +190,6 @@ 8B22248522D5EAD600C85856 /* NefMarkdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefMarkdown.h; sourceTree = ""; }; 8B22248622D5EAD600C85856 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB83A22D3929B00919F36 /* nef.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = nef.swift; sourceTree = ""; }; - 8B3CB83C22D3929B00919F36 /* nef.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; 8B3CB83D22D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB84022D3929B00919F36 /* NefModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefModels.h; sourceTree = ""; }; 8B3CB84122D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -326,15 +236,16 @@ 8B3CB8C722D3987500919F36 /* Carbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; 8B424B1F224E28FC00AF9010 /* Markdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Markdown; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B603E99237A3CFE0059C9C7 /* Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; + 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; + 8B603E9B237A3CFE0059C9C7 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; + 8B603E9C237A3CFE0059C9C7 /* Carbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; + 8B603E9D237A3CFE0059C9C7 /* Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; + 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; + 8B603EA1237A3CFE0059C9C7 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* Jekyll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Jekyll; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B99554F2379BE4200C81A2A /* Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; - 8B9955502379BE4200C81A2A /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; - 8B9955512379BE4200C81A2A /* Markdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; - 8B9955522379BE4200C81A2A /* Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; - 8B9955532379BE4200C81A2A /* Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; - 8B99555A2379C62300C81A2A /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Component/module.modulemap; sourceTree = SOURCE_ROOT; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF53F55235F09770081C27C /* nef+helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "nef+helpers.swift"; sourceTree = ""; }; @@ -344,20 +255,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8B0CA51322AE669600181BC0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8B424B1C224E28FC00AF9010 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8B6B119922CB9FDE0060177F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -366,13 +263,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8B6FC582221ECE6A008F7694 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -437,13 +327,8 @@ 8B3CB83B22D3929B00919F36 /* Support Files */ = { isa = PBXGroup; children = ( - 8B3CB83C22D3929B00919F36 /* nef.h */, - 8B9955512379BE4200C81A2A /* Markdown.h */, - 8B9955532379BE4200C81A2A /* Jekyll.h */, - 8B9955522379BE4200C81A2A /* Carbon.h */, - 8B9955502379BE4200C81A2A /* Core.h */, - 8B99554F2379BE4200C81A2A /* Common.h */, - 8B99555A2379C62300C81A2A /* module.modulemap */, + 8B603E98237A3CFE0059C9C7 /* Private */, + 8B603E9E237A3CFE0059C9C7 /* Public */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -646,6 +531,27 @@ path = "Support Files"; sourceTree = ""; }; + 8B603E98237A3CFE0059C9C7 /* Private */ = { + isa = PBXGroup; + children = ( + 8B603E99237A3CFE0059C9C7 /* Core.h */, + 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */, + 8B603E9B237A3CFE0059C9C7 /* Common.h */, + 8B603E9C237A3CFE0059C9C7 /* Carbon.h */, + 8B603E9D237A3CFE0059C9C7 /* Markdown.h */, + ); + path = Private; + sourceTree = ""; + }; + 8B603E9E237A3CFE0059C9C7 /* Public */ = { + isa = PBXGroup; + children = ( + 8B603E9F237A3CFE0059C9C7 /* nef.h */, + 8B603EA1237A3CFE0059C9C7 /* module.modulemap */, + ); + path = Public; + sourceTree = ""; + }; 8B6FC57C221ECE6A008F7694 = { isa = PBXGroup; children = ( @@ -731,12 +637,12 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8B9955572379BE4700C81A2A /* Jekyll.h in Headers */, - 8B9955192379A24F00C81A2A /* nef.h in Headers */, - 8B9955562379BE4700C81A2A /* Core.h in Headers */, - 8B9955552379BE4600C81A2A /* Common.h in Headers */, - 8B9955542379BE4600C81A2A /* Carbon.h in Headers */, - 8B9955582379BE4700C81A2A /* Markdown.h in Headers */, + 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */, + 8B603EA6237A3CFE0059C9C7 /* Markdown.h in Headers */, + 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */, + 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */, + 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */, + 8B603EA4237A3CFE0059C9C7 /* Common.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -756,15 +662,11 @@ buildConfigurationList = 8B0CA51A22AE669600181BC0 /* Build configuration list for PBXNativeTarget "Carbon" */; buildPhases = ( 8B0CA51222AE669600181BC0 /* Sources */, - 8B0CA51322AE669600181BC0 /* Frameworks */, - 8B0CA51422AE669600181BC0 /* CopyFiles */, ); buildRules = ( ); dependencies = ( - 8B6B11C122CBA1AC0060177F /* PBXTargetDependency */, - 8B6B11C322CBA1AC0060177F /* PBXTargetDependency */, - 8B6B11BF22CBA1950060177F /* PBXTargetDependency */, + 8B99556D2379D13A00C81A2A /* PBXTargetDependency */, ); name = Carbon; productName = Carbon; @@ -812,15 +714,11 @@ buildConfigurationList = 8B424B23224E28FC00AF9010 /* Build configuration list for PBXNativeTarget "Markdown" */; buildPhases = ( 8B424B1B224E28FC00AF9010 /* Sources */, - 8B424B1C224E28FC00AF9010 /* Frameworks */, - 8B424B1D224E28FC00AF9010 /* CopyFiles */, ); buildRules = ( ); dependencies = ( - 8B6B11C922CBA1BF0060177F /* PBXTargetDependency */, - 8B6B11CB22CBA1BF0060177F /* PBXTargetDependency */, - 8B22249C22D5EB2200C85856 /* PBXTargetDependency */, + 8B9955762379E0D000C81A2A /* PBXTargetDependency */, ); name = Markdown; productName = Markdown; @@ -883,15 +781,11 @@ buildConfigurationList = 8B6FC58C221ECE6A008F7694 /* Build configuration list for PBXNativeTarget "Jekyll" */; buildPhases = ( 8B6FC581221ECE6A008F7694 /* Sources */, - 8B6FC582221ECE6A008F7694 /* Frameworks */, - 8B6FC583221ECE6A008F7694 /* CopyFiles */, ); buildRules = ( ); dependencies = ( - 8B6B11C522CBA1B90060177F /* PBXTargetDependency */, - 8B6B11C722CBA1B90060177F /* PBXTargetDependency */, - 8B12D7A822D624E800D05A70 /* PBXTargetDependency */, + 8B99556B2379D13400C81A2A /* PBXTargetDependency */, ); name = Jekyll; productName = JekyllMarkdown; @@ -926,6 +820,7 @@ dependencies = ( 8B6B11BD22CBA1770060177F /* PBXTargetDependency */, 8B27832B237979870052189A /* PBXTargetDependency */, + 8BB47EED237AC47200C6A960 /* PBXTargetDependency */, 8B8AA94022D62266006BE290 /* PBXTargetDependency */, 8B12D7A622D624D900D05A70 /* PBXTargetDependency */, 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, @@ -1022,8 +917,8 @@ 8B12D79A22D6235200D05A70 /* NefJekyll */, 8BF75FC522CA7DA500EC53A1 /* NefCarbon */, 8B4F45A422CF9AF400E6F471 /* NefModels */, - 8B6B119322CB9FDE0060177F /* NefCore */, 8BF75F5622CA637B00EC53A1 /* NefCommon */, + 8B6B119322CB9FDE0060177F /* NefCore */, 8B6B119B22CB9FDE0060177F /* CoreTests */, ); }; @@ -1069,8 +964,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB88322D3932400919F36 /* ConsoleOutput.swift in Sources */, 8B3CB88422D3932400919F36 /* main.swift in Sources */, + 8B3CB88322D3932400919F36 /* ConsoleOutput.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1112,8 +1007,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB87F22D3931D00919F36 /* ConsoleOutput.swift in Sources */, 8B3CB88022D3931D00919F36 /* main.swift in Sources */, + 8B3CB87F22D3931D00919F36 /* ConsoleOutput.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1162,11 +1057,6 @@ target = 8B12D79A22D6235200D05A70 /* NefJekyll */; targetProxy = 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */; }; - 8B12D7A822D624E800D05A70 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B12D79A22D6235200D05A70 /* NefJekyll */; - targetProxy = 8B12D7A722D624E800D05A70 /* PBXContainerItemProxy */; - }; 8B12D7C522D6498900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; @@ -1187,11 +1077,6 @@ target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B12D7CA22D6498F00D05A70 /* PBXContainerItemProxy */; }; - 8B22249C22D5EB2200C85856 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B22248222D5EAD500C85856 /* NefMarkdown */; - targetProxy = 8B22249B22D5EB2200C85856 /* PBXContainerItemProxy */; - }; 8B27832B237979870052189A /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B4F45A422CF9AF400E6F471 /* NefModels */; @@ -1227,45 +1112,30 @@ target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11BC22CBA1770060177F /* PBXContainerItemProxy */; }; - 8B6B11BF22CBA1950060177F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75FC522CA7DA500EC53A1 /* NefCarbon */; - targetProxy = 8B6B11BE22CBA1950060177F /* PBXContainerItemProxy */; - }; - 8B6B11C122CBA1AC0060177F /* PBXTargetDependency */ = { + 8B8AA94022D62266006BE290 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B6B11C022CBA1AC0060177F /* PBXContainerItemProxy */; + target = 8B22248222D5EAD500C85856 /* NefMarkdown */; + targetProxy = 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */; }; - 8B6B11C322CBA1AC0060177F /* PBXTargetDependency */ = { + 8B99556B2379D13400C81A2A /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* NefCore */; - targetProxy = 8B6B11C222CBA1AC0060177F /* PBXContainerItemProxy */; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B99556A2379D13400C81A2A /* PBXContainerItemProxy */; }; - 8B6B11C522CBA1B90060177F /* PBXTargetDependency */ = { + 8B99556D2379D13A00C81A2A /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B6B11C422CBA1B90060177F /* PBXContainerItemProxy */; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B99556C2379D13A00C81A2A /* PBXContainerItemProxy */; }; - 8B6B11C722CBA1B90060177F /* PBXTargetDependency */ = { + 8B9955762379E0D000C81A2A /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* NefCore */; - targetProxy = 8B6B11C622CBA1B90060177F /* PBXContainerItemProxy */; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B9955752379E0D000C81A2A /* PBXContainerItemProxy */; }; - 8B6B11C922CBA1BF0060177F /* PBXTargetDependency */ = { + 8BB47EED237AC47200C6A960 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B6B11C822CBA1BF0060177F /* PBXContainerItemProxy */; - }; - 8B6B11CB22CBA1BF0060177F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B6B119322CB9FDE0060177F /* NefCore */; - targetProxy = 8B6B11CA22CBA1BF0060177F /* PBXContainerItemProxy */; - }; - 8B8AA94022D62266006BE290 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B22248222D5EAD500C85856 /* NefMarkdown */; - targetProxy = 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */; + targetProxy = 8BB47EEC237AC47200C6A960 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -1276,7 +1146,6 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/carbon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1288,7 +1157,6 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/carbon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1410,7 +1278,6 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/markdown; LIBRARY_SEARCH_PATHS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1423,7 +1290,6 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/markdown; LIBRARY_SEARCH_PATHS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1700,7 +1566,6 @@ CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_OPTIMIZATION_LEVEL = 0; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/jekyll; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1715,7 +1580,6 @@ CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_OPTIMIZATION_LEVEL = 0; - LD_RUNPATH_SEARCH_PATHS = /usr/local/lib/nef/frameworks/jekyll; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1795,7 +1659,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/module.modulemap"; + MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/Public/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1824,7 +1688,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/module.modulemap"; + MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/Public/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/NefJekyll.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/NefJekyll.xcscheme new file mode 100644 index 00000000..705a89ab --- /dev/null +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/NefJekyll.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/NefMarkdown.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/NefMarkdown.xcscheme new file mode 100644 index 00000000..3486211c --- /dev/null +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/NefMarkdown.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From 746da71ff47c3eeb65706f4c3639623168d210b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Tue, 12 Nov 2019 19:47:22 +0100 Subject: [PATCH 03/20] Add SPM to build executables and neflib + configure project to auto import dependencies --- .gitignore | 2 +- Package.swift | 25 +- .../NefCarbon/App/CarbonAppDelegate.swift | 1 - .../NefCarbon/App/CarbonApplication.swift | 1 - .../NefCarbon/App/CarbonAssembler.swift | 1 - .../NefCarbon/App/CarbonSyncDownloader.swift | 2 - .../NefCarbon/App/CarbonViewer.swift | 1 - .../NefCarbon/App/CarbonWebView.swift | 1 - .../{Carbon.swift => NefCarbon.swift} | 2 - .../NefCarbon/Support Files/NefCarbon.h | 1 + .../{Jekyll.swift => NefJekyll.swift} | 1 - .../NefJekyll/Support Files/NefJekyll.h | 3 +- .../{Markdown.swift => NefMarkdown.swift} | 1 - .../NefMarkdown/Support Files/NefMarkdown.h | 3 +- .../nef/Support Files/Private/Common.h | 12 - .../{Public => }/module.modulemap | 8 - project/Component/nef/nef+helpers.swift | 1 - project/Component/nef/nef.swift | 1 - project/Core/Parser/Lexical.swift | 2 + project/Core/Render/Carbon.swift | 1 - project/Core/Support Files/NefCore.h | 7 +- project/Package.swift | 26 ++ project/UI/Carbon/ConsoleOutput.swift | 2 +- project/UI/Carbon/main.swift | 5 +- project/{ => UI}/Common/Array+Slice.swift | 0 project/{ => UI}/Common/ConsoleReader.swift | 0 project/{ => UI}/Common/PlaygroundUtils.swift | 0 project/{ => UI}/Common/String+Path.swift | 0 .../{ => UI}/Common/Support Files/Info.plist | 0 .../{ => UI}/Common/Support Files/NefCommon.h | 5 +- .../UI/Common/Support Files/module.modulemap | 4 + project/UI/Jekyll/ConsoleOutput.swift | 2 +- project/UI/Jekyll/main.swift | 3 +- project/UI/Markdown/ConsoleOutput.swift | 2 +- project/UI/Markdown/main.swift | 3 +- project/nef.xcodeproj/project.pbxproj | 223 ++++++++---------- 36 files changed, 155 insertions(+), 197 deletions(-) rename project/Component/NefCarbon/{Carbon.swift => NefCarbon.swift} (97%) rename project/Component/NefJekyll/{Jekyll.swift => NefJekyll.swift} (98%) rename project/Component/NefMarkdown/{Markdown.swift => NefMarkdown.swift} (98%) delete mode 100644 project/Component/nef/Support Files/Private/Common.h rename project/Component/nef/Support Files/{Public => }/module.modulemap (74%) create mode 100644 project/Package.swift rename project/{ => UI}/Common/Array+Slice.swift (100%) rename project/{ => UI}/Common/ConsoleReader.swift (100%) rename project/{ => UI}/Common/PlaygroundUtils.swift (100%) rename project/{ => UI}/Common/String+Path.swift (100%) rename project/{ => UI}/Common/Support Files/Info.plist (100%) rename project/{ => UI}/Common/Support Files/NefCommon.h (84%) create mode 100644 project/UI/Common/Support Files/module.modulemap diff --git a/.gitignore b/.gitignore index 27aac758..756b1790 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ **/.DS_Store **/xcuserdata/ BowPlayground -/.build +.build .swiftpm ## Jekyll diff --git a/Package.swift b/Package.swift index cff5b6fb..87b6ca2c 100644 --- a/Package.swift +++ b/Package.swift @@ -7,24 +7,19 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "nef", targets: ["NefModels", "nef"]), - .executable(name: "nef-markdown-page", targets: ["Markdown"]), - .executable(name: "nef-jekyll-page", targets: ["Jekyll"]), - .executable(name: "nef-carbon-page", targets: ["Carbon"]), + .library(name: "nef", targets: ["nef"]), ], targets: [ - .target(name: "NefCommon", path: "project/Common", publicHeadersPath: "Support Files"), - .target(name: "NefModels", path: "project/Component/NefModels", publicHeadersPath: "Support Files"), - .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "Support Files"), - .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "Support Files"), - .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "Support Files"), - .target(name: "NefCarbon", dependencies: ["NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "Support Files"), + .target(name: "nef", + path: "project", + sources: ["nef", + "Core", + "Component/NefModels", + "Component/NefMarkdown", + "Component/NefJekyll", + "Component/NefCarbon"]), + - .target(name: "nef", dependencies: ["NefModels", "NefMarkdown", "NefJekyll", "NefCarbon"], path: "project/Component/nef", publicHeadersPath: "Support Files/Public", cSettings: [.headerSearchPath("Support Files/Private")]), - .target(name: "Markdown", dependencies: ["NefCommon", "NefMarkdown"], path: "project/UI/Markdown"), - .target(name: "Jekyll", dependencies: ["NefCommon", "NefJekyll"], path: "project/UI/Jekyll"), - .target(name: "Carbon", dependencies: ["NefCommon", "NefModels", "NefCore", "NefCarbon"], path: "project/UI/Carbon"), - .testTarget(name: "CoreTests", dependencies: ["nef"], path: "project/Tests/CoreTests"), ] ) diff --git a/project/Component/NefCarbon/App/CarbonAppDelegate.swift b/project/Component/NefCarbon/App/CarbonAppDelegate.swift index 3c1bae3c..e766443a 100644 --- a/project/Component/NefCarbon/App/CarbonAppDelegate.swift +++ b/project/Component/NefCarbon/App/CarbonAppDelegate.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import AppKit -import NefCore class CarbonAppDelegate: NSObject, NSApplicationDelegate { private let main: (CarbonDownloader) -> Void diff --git a/project/Component/NefCarbon/App/CarbonApplication.swift b/project/Component/NefCarbon/App/CarbonApplication.swift index a03d828e..59ec4053 100644 --- a/project/Component/NefCarbon/App/CarbonApplication.swift +++ b/project/Component/NefCarbon/App/CarbonApplication.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import AppKit -import NefCore public class CarbonApplication { private static let app = NSApplication.shared diff --git a/project/Component/NefCarbon/App/CarbonAssembler.swift b/project/Component/NefCarbon/App/CarbonAssembler.swift index 328ae8e8..f0754ffc 100644 --- a/project/Component/NefCarbon/App/CarbonAssembler.swift +++ b/project/Component/NefCarbon/App/CarbonAssembler.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import AppKit -import NefCore public class CarbonAssembler: CarbonProvider, CarbonAppDelegateAssembler { public init() {} diff --git a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift index e8bf70ec..e614edcf 100644 --- a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift +++ b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift @@ -1,8 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCore -import NefModels class CarbonSyncDownloader: CarbonDownloader, CarbonViewDelegate { diff --git a/project/Component/NefCarbon/App/CarbonViewer.swift b/project/Component/NefCarbon/App/CarbonViewer.swift index e051534c..afee1eee 100644 --- a/project/Component/NefCarbon/App/CarbonViewer.swift +++ b/project/Component/NefCarbon/App/CarbonViewer.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefModels public enum CarbonViewer { diff --git a/project/Component/NefCarbon/App/CarbonWebView.swift b/project/Component/NefCarbon/App/CarbonWebView.swift index 0deafea5..853b31a1 100644 --- a/project/Component/NefCarbon/App/CarbonWebView.swift +++ b/project/Component/NefCarbon/App/CarbonWebView.swift @@ -2,7 +2,6 @@ import AppKit import WebKit -import NefModels /// Carbon view definition public protocol CarbonView: NSView { diff --git a/project/Component/NefCarbon/Carbon.swift b/project/Component/NefCarbon/NefCarbon.swift similarity index 97% rename from project/Component/NefCarbon/Carbon.swift rename to project/Component/NefCarbon/NefCarbon.swift index e8ca09d2..f5749a13 100644 --- a/project/Component/NefCarbon/Carbon.swift +++ b/project/Component/NefCarbon/NefCarbon.swift @@ -1,8 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCore -import NefModels /// Renders a page into multiple Carbon images. /// diff --git a/project/Component/NefCarbon/Support Files/NefCarbon.h b/project/Component/NefCarbon/Support Files/NefCarbon.h index 0617d1a0..70c8f659 100644 --- a/project/Component/NefCarbon/Support Files/NefCarbon.h +++ b/project/Component/NefCarbon/Support Files/NefCarbon.h @@ -9,3 +9,4 @@ FOUNDATION_EXPORT double NefCarbonVersionNumber; FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import +#import "NefCore.h" diff --git a/project/Component/NefJekyll/Jekyll.swift b/project/Component/NefJekyll/NefJekyll.swift similarity index 98% rename from project/Component/NefJekyll/Jekyll.swift rename to project/Component/NefJekyll/NefJekyll.swift index 094d4dc4..cc852edd 100644 --- a/project/Component/NefJekyll/Jekyll.swift +++ b/project/Component/NefJekyll/NefJekyll.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCore /// Renders a page into Jekyll format. /// diff --git a/project/Component/NefJekyll/Support Files/NefJekyll.h b/project/Component/NefJekyll/Support Files/NefJekyll.h index 0425e413..0bd446fe 100644 --- a/project/Component/NefJekyll/Support Files/NefJekyll.h +++ b/project/Component/NefJekyll/Support Files/NefJekyll.h @@ -9,5 +9,4 @@ FOUNDATION_EXPORT double NefJekyllVersionNumber; FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - +#import "NefCore.h" diff --git a/project/Component/NefMarkdown/Markdown.swift b/project/Component/NefMarkdown/NefMarkdown.swift similarity index 98% rename from project/Component/NefMarkdown/Markdown.swift rename to project/Component/NefMarkdown/NefMarkdown.swift index c29559e1..38475800 100644 --- a/project/Component/NefMarkdown/Markdown.swift +++ b/project/Component/NefMarkdown/NefMarkdown.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCore /// Renders a page into Markdown format. /// diff --git a/project/Component/NefMarkdown/Support Files/NefMarkdown.h b/project/Component/NefMarkdown/Support Files/NefMarkdown.h index 1494ced7..59849fdb 100644 --- a/project/Component/NefMarkdown/Support Files/NefMarkdown.h +++ b/project/Component/NefMarkdown/Support Files/NefMarkdown.h @@ -9,5 +9,4 @@ FOUNDATION_EXPORT double NefMarkdownVersionNumber; FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - +#import "NefCore.h" diff --git a/project/Component/nef/Support Files/Private/Common.h b/project/Component/nef/Support Files/Private/Common.h deleted file mode 100644 index 585c3782..00000000 --- a/project/Component/nef/Support Files/Private/Common.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for Common. -FOUNDATION_EXPORT double CommonVersionNumber; - -//! Project version string for Common. -FOUNDATION_EXPORT const unsigned char CommonVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefCommon.h" diff --git a/project/Component/nef/Support Files/Public/module.modulemap b/project/Component/nef/Support Files/module.modulemap similarity index 74% rename from project/Component/nef/Support Files/Public/module.modulemap rename to project/Component/nef/Support Files/module.modulemap index 6b2b662e..a2ea3da1 100644 --- a/project/Component/nef/Support Files/Public/module.modulemap +++ b/project/Component/nef/Support Files/module.modulemap @@ -5,17 +5,13 @@ framework module nef { explicit module Core { header "Core.h" - header "Common.h" link "NefCore" - link "NefCommon" export * } explicit module Markdown { header "Markdown.h" link "NefMarkdown" - link "NefCore" - link "NefCommon" export Core export * } @@ -23,8 +19,6 @@ framework module nef { explicit module Jekyll { header "Jekyll.h" link "NefJekyll" - link "NefCore" - link "NefCommon" export Core export * } @@ -32,8 +26,6 @@ framework module nef { explicit module Carbon { header "Carbon.h" link "NefCarbon" - link "NefCore" - link "NefCommon" export Core export * } diff --git a/project/Component/nef/nef+helpers.swift b/project/Component/nef/nef+helpers.swift index 37602298..46308516 100644 --- a/project/Component/nef/nef+helpers.swift +++ b/project/Component/nef/nef+helpers.swift @@ -5,7 +5,6 @@ import AppKit import NefMarkdown import NefJekyll import NefCarbon -import NefModels // MARK: - Carbon diff --git a/project/Component/nef/nef.swift b/project/Component/nef/nef.swift index fe20037a..75a01c48 100644 --- a/project/Component/nef/nef.swift +++ b/project/Component/nef/nef.swift @@ -5,7 +5,6 @@ import AppKit import NefMarkdown import NefJekyll import NefCarbon -import NefModels // MARK: - Markdown diff --git a/project/Core/Parser/Lexical.swift b/project/Core/Parser/Lexical.swift index 72242a3f..3a6a7bad 100644 --- a/project/Core/Parser/Lexical.swift +++ b/project/Core/Parser/Lexical.swift @@ -81,6 +81,8 @@ struct LexicalAnalyzer { // MARK: token definition for lexical analysis +import Foundation + enum Token: Equatable { case nefBegin(command: Node.Nef.Command) case nefEnd diff --git a/project/Core/Render/Carbon.swift b/project/Core/Render/Carbon.swift index 2810a581..ad581fd0 100644 --- a/project/Core/Render/Carbon.swift +++ b/project/Core/Render/Carbon.swift @@ -1,7 +1,6 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefModels public protocol CarbonDownloader: class { func carbon(withConfiguration configuration: Carbon, filename: String) -> Result diff --git a/project/Core/Support Files/NefCore.h b/project/Core/Support Files/NefCore.h index 5c64691f..b3016761 100644 --- a/project/Core/Support Files/NefCore.h +++ b/project/Core/Support Files/NefCore.h @@ -3,11 +3,10 @@ #import //! Project version number for Markup. -FOUNDATION_EXPORT double MarkupVersionNumber; +FOUNDATION_EXPORT double CoreVersionNumber; //! Project version string for Markup. -FOUNDATION_EXPORT const unsigned char MarkupVersionString[]; +FOUNDATION_EXPORT const unsigned char CoreVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - +#import "NefModels.h" diff --git a/project/Package.swift b/project/Package.swift new file mode 100644 index 00000000..d29955a1 --- /dev/null +++ b/project/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:5.0 +import PackageDescription + +let package = Package( + name: "nef-bin", + platforms: [ + .macOS(.v10_14), + ], + products: [ + .executable(name: "nef-markdown-page", targets: ["Markdown"]), + .executable(name: "nef-jekyll-page", targets: ["Jekyll"]), + .executable(name: "nef-carbon-page", targets: ["Carbon"]), + ], + targets: [ + .target(name: "Common", path: ".", sources: ["Component/NefMarkdown", + "Component/NefJekyll", + "Component/NefCarbon", + "UI/Common", + "Component/NefModels", + "Core"], publicHeadersPath: "UI/Common/Support Files"), + + .target(name: "Markdown", dependencies: ["Common"], path: ".", sources: ["UI/Markdown"]), + .target(name: "Jekyll", dependencies: ["Common"], path: ".", sources: ["UI/Jekyll"]), + .target(name: "Carbon", dependencies: ["Common"], path: ".", sources: ["UI/Carbon"]), + ] +) diff --git a/project/UI/Carbon/ConsoleOutput.swift b/project/UI/Carbon/ConsoleOutput.swift index 38bb98ba..b8c5c848 100644 --- a/project/UI/Carbon/ConsoleOutput.swift +++ b/project/UI/Carbon/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import NefCommon +import Common public class CarbonOutput: ConsoleOutput { diff --git a/project/UI/Carbon/main.swift b/project/UI/Carbon/main.swift index abe75773..86846cc1 100644 --- a/project/UI/Carbon/main.swift +++ b/project/UI/Carbon/main.swift @@ -1,10 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCommon -import NefModels -import NefCore -import NefCarbon +import Common let scriptName = "nef-carbon-page" let console = CarbonOutput() diff --git a/project/Common/Array+Slice.swift b/project/UI/Common/Array+Slice.swift similarity index 100% rename from project/Common/Array+Slice.swift rename to project/UI/Common/Array+Slice.swift diff --git a/project/Common/ConsoleReader.swift b/project/UI/Common/ConsoleReader.swift similarity index 100% rename from project/Common/ConsoleReader.swift rename to project/UI/Common/ConsoleReader.swift diff --git a/project/Common/PlaygroundUtils.swift b/project/UI/Common/PlaygroundUtils.swift similarity index 100% rename from project/Common/PlaygroundUtils.swift rename to project/UI/Common/PlaygroundUtils.swift diff --git a/project/Common/String+Path.swift b/project/UI/Common/String+Path.swift similarity index 100% rename from project/Common/String+Path.swift rename to project/UI/Common/String+Path.swift diff --git a/project/Common/Support Files/Info.plist b/project/UI/Common/Support Files/Info.plist similarity index 100% rename from project/Common/Support Files/Info.plist rename to project/UI/Common/Support Files/Info.plist diff --git a/project/Common/Support Files/NefCommon.h b/project/UI/Common/Support Files/NefCommon.h similarity index 84% rename from project/Common/Support Files/NefCommon.h rename to project/UI/Common/Support Files/NefCommon.h index b73f9f5e..e3639444 100644 --- a/project/Common/Support Files/NefCommon.h +++ b/project/UI/Common/Support Files/NefCommon.h @@ -9,5 +9,6 @@ FOUNDATION_EXPORT double CommonVersionNumber; FOUNDATION_EXPORT const unsigned char CommonVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - +#import "NefMarkdown.h" +#import "NefJekyll.h" +#import "NefCarbon.h" diff --git a/project/UI/Common/Support Files/module.modulemap b/project/UI/Common/Support Files/module.modulemap new file mode 100644 index 00000000..7b027f0f --- /dev/null +++ b/project/UI/Common/Support Files/module.modulemap @@ -0,0 +1,4 @@ +framework module Common { + umbrella header "NefCommon.h" + export * +} diff --git a/project/UI/Jekyll/ConsoleOutput.swift b/project/UI/Jekyll/ConsoleOutput.swift index b98befcc..a8b8e879 100644 --- a/project/UI/Jekyll/ConsoleOutput.swift +++ b/project/UI/Jekyll/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import NefCommon +import Common class JekyllConsole: ConsoleOutput { diff --git a/project/UI/Jekyll/main.swift b/project/UI/Jekyll/main.swift index ca23dd25..159ff034 100644 --- a/project/UI/Jekyll/main.swift +++ b/project/UI/Jekyll/main.swift @@ -1,8 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCommon -import NefJekyll +import Common let scriptName = "nef-jekyll-page" let console = JekyllConsole() diff --git a/project/UI/Markdown/ConsoleOutput.swift b/project/UI/Markdown/ConsoleOutput.swift index ed844b07..042b8599 100644 --- a/project/UI/Markdown/ConsoleOutput.swift +++ b/project/UI/Markdown/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import NefCommon +import Common class MarkdownConsole: ConsoleOutput { diff --git a/project/UI/Markdown/main.swift b/project/UI/Markdown/main.swift index a19c3dc9..e7a7c85e 100644 --- a/project/UI/Markdown/main.swift +++ b/project/UI/Markdown/main.swift @@ -1,8 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefCommon -import NefMarkdown +import Common let scriptName = "nef-markdown-page" let console = MarkdownConsole() diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 3b34247f..bf84fcec 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -8,10 +8,10 @@ /* Begin PBXBuildFile section */ 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B12D7A422D6238300D05A70 /* Jekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* Jekyll.swift */; }; + 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; 8B22247C22D4C91B00C85856 /* NSImage+Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86422D392C000919F36 /* NSImage+Store.swift */; }; - 8B22249D22D5EC6B00C85856 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85B22D392C000919F36 /* Markdown.swift */; }; + 8B22249D22D5EC6B00C85856 /* NefMarkdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85B22D392C000919F36 /* NefMarkdown.swift */; }; 8B3CB87F22D3931D00919F36 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85622D392C000919F36 /* ConsoleOutput.swift */; }; 8B3CB88022D3931D00919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85722D392C000919F36 /* main.swift */; }; 8B3CB88122D3932000919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85922D392C000919F36 /* main.swift */; }; @@ -33,7 +33,7 @@ 8B3CB8B222D394E600919F36 /* SyntaxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8AD22D394E600919F36 /* SyntaxTests.swift */; }; 8B3CB8B322D394E600919F36 /* JekyllTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8AE22D394E600919F36 /* JekyllTests.swift */; }; 8B3CB8B522D394E600919F36 /* MarkdownTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8B122D394E600919F36 /* MarkdownTests.swift */; }; - 8B3CB8B622D3963300919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84B22D3929B00919F36 /* Carbon.swift */; }; + 8B3CB8B622D3963300919F36 /* NefCarbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84B22D3929B00919F36 /* NefCarbon.swift */; }; 8B3CB8B822D3963300919F36 /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84522D3929B00919F36 /* Assets.swift */; }; 8B3CB8B922D3963300919F36 /* CarbonAssembler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84622D3929B00919F36 /* CarbonAssembler.swift */; }; 8B3CB8BA22D3963300919F36 /* CarbonSyncDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84722D3929B00919F36 /* CarbonSyncDownloader.swift */; }; @@ -49,7 +49,6 @@ 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E99237A3CFE0059C9C7 /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B603EA4237A3CFE0059C9C7 /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9B237A3CFE0059C9C7 /* Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9C237A3CFE0059C9C7 /* Carbon.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA6237A3CFE0059C9C7 /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9D237A3CFE0059C9C7 /* Markdown.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9F237A3CFE0059C9C7 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -60,47 +59,54 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */ = { + 8B0FB574237B31B900221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8B12D79A22D6235200D05A70; - remoteInfo = NefJekyll; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; }; - 8B12D7C422D6498900D05A70 /* PBXContainerItemProxy */ = { + 8B0FB576237B31E900221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; remoteInfo = Common; }; - 8B12D7C622D6498900D05A70 /* PBXContainerItemProxy */ = { + 8B0FB578237B31F000221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8B6B119322CB9FDE0060177F; - remoteInfo = Core; + remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; + remoteInfo = Common; }; - 8B12D7C822D6498F00D05A70 /* PBXContainerItemProxy */ = { + 8B0FB57A237B31F400221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; remoteInfo = Common; }; - 8B12D7CA22D6498F00D05A70 /* PBXContainerItemProxy */ = { + 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8B12D79A22D6235200D05A70; + remoteInfo = NefJekyll; + }; + 8B12D7C622D6498900D05A70 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; remoteGlobalIDString = 8B6B119322CB9FDE0060177F; remoteInfo = Core; }; - 8B27832A237979870052189A /* PBXContainerItemProxy */ = { + 8B12D7CA22D6498F00D05A70 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8B4F45A422CF9AF400E6F471; - remoteInfo = NefModels; + remoteGlobalIDString = 8B6B119322CB9FDE0060177F; + remoteInfo = Core; }; 8B4F45BC22CF9B4F00E6F471 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -109,13 +115,6 @@ remoteGlobalIDString = 8B4F45A422CF9AF400E6F471; remoteInfo = NefModels; }; - 8B6B118722CB9E8F0060177F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; - }; 8B6B118B22CB9EA20060177F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -144,45 +143,26 @@ remoteGlobalIDString = 8B6B119322CB9FDE0060177F; remoteInfo = Markup; }; - 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B22248222D5EAD500C85856; - remoteInfo = NefMarkdown; - }; - 8B99556A2379D13400C81A2A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; - remoteInfo = nef; - }; - 8B99556C2379D13A00C81A2A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; - remoteInfo = nef; - }; - 8B9955752379E0D000C81A2A /* PBXContainerItemProxy */ = { + 8B89CD72237B084E007E9152 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; - remoteInfo = nef; + remoteGlobalIDString = 8B4F45A422CF9AF400E6F471; + remoteInfo = NefModels; }; - 8BB47EEC237AC47200C6A960 /* PBXContainerItemProxy */ = { + 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = NefCommon; + remoteGlobalIDString = 8B22248222D5EAD500C85856; + remoteInfo = NefMarkdown; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 8B0CA51622AE669600181BC0 /* Carbon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Carbon; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B0FB557237B0E6200221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = "Component/nef/Support Files/module.modulemap"; sourceTree = SOURCE_ROOT; }; + 8B0FB57E237B341F00221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -200,16 +180,16 @@ 8B3CB84822D3929B00919F36 /* CarbonAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonAppDelegate.swift; sourceTree = ""; }; 8B3CB84922D3929B00919F36 /* CarbonApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonApplication.swift; sourceTree = ""; }; 8B3CB84A22D3929B00919F36 /* CarbonWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonWebView.swift; sourceTree = ""; }; - 8B3CB84B22D3929B00919F36 /* Carbon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; + 8B3CB84B22D3929B00919F36 /* NefCarbon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NefCarbon.swift; sourceTree = ""; }; 8B3CB84D22D3929B00919F36 /* NefCarbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefCarbon.h; sourceTree = ""; }; 8B3CB84E22D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB85022D3929B00919F36 /* URLQuery.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLQuery.swift; sourceTree = ""; }; 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleOutput.swift; sourceTree = ""; }; - 8B3CB85522D392C000919F36 /* Jekyll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Jekyll.swift; sourceTree = ""; }; + 8B3CB85522D392C000919F36 /* NefJekyll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NefJekyll.swift; sourceTree = ""; }; 8B3CB85622D392C000919F36 /* ConsoleOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleOutput.swift; sourceTree = ""; }; 8B3CB85722D392C000919F36 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 8B3CB85922D392C000919F36 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - 8B3CB85B22D392C000919F36 /* Markdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Markdown.swift; sourceTree = ""; }; + 8B3CB85B22D392C000919F36 /* NefMarkdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NefMarkdown.swift; sourceTree = ""; }; 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleOutput.swift; sourceTree = ""; }; 8B3CB85D22D392C000919F36 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 8B3CB85F22D392C000919F36 /* String+Path.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Path.swift"; sourceTree = ""; }; @@ -238,18 +218,16 @@ 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B603E99237A3CFE0059C9C7 /* Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; - 8B603E9B237A3CFE0059C9C7 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; 8B603E9C237A3CFE0059C9C7 /* Carbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; 8B603E9D237A3CFE0059C9C7 /* Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; - 8B603EA1237A3CFE0059C9C7 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* Jekyll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Jekyll; sourceTree = BUILT_PRODUCTS_DIR; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF53F55235F09770081C27C /* nef+helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "nef+helpers.swift"; sourceTree = ""; }; - 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCommon.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8BF75F5722CA637B00EC53A1 /* Common.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Common.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCarbon.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -269,7 +247,7 @@ 8B12D79C22D6235200D05A70 /* NefJekyll */ = { isa = PBXGroup; children = ( - 8B3CB85522D392C000919F36 /* Jekyll.swift */, + 8B3CB85522D392C000919F36 /* NefJekyll.swift */, 8B12D7A322D6236300D05A70 /* Support Files */, ); path = NefJekyll; @@ -287,7 +265,7 @@ 8B22248422D5EAD500C85856 /* NefMarkdown */ = { isa = PBXGroup; children = ( - 8B3CB85B22D392C000919F36 /* Markdown.swift */, + 8B3CB85B22D392C000919F36 /* NefMarkdown.swift */, 8B22249A22D5EAEF00C85856 /* Support Files */, ); path = NefMarkdown; @@ -329,6 +307,7 @@ children = ( 8B603E98237A3CFE0059C9C7 /* Private */, 8B603E9E237A3CFE0059C9C7 /* Public */, + 8B0FB557237B0E6200221548 /* module.modulemap */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -355,7 +334,7 @@ 8B3CB84322D3929B00919F36 /* NefCarbon */ = { isa = PBXGroup; children = ( - 8B3CB84B22D3929B00919F36 /* Carbon.swift */, + 8B3CB84B22D3929B00919F36 /* NefCarbon.swift */, 8B3CB84422D3929B00919F36 /* App */, 8B3CB84F22D3929B00919F36 /* Utils */, 8B3CB84C22D3929B00919F36 /* Support Files */, @@ -401,6 +380,7 @@ 8B3CB85A22D392C000919F36 /* Markdown */, 8B3CB85422D392C000919F36 /* Jekyll */, 8B3CB85822D392C000919F36 /* Carbon */, + 8B3CB85E22D392C000919F36 /* Common */, ); path = UI; sourceTree = ""; @@ -447,6 +427,7 @@ 8B3CB86022D392C000919F36 /* Support Files */ = { isa = PBXGroup; children = ( + 8B0FB57E237B341F00221548 /* module.modulemap */, 8B3CB86122D392C000919F36 /* NefCommon.h */, 8B3CB86222D392C000919F36 /* Info.plist */, ); @@ -536,7 +517,6 @@ children = ( 8B603E99237A3CFE0059C9C7 /* Core.h */, 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */, - 8B603E9B237A3CFE0059C9C7 /* Common.h */, 8B603E9C237A3CFE0059C9C7 /* Carbon.h */, 8B603E9D237A3CFE0059C9C7 /* Markdown.h */, ); @@ -547,7 +527,6 @@ isa = PBXGroup; children = ( 8B603E9F237A3CFE0059C9C7 /* nef.h */, - 8B603EA1237A3CFE0059C9C7 /* module.modulemap */, ); path = Public; sourceTree = ""; @@ -558,7 +537,6 @@ 8B3CB85322D392C000919F36 /* UI */, 8B3CB83822D3929B00919F36 /* Component */, 8B3CB88B22D393C300919F36 /* Core */, - 8B3CB85E22D392C000919F36 /* Common */, 8B3CB8AB22D394E600919F36 /* Tests */, 8B6FC656221EFF03008F7694 /* Frameworks */, 8B6FC586221ECE6A008F7694 /* Products */, @@ -571,7 +549,7 @@ 8B6FC585221ECE6A008F7694 /* Jekyll */, 8B424B1F224E28FC00AF9010 /* Markdown */, 8B0CA51622AE669600181BC0 /* Carbon */, - 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */, + 8BF75F5722CA637B00EC53A1 /* Common.framework */, 8BF75F8522CA71E700EC53A1 /* nef.framework */, 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */, 8B6B119422CB9FDE0060177F /* NefCore.framework */, @@ -642,7 +620,6 @@ 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */, 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */, 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */, - 8B603EA4237A3CFE0059C9C7 /* Common.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -666,7 +643,7 @@ buildRules = ( ); dependencies = ( - 8B99556D2379D13A00C81A2A /* PBXTargetDependency */, + 8B0FB57B237B31F400221548 /* PBXTargetDependency */, ); name = Carbon; productName = Carbon; @@ -684,7 +661,6 @@ ); dependencies = ( 8B12D7C722D6498900D05A70 /* PBXTargetDependency */, - 8B12D7C522D6498900D05A70 /* PBXTargetDependency */, ); name = NefJekyll; productName = NefJekyll; @@ -702,7 +678,6 @@ ); dependencies = ( 8B12D7CB22D6498F00D05A70 /* PBXTargetDependency */, - 8B12D7C922D6498F00D05A70 /* PBXTargetDependency */, ); name = NefMarkdown; productName = NefMarkdown; @@ -718,7 +693,7 @@ buildRules = ( ); dependencies = ( - 8B9955762379E0D000C81A2A /* PBXTargetDependency */, + 8B0FB577237B31E900221548 /* PBXTargetDependency */, ); name = Markdown; productName = Markdown; @@ -785,16 +760,16 @@ buildRules = ( ); dependencies = ( - 8B99556B2379D13400C81A2A /* PBXTargetDependency */, + 8B0FB579237B31F000221548 /* PBXTargetDependency */, ); name = Jekyll; productName = JekyllMarkdown; productReference = 8B6FC585221ECE6A008F7694 /* Jekyll */; productType = "com.apple.product-type.tool"; }; - 8BF75F5622CA637B00EC53A1 /* NefCommon */ = { + 8BF75F5622CA637B00EC53A1 /* Common */ = { isa = PBXNativeTarget; - buildConfigurationList = 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "NefCommon" */; + buildConfigurationList = 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */; buildPhases = ( 8BF75F5222CA637B00EC53A1 /* Headers */, 8BF75F5322CA637B00EC53A1 /* Sources */, @@ -802,10 +777,11 @@ buildRules = ( ); dependencies = ( + 8B0FB575237B31B900221548 /* PBXTargetDependency */, ); - name = NefCommon; + name = Common; productName = Common; - productReference = 8BF75F5722CA637B00EC53A1 /* NefCommon.framework */; + productReference = 8BF75F5722CA637B00EC53A1 /* Common.framework */; productType = "com.apple.product-type.framework"; }; 8BF75F8422CA71E700EC53A1 /* nef */ = { @@ -819,8 +795,7 @@ ); dependencies = ( 8B6B11BD22CBA1770060177F /* PBXTargetDependency */, - 8B27832B237979870052189A /* PBXTargetDependency */, - 8BB47EED237AC47200C6A960 /* PBXTargetDependency */, + 8B89CD73237B084E007E9152 /* PBXTargetDependency */, 8B8AA94022D62266006BE290 /* PBXTargetDependency */, 8B12D7A622D624D900D05A70 /* PBXTargetDependency */, 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, @@ -841,7 +816,6 @@ ); dependencies = ( 8B6B11BB22CBA1710060177F /* PBXTargetDependency */, - 8B6B118822CB9E8F0060177F /* PBXTargetDependency */, ); name = NefCarbon; productName = NefCarbon; @@ -912,13 +886,13 @@ 8B424B1E224E28FC00AF9010 /* Markdown */, 8B6FC584221ECE6A008F7694 /* Jekyll */, 8B0CA51522AE669600181BC0 /* Carbon */, + 8BF75F5622CA637B00EC53A1 /* Common */, 8BF75F8422CA71E700EC53A1 /* nef */, 8B22248222D5EAD500C85856 /* NefMarkdown */, 8B12D79A22D6235200D05A70 /* NefJekyll */, 8BF75FC522CA7DA500EC53A1 /* NefCarbon */, - 8B4F45A422CF9AF400E6F471 /* NefModels */, - 8BF75F5622CA637B00EC53A1 /* NefCommon */, 8B6B119322CB9FDE0060177F /* NefCore */, + 8B4F45A422CF9AF400E6F471 /* NefModels */, 8B6B119B22CB9FDE0060177F /* CoreTests */, ); }; @@ -948,7 +922,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B12D7A422D6238300D05A70 /* Jekyll.swift in Sources */, + 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -956,7 +930,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B22249D22D5EC6B00C85856 /* Markdown.swift in Sources */, + 8B22249D22D5EC6B00C85856 /* NefMarkdown.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1038,7 +1012,7 @@ files = ( 8B3CB8BA22D3963300919F36 /* CarbonSyncDownloader.swift in Sources */, 8B3CB8BC22D3963300919F36 /* CarbonApplication.swift in Sources */, - 8B3CB8B622D3963300919F36 /* Carbon.swift in Sources */, + 8B3CB8B622D3963300919F36 /* NefCarbon.swift in Sources */, 8B3CB8BD22D3963300919F36 /* CarbonWebView.swift in Sources */, 8B3CB8BB22D3963300919F36 /* CarbonAppDelegate.swift in Sources */, 8B3CB8BE22D3963300919F36 /* URLQuery.swift in Sources */, @@ -1052,46 +1026,46 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 8B0FB575237B31B900221548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B0FB574237B31B900221548 /* PBXContainerItemProxy */; + }; + 8B0FB577237B31E900221548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F5622CA637B00EC53A1 /* Common */; + targetProxy = 8B0FB576237B31E900221548 /* PBXContainerItemProxy */; + }; + 8B0FB579237B31F000221548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F5622CA637B00EC53A1 /* Common */; + targetProxy = 8B0FB578237B31F000221548 /* PBXContainerItemProxy */; + }; + 8B0FB57B237B31F400221548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F5622CA637B00EC53A1 /* Common */; + targetProxy = 8B0FB57A237B31F400221548 /* PBXContainerItemProxy */; + }; 8B12D7A622D624D900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B12D79A22D6235200D05A70 /* NefJekyll */; targetProxy = 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */; }; - 8B12D7C522D6498900D05A70 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B12D7C422D6498900D05A70 /* PBXContainerItemProxy */; - }; 8B12D7C722D6498900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B12D7C622D6498900D05A70 /* PBXContainerItemProxy */; }; - 8B12D7C922D6498F00D05A70 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B12D7C822D6498F00D05A70 /* PBXContainerItemProxy */; - }; 8B12D7CB22D6498F00D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B12D7CA22D6498F00D05A70 /* PBXContainerItemProxy */; }; - 8B27832B237979870052189A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B4F45A422CF9AF400E6F471 /* NefModels */; - targetProxy = 8B27832A237979870052189A /* PBXContainerItemProxy */; - }; 8B4F45BD22CF9B4F00E6F471 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B4F45A422CF9AF400E6F471 /* NefModels */; targetProxy = 8B4F45BC22CF9B4F00E6F471 /* PBXContainerItemProxy */; }; - 8B6B118822CB9E8F0060177F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8B6B118722CB9E8F0060177F /* PBXContainerItemProxy */; - }; 8B6B118C22CB9EA20060177F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8BF75FC522CA7DA500EC53A1 /* NefCarbon */; @@ -1112,31 +1086,16 @@ target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11BC22CBA1770060177F /* PBXContainerItemProxy */; }; + 8B89CD73237B084E007E9152 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8B4F45A422CF9AF400E6F471 /* NefModels */; + targetProxy = 8B89CD72237B084E007E9152 /* PBXContainerItemProxy */; + }; 8B8AA94022D62266006BE290 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B22248222D5EAD500C85856 /* NefMarkdown */; targetProxy = 8B8AA93F22D62266006BE290 /* PBXContainerItemProxy */; }; - 8B99556B2379D13400C81A2A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F8422CA71E700EC53A1 /* nef */; - targetProxy = 8B99556A2379D13400C81A2A /* PBXContainerItemProxy */; - }; - 8B99556D2379D13A00C81A2A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F8422CA71E700EC53A1 /* nef */; - targetProxy = 8B99556C2379D13A00C81A2A /* PBXContainerItemProxy */; - }; - 8B9955762379E0D000C81A2A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F8422CA71E700EC53A1 /* nef */; - targetProxy = 8B9955752379E0D000C81A2A /* PBXContainerItemProxy */; - }; - 8BB47EED237AC47200C6A960 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* NefCommon */; - targetProxy = 8BB47EEC237AC47200C6A960 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -1146,6 +1105,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Carbon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1157,6 +1117,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; FRAMEWORK_SEARCH_PATHS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Carbon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1277,8 +1238,11 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Markdown; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1289,8 +1253,11 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Markdown; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -1567,6 +1534,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_OPTIMIZATION_LEVEL = 0; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Jekyll; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -1581,6 +1549,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_OPTIMIZATION_LEVEL = 0; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Jekyll; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -1598,13 +1567,14 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Common/Support Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/UI/Common/Support Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "${SRCROOT}/UI/Common/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Common; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1625,13 +1595,14 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Common/Support Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/UI/Common/Support Files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "${SRCROOT}/UI/Common/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Common; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1659,7 +1630,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/Public/module.modulemap"; + MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1688,7 +1659,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/Public/module.modulemap"; + MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1838,7 +1809,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "NefCommon" */ = { + 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */ = { isa = XCConfigurationList; buildConfigurations = ( 8BF75F6822CA637B00EC53A1 /* Debug */, From 275efba2cf08eb719dd3c98b32199e34d951a1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Tue, 12 Nov 2019 19:53:09 +0100 Subject: [PATCH 04/20] minor changes --- Package.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 87b6ca2c..5d6c11c2 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,8 @@ let package = Package( "Component/NefModels", "Component/NefMarkdown", "Component/NefJekyll", - "Component/NefCarbon"]), + "Component/NefCarbon"], + publicHeadersPath: "Component/nef/Support Files"), .testTarget(name: "CoreTests", dependencies: ["nef"], path: "project/Tests/CoreTests"), From f1434cda2d0a9bc4e7730437718d16603dc4c749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 12:10:45 +0100 Subject: [PATCH 05/20] Re-structure API to nef library minor changes --- .gitignore | 1 + Package.swift | 3 - project/Component/nef/API.swift | 56 +++ project/Component/nef/Page.swift | 31 ++ project/Component/nef/Render.swift | 69 ++++ project/Component/nef/nef+helpers.swift | 46 --- project/Component/nef/nef.swift | 99 ----- project/Package.swift | 18 +- .../UI/{Common => CLIKit}/Array+Slice.swift | 0 .../UI/{Common => CLIKit}/ConsoleReader.swift | 0 .../{Common => CLIKit}/PlaygroundUtils.swift | 0 .../UI/{Common => CLIKit}/String+Path.swift | 0 project/UI/CLIKit/Support Files/CLIKit.h | 15 + .../Support Files/Info.plist | 4 +- .../UI/CLIKit/Support Files/module.modulemap | 4 + .../ConsoleOutput.swift | 2 +- project/UI/{Carbon => CarbonPage}/main.swift | 2 +- project/UI/Common/Support Files/NefCommon.h | 14 - .../UI/Common/Support Files/module.modulemap | 4 - .../ConsoleOutput.swift | 2 +- project/UI/{Jekyll => JekyllPage}/main.swift | 2 +- .../ConsoleOutput.swift | 2 +- .../UI/{Markdown => MarkdownPage}/main.swift | 2 +- project/nef.xcodeproj/project.pbxproj | 364 +++++++++--------- 24 files changed, 379 insertions(+), 361 deletions(-) create mode 100644 project/Component/nef/API.swift create mode 100644 project/Component/nef/Page.swift create mode 100644 project/Component/nef/Render.swift delete mode 100644 project/Component/nef/nef+helpers.swift delete mode 100644 project/Component/nef/nef.swift rename project/UI/{Common => CLIKit}/Array+Slice.swift (100%) rename project/UI/{Common => CLIKit}/ConsoleReader.swift (100%) rename project/UI/{Common => CLIKit}/PlaygroundUtils.swift (100%) rename project/UI/{Common => CLIKit}/String+Path.swift (100%) create mode 100644 project/UI/CLIKit/Support Files/CLIKit.h rename project/UI/{Common => CLIKit}/Support Files/Info.plist (86%) create mode 100644 project/UI/CLIKit/Support Files/module.modulemap rename project/UI/{Carbon => CarbonPage}/ConsoleOutput.swift (97%) rename project/UI/{Carbon => CarbonPage}/main.swift (99%) delete mode 100644 project/UI/Common/Support Files/NefCommon.h delete mode 100644 project/UI/Common/Support Files/module.modulemap rename project/UI/{Jekyll => JekyllPage}/ConsoleOutput.swift (98%) rename project/UI/{Jekyll => JekyllPage}/main.swift (99%) rename project/UI/{Markdown => MarkdownPage}/ConsoleOutput.swift (98%) rename project/UI/{Markdown => MarkdownPage}/main.swift (98%) diff --git a/.gitignore b/.gitignore index 756b1790..4a1fbbfa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ BowPlayground .build .swiftpm +bin-cli ## Jekyll _site diff --git a/Package.swift b/Package.swift index 5d6c11c2..494a6e50 100644 --- a/Package.swift +++ b/Package.swift @@ -19,8 +19,5 @@ let package = Package( "Component/NefJekyll", "Component/NefCarbon"], publicHeadersPath: "Component/nef/Support Files"), - - - .testTarget(name: "CoreTests", dependencies: ["nef"], path: "project/Tests/CoreTests"), ] ) diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift new file mode 100644 index 00000000..da61c4e0 --- /dev/null +++ b/project/Component/nef/API.swift @@ -0,0 +1,56 @@ +// Copyright © 2019 The nef Authors. + +import Foundation + +public enum Render: RenderAPI { + case api + public enum Page: PageAPI { + case api + } +} + + +public protocol RenderAPI { + /// Renders a code selection into multiple Carbon images. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - code: content to generate the snippet. + /// - style: style to apply to exported code snippet. + /// - outputPath: output where to render the snippets. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) + + /// Get an URL Request given a carbon configuration + /// + /// - Parameter carbon: configuration + /// - Returns: URL request to carbon.now.sh + func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest +} + +public protocol PageAPI { + /// Renders content into Markdown file. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - outputPath: output where to write the Markdown render. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) + + /// Renders content into Jekyll format. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - outputPath: output where to write the Markdown render. + /// - permalink: website relative url where locate the page. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) +} diff --git a/project/Component/nef/Page.swift b/project/Component/nef/Page.swift new file mode 100644 index 00000000..6034286c --- /dev/null +++ b/project/Component/nef/Page.swift @@ -0,0 +1,31 @@ +// Copyright © 2019 The nef Authors. + +import NefMarkdown +import NefJekyll +import NefCarbon + + +public extension PageAPI { + func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("markdown(content:outputPath:success:failure:) should be invoked in main thread") + } + + renderMarkdown(content: content, + to: outputPath, + success: success, + failure: failure) + } + + func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("jekyll(content:outputPath:permalink:success:failure:) should be invoked in main thread") + } + + renderJekyll(content: content, + to: outputPath, + permalink: permalink, + success: success, + failure: failure) + } +} diff --git a/project/Component/nef/Render.swift b/project/Component/nef/Render.swift new file mode 100644 index 00000000..bad149fe --- /dev/null +++ b/project/Component/nef/Render.swift @@ -0,0 +1,69 @@ +// Copyright © 2019 The nef Authors. + +import NefMarkdown +import NefJekyll +import NefCarbon + + +public extension RenderAPI { + func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("carbon(code:style:outputPath:success:failure:) should be invoked in main thread") + } + + let assembler = CarbonAssembler() + let window = assembler.resolveWindow() + let view = window.contentView! + let retainSuccess = { success(); _ = view } + let retainFailure = { (output: String) in failure(output); _ = view } + + carbon(parentView: view, + code: code, + style: style, + outputPath: outputPath, + success: retainSuccess, failure: retainFailure) + } + + func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest { CarbonViewer.urlRequest(from: carbon) } +} + + +// MARK: - Helpers +internal extension RenderAPI { + + /// Renders a code selection into multiple Carbon images. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - parentView: canvas view where to render Carbon image. + /// - code: content to generate the snippet. + /// - style: style to apply to exported code snippet. + /// - outputPath: output where to render the snippets. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + func carbon(parentView: NSView, + code: String, + style: CarbonStyle, + outputPath: String, + success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("carbon(parentView:code:style:outputPath:success:failure:) should be invoked in main thread") + } + + let assembler = CarbonAssembler() + let carbonView = assembler.resolveCarbonView(frame: parentView.bounds) + let downloader = assembler.resolveCarbonDownloader(view: carbonView, multiFiles: false) + + parentView.addSubview(carbonView) + + DispatchQueue(label: "nef-framework", qos: .userInitiated).async { + renderCarbon(downloader: downloader, + code: "\(code)\n", + style: style, + outputPath: outputPath, + success: success, + failure: failure) + } + } +} diff --git a/project/Component/nef/nef+helpers.swift b/project/Component/nef/nef+helpers.swift deleted file mode 100644 index 46308516..00000000 --- a/project/Component/nef/nef+helpers.swift +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright © 2019 The nef Authors. - -import AppKit - -import NefMarkdown -import NefJekyll -import NefCarbon - - -// MARK: - Carbon - -/// Renders a code selection into multiple Carbon images. -/// -/// - Precondition: this method must be invoked from main thread. -/// -/// - Parameters: -/// - parentView: canvas view where to render Carbon image. -/// - code: content to generate the snippet. -/// - style: style to apply to exported code snippet. -/// - outputPath: output where to render the snippets. -/// - success: callback to notify if everything goes well. -/// - failure: callback with information to notify if something goes wrong. -internal func carbon(parentView: NSView, - code: String, - style: CarbonStyle, - outputPath: String, - success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("carbon(parentView:code:style:outputPath:success:failure:) should be invoked in main thread") - } - - let assembler = CarbonAssembler() - let carbonView = assembler.resolveCarbonView(frame: parentView.bounds) - let downloader = assembler.resolveCarbonDownloader(view: carbonView, multiFiles: false) - - parentView.addSubview(carbonView) - - DispatchQueue(label: "nef-framework", qos: .userInitiated).async { - renderCarbon(downloader: downloader, - code: "\(code)\n", - style: style, - outputPath: outputPath, - success: success, - failure: failure) - } -} diff --git a/project/Component/nef/nef.swift b/project/Component/nef/nef.swift deleted file mode 100644 index 75a01c48..00000000 --- a/project/Component/nef/nef.swift +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright © 2019 The nef Authors. - -import AppKit - -import NefMarkdown -import NefJekyll -import NefCarbon - - -// MARK: - Markdown - -/// Renders content into Markdown files. -/// -/// - Precondition: this method must be invoked from main thread. -/// -/// - Parameters: -/// - content: content page in Xcode playground. -/// - outputPath: output where to write the Markdown render. -/// - success: callback to notify if everything goes well. -/// - failure: callback with information to notify if something goes wrong. -public func markdown(content: String, to outputPath: String, - success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("markdown(content:outputPath:success:failure:) should be invoked in main thread") - } - - renderMarkdown(content: content, - to: outputPath, - success: success, - failure: failure) -} - - -// MARK: - Jekyll - -/// Renders content into Jekyll format. -/// -/// - Precondition: this method must be invoked from main thread. -/// -/// - Parameters: -/// - content: content page in Xcode playground. -/// - outputPath: output where to write the Markdown render. -/// - permalink: website relative url where locate the page. -/// - success: callback to notify if everything goes well. -/// - failure: callback with information to notify if something goes wrong. -public func jekyll(content: String, to outputPath: String, permalink: String, - success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("jekyll(content:outputPath:permalink:success:failure:) should be invoked in main thread") - } - - renderJekyll(content: content, - to: outputPath, - permalink: permalink, - success: success, - failure: failure) -} - - -// MARK: - Carbon - -/// Renders a code selection into multiple Carbon images. -/// -/// - Precondition: this method must be invoked from main thread. -/// -/// - Parameters: -/// - code: content to generate the snippet. -/// - style: style to apply to exported code snippet. -/// - outputPath: output where to render the snippets. -/// - success: callback to notify if everything goes well. -/// - failure: callback with information to notify if something goes wrong. -public func carbon(code: String, - style: CarbonStyle, - outputPath: String, - success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("carbon(code:style:outputPath:success:failure:) should be invoked in main thread") - } - - let assembler = CarbonAssembler() - let window = assembler.resolveWindow() - let view = window.contentView! - let retainSuccess = { success(); _ = view } - let retainFailure = { (output: String) in failure(output); _ = view } - - carbon(parentView: view, - code: code, - style: style, - outputPath: outputPath, - success: retainSuccess, failure: retainFailure) -} - -/// Get an URL Request given a carbon configuration -/// -/// - Parameter carbon: configuration -/// - Returns: URL request to carbon.now.sh -public func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest { - return CarbonViewer.urlRequest(from: carbon) -} diff --git a/project/Package.swift b/project/Package.swift index d29955a1..ed925f49 100644 --- a/project/Package.swift +++ b/project/Package.swift @@ -7,20 +7,20 @@ let package = Package( .macOS(.v10_14), ], products: [ - .executable(name: "nef-markdown-page", targets: ["Markdown"]), - .executable(name: "nef-jekyll-page", targets: ["Jekyll"]), - .executable(name: "nef-carbon-page", targets: ["Carbon"]), + .executable(name: "nef-markdown-page", targets: ["MarkdownPage"]), + .executable(name: "nef-jekyll-page", targets: ["JekyllPage"]), + .executable(name: "nef-carbon-page", targets: ["CarbonPage"]), ], targets: [ - .target(name: "Common", path: ".", sources: ["Component/NefMarkdown", + .target(name: "CLIKit", path: ".", sources: ["Component/NefMarkdown", "Component/NefJekyll", "Component/NefCarbon", - "UI/Common", "Component/NefModels", - "Core"], publicHeadersPath: "UI/Common/Support Files"), + "UI/CLIKit", + "Core"], publicHeadersPath: "UI/CLIKit/Support Files"), - .target(name: "Markdown", dependencies: ["Common"], path: ".", sources: ["UI/Markdown"]), - .target(name: "Jekyll", dependencies: ["Common"], path: ".", sources: ["UI/Jekyll"]), - .target(name: "Carbon", dependencies: ["Common"], path: ".", sources: ["UI/Carbon"]), + .target(name: "MarkdownPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/MarkdownPage"]), + .target(name: "JekyllPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/JekyllPage"]), + .target(name: "CarbonPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/CarbonPage"]), ] ) diff --git a/project/UI/Common/Array+Slice.swift b/project/UI/CLIKit/Array+Slice.swift similarity index 100% rename from project/UI/Common/Array+Slice.swift rename to project/UI/CLIKit/Array+Slice.swift diff --git a/project/UI/Common/ConsoleReader.swift b/project/UI/CLIKit/ConsoleReader.swift similarity index 100% rename from project/UI/Common/ConsoleReader.swift rename to project/UI/CLIKit/ConsoleReader.swift diff --git a/project/UI/Common/PlaygroundUtils.swift b/project/UI/CLIKit/PlaygroundUtils.swift similarity index 100% rename from project/UI/Common/PlaygroundUtils.swift rename to project/UI/CLIKit/PlaygroundUtils.swift diff --git a/project/UI/Common/String+Path.swift b/project/UI/CLIKit/String+Path.swift similarity index 100% rename from project/UI/Common/String+Path.swift rename to project/UI/CLIKit/String+Path.swift diff --git a/project/UI/CLIKit/Support Files/CLIKit.h b/project/UI/CLIKit/Support Files/CLIKit.h new file mode 100644 index 00000000..d7a6eafb --- /dev/null +++ b/project/UI/CLIKit/Support Files/CLIKit.h @@ -0,0 +1,15 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for CLI. +FOUNDATION_EXPORT double CLIVersionNumber; + +//! Project version string for CLI. +FOUNDATION_EXPORT const unsigned char CLIVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefMarkdown.h" +#import "NefJekyll.h" +#import "NefCarbon.h" + diff --git a/project/UI/Common/Support Files/Info.plist b/project/UI/CLIKit/Support Files/Info.plist similarity index 86% rename from project/UI/Common/Support Files/Info.plist rename to project/UI/CLIKit/Support Files/Info.plist index 560fdc22..847da824 100644 --- a/project/UI/Common/Support Files/Info.plist +++ b/project/UI/CLIKit/Support Files/Info.plist @@ -13,12 +13,12 @@ CFBundleName $(PRODUCT_NAME) CFBundlePackageType - FMWK + $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString 1.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Copyright © 2019 The nef Authors. + Copyright © 2019 47 Degrees. All rights reserved. diff --git a/project/UI/CLIKit/Support Files/module.modulemap b/project/UI/CLIKit/Support Files/module.modulemap new file mode 100644 index 00000000..94b7024a --- /dev/null +++ b/project/UI/CLIKit/Support Files/module.modulemap @@ -0,0 +1,4 @@ +framework module CLIKit { + umbrella header "CLIKit.h" + export * +} diff --git a/project/UI/Carbon/ConsoleOutput.swift b/project/UI/CarbonPage/ConsoleOutput.swift similarity index 97% rename from project/UI/Carbon/ConsoleOutput.swift rename to project/UI/CarbonPage/ConsoleOutput.swift index b8c5c848..22175224 100644 --- a/project/UI/Carbon/ConsoleOutput.swift +++ b/project/UI/CarbonPage/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import Common +import CLIKit public class CarbonOutput: ConsoleOutput { diff --git a/project/UI/Carbon/main.swift b/project/UI/CarbonPage/main.swift similarity index 99% rename from project/UI/Carbon/main.swift rename to project/UI/CarbonPage/main.swift index 86846cc1..8c4c0864 100644 --- a/project/UI/Carbon/main.swift +++ b/project/UI/CarbonPage/main.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import CLIKit let scriptName = "nef-carbon-page" let console = CarbonOutput() diff --git a/project/UI/Common/Support Files/NefCommon.h b/project/UI/Common/Support Files/NefCommon.h deleted file mode 100644 index e3639444..00000000 --- a/project/UI/Common/Support Files/NefCommon.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for Common. -FOUNDATION_EXPORT double CommonVersionNumber; - -//! Project version string for Common. -FOUNDATION_EXPORT const unsigned char CommonVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefMarkdown.h" -#import "NefJekyll.h" -#import "NefCarbon.h" diff --git a/project/UI/Common/Support Files/module.modulemap b/project/UI/Common/Support Files/module.modulemap deleted file mode 100644 index 7b027f0f..00000000 --- a/project/UI/Common/Support Files/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -framework module Common { - umbrella header "NefCommon.h" - export * -} diff --git a/project/UI/Jekyll/ConsoleOutput.swift b/project/UI/JekyllPage/ConsoleOutput.swift similarity index 98% rename from project/UI/Jekyll/ConsoleOutput.swift rename to project/UI/JekyllPage/ConsoleOutput.swift index a8b8e879..7b32a157 100644 --- a/project/UI/Jekyll/ConsoleOutput.swift +++ b/project/UI/JekyllPage/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import Common +import CLIKit class JekyllConsole: ConsoleOutput { diff --git a/project/UI/Jekyll/main.swift b/project/UI/JekyllPage/main.swift similarity index 99% rename from project/UI/Jekyll/main.swift rename to project/UI/JekyllPage/main.swift index 159ff034..f56d2ee0 100644 --- a/project/UI/Jekyll/main.swift +++ b/project/UI/JekyllPage/main.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import CLIKit let scriptName = "nef-jekyll-page" let console = JekyllConsole() diff --git a/project/UI/Markdown/ConsoleOutput.swift b/project/UI/MarkdownPage/ConsoleOutput.swift similarity index 98% rename from project/UI/Markdown/ConsoleOutput.swift rename to project/UI/MarkdownPage/ConsoleOutput.swift index 042b8599..e61cc63a 100644 --- a/project/UI/Markdown/ConsoleOutput.swift +++ b/project/UI/MarkdownPage/ConsoleOutput.swift @@ -1,6 +1,6 @@ // Copyright © 2019 The nef Authors. -import Common +import CLIKit class MarkdownConsole: ConsoleOutput { diff --git a/project/UI/Markdown/main.swift b/project/UI/MarkdownPage/main.swift similarity index 98% rename from project/UI/Markdown/main.swift rename to project/UI/MarkdownPage/main.swift index e7a7c85e..4f0cc87d 100644 --- a/project/UI/Markdown/main.swift +++ b/project/UI/MarkdownPage/main.swift @@ -1,7 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation -import Common +import CLIKit let scriptName = "nef-markdown-page" let console = MarkdownConsole() diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index bf84fcec..1f7c857b 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -7,6 +7,13 @@ objects = { /* Begin PBXBuildFile section */ + 8B0FB588237C0A5600221548 /* CLIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB586237C0A5600221548 /* CLIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB599237C0B9A00221548 /* PlaygroundUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */; }; + 8B0FB59A237C0B9A00221548 /* ConsoleReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86322D392C000919F36 /* ConsoleReader.swift */; }; + 8B0FB59B237C0B9A00221548 /* Array+Slice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86622D392C000919F36 /* Array+Slice.swift */; }; + 8B0FB59C237C0B9A00221548 /* String+Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85F22D392C000919F36 /* String+Path.swift */; }; + 8B0FB59E237C0EF000221548 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB59D237C0EF000221548 /* API.swift */; }; + 8B0FB5A2237C1AC700221548 /* Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5A1237C1AC700221548 /* Page.swift */; }; 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; @@ -17,10 +24,6 @@ 8B3CB88122D3932000919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85922D392C000919F36 /* main.swift */; }; 8B3CB88322D3932400919F36 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */; }; 8B3CB88422D3932400919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85D22D392C000919F36 /* main.swift */; }; - 8B3CB88522D3933D00919F36 /* String+Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85F22D392C000919F36 /* String+Path.swift */; }; - 8B3CB88622D3933D00919F36 /* ConsoleReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86322D392C000919F36 /* ConsoleReader.swift */; }; - 8B3CB88822D3933D00919F36 /* PlaygroundUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */; }; - 8B3CB88922D3933D00919F36 /* Array+Slice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86622D392C000919F36 /* Array+Slice.swift */; }; 8B3CB8A122D393F100919F36 /* Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89322D393C300919F36 /* Render.swift */; }; 8B3CB8A222D393F100919F36 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89422D393C300919F36 /* Markdown.swift */; }; 8B3CB8A322D393F100919F36 /* Node+Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89522D393C300919F36 /* Node+Render.swift */; }; @@ -44,8 +47,7 @@ 8B3CB8BF22D3963300919F36 /* NefCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84D22D3929B00919F36 /* NefCarbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C022D3963B00919F36 /* CarbonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84222D3929B00919F36 /* CarbonModel.swift */; }; 8B3CB8C122D3963B00919F36 /* NefModels.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84022D3929B00919F36 /* NefModels.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B3CB8C222D3964000919F36 /* nef.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* nef.swift */; }; - 8B3CB8C622D396E300919F36 /* NefCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB86122D392C000919F36 /* NefCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B3CB8C222D3964000919F36 /* Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* Render.swift */; }; 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E99237A3CFE0059C9C7 /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -55,37 +57,36 @@ 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8BCDC72022F0455D00174A19 /* CarbonViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */; }; - 8BF53F56235F09780081C27C /* nef+helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BF53F55235F09770081C27C /* nef+helpers.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 8B0FB574237B31B900221548 /* PBXContainerItemProxy */ = { + 8B0FB58F237C0AEB00221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; remoteInfo = nef; }; - 8B0FB576237B31E900221548 /* PBXContainerItemProxy */ = { + 8B0FB593237C0B6C00221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; + remoteGlobalIDString = 8B0FB583237C0A5600221548; + remoteInfo = CLI; }; - 8B0FB578237B31F000221548 /* PBXContainerItemProxy */ = { + 8B0FB595237C0B6F00221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; + remoteGlobalIDString = 8B0FB583237C0A5600221548; + remoteInfo = CLI; }; - 8B0FB57A237B31F400221548 /* PBXContainerItemProxy */ = { + 8B0FB597237C0B7100221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8BF75F5622CA637B00EC53A1; - remoteInfo = Common; + remoteGlobalIDString = 8B0FB583237C0A5600221548; + remoteInfo = CLI; }; 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -163,13 +164,18 @@ 8B0CA51622AE669600181BC0 /* Carbon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Carbon; sourceTree = BUILT_PRODUCTS_DIR; }; 8B0FB557237B0E6200221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = "Component/nef/Support Files/module.modulemap"; sourceTree = SOURCE_ROOT; }; 8B0FB57E237B341F00221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; + 8B0FB584237C0A5600221548 /* CLIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CLIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B0FB586237C0A5600221548 /* CLIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLIKit.h; sourceTree = ""; }; + 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; + 8B0FB5A1237C1AC700221548 /* Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Page.swift; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B22248322D5EAD500C85856 /* NefMarkdown.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefMarkdown.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B22248522D5EAD600C85856 /* NefMarkdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefMarkdown.h; sourceTree = ""; }; 8B22248622D5EAD600C85856 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8B3CB83A22D3929B00919F36 /* nef.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = nef.swift; sourceTree = ""; }; + 8B3CB83A22D3929B00919F36 /* Render.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Render.swift; sourceTree = ""; }; 8B3CB83D22D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB84022D3929B00919F36 /* NefModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefModels.h; sourceTree = ""; }; 8B3CB84122D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -193,8 +199,6 @@ 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleOutput.swift; sourceTree = ""; }; 8B3CB85D22D392C000919F36 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 8B3CB85F22D392C000919F36 /* String+Path.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Path.swift"; sourceTree = ""; }; - 8B3CB86122D392C000919F36 /* NefCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefCommon.h; sourceTree = ""; }; - 8B3CB86222D392C000919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB86322D392C000919F36 /* ConsoleReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleReader.swift; sourceTree = ""; }; 8B3CB86422D392C000919F36 /* NSImage+Store.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Store.swift"; sourceTree = ""; }; 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaygroundUtils.swift; sourceTree = ""; }; @@ -226,8 +230,6 @@ 8B6FC585221ECE6A008F7694 /* Jekyll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Jekyll; sourceTree = BUILT_PRODUCTS_DIR; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; - 8BF53F55235F09770081C27C /* nef+helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "nef+helpers.swift"; sourceTree = ""; }; - 8BF75F5722CA637B00EC53A1 /* Common.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Common.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCarbon.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -244,6 +246,28 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 8B0FB585237C0A5600221548 /* CLIKit */ = { + isa = PBXGroup; + children = ( + 8B3CB85F22D392C000919F36 /* String+Path.swift */, + 8B3CB86322D392C000919F36 /* ConsoleReader.swift */, + 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */, + 8B3CB86622D392C000919F36 /* Array+Slice.swift */, + 8B0FB58E237C0A8F00221548 /* Support Files */, + ); + path = CLIKit; + sourceTree = ""; + }; + 8B0FB58E237C0A8F00221548 /* Support Files */ = { + isa = PBXGroup; + children = ( + 8B0FB57E237B341F00221548 /* module.modulemap */, + 8B0FB586237C0A5600221548 /* CLIKit.h */, + 8B0FB587237C0A5600221548 /* Info.plist */, + ); + path = "Support Files"; + sourceTree = ""; + }; 8B12D79C22D6235200D05A70 /* NefJekyll */ = { isa = PBXGroup; children = ( @@ -295,8 +319,9 @@ 8B3CB83922D3929B00919F36 /* nef */ = { isa = PBXGroup; children = ( - 8B3CB83A22D3929B00919F36 /* nef.swift */, - 8BF53F55235F09770081C27C /* nef+helpers.swift */, + 8B0FB59D237C0EF000221548 /* API.swift */, + 8B3CB83A22D3929B00919F36 /* Render.swift */, + 8B0FB5A1237C1AC700221548 /* Page.swift */, 8B3CB83B22D3929B00919F36 /* Support Files */, ); path = nef; @@ -377,61 +402,39 @@ 8B3CB85322D392C000919F36 /* UI */ = { isa = PBXGroup; children = ( - 8B3CB85A22D392C000919F36 /* Markdown */, - 8B3CB85422D392C000919F36 /* Jekyll */, - 8B3CB85822D392C000919F36 /* Carbon */, - 8B3CB85E22D392C000919F36 /* Common */, + 8B3CB85A22D392C000919F36 /* MarkdownPage */, + 8B3CB85422D392C000919F36 /* JekyllPage */, + 8B3CB85822D392C000919F36 /* CarbonPage */, + 8B0FB585237C0A5600221548 /* CLIKit */, ); path = UI; sourceTree = ""; }; - 8B3CB85422D392C000919F36 /* Jekyll */ = { + 8B3CB85422D392C000919F36 /* JekyllPage */ = { isa = PBXGroup; children = ( 8B3CB85722D392C000919F36 /* main.swift */, 8B3CB85622D392C000919F36 /* ConsoleOutput.swift */, ); - path = Jekyll; + path = JekyllPage; sourceTree = ""; }; - 8B3CB85822D392C000919F36 /* Carbon */ = { + 8B3CB85822D392C000919F36 /* CarbonPage */ = { isa = PBXGroup; children = ( 8B3CB85922D392C000919F36 /* main.swift */, 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */, ); - path = Carbon; + path = CarbonPage; sourceTree = ""; }; - 8B3CB85A22D392C000919F36 /* Markdown */ = { + 8B3CB85A22D392C000919F36 /* MarkdownPage */ = { isa = PBXGroup; children = ( 8B3CB85D22D392C000919F36 /* main.swift */, 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */, ); - path = Markdown; - sourceTree = ""; - }; - 8B3CB85E22D392C000919F36 /* Common */ = { - isa = PBXGroup; - children = ( - 8B3CB85F22D392C000919F36 /* String+Path.swift */, - 8B3CB86322D392C000919F36 /* ConsoleReader.swift */, - 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */, - 8B3CB86622D392C000919F36 /* Array+Slice.swift */, - 8B3CB86022D392C000919F36 /* Support Files */, - ); - path = Common; - sourceTree = ""; - }; - 8B3CB86022D392C000919F36 /* Support Files */ = { - isa = PBXGroup; - children = ( - 8B0FB57E237B341F00221548 /* module.modulemap */, - 8B3CB86122D392C000919F36 /* NefCommon.h */, - 8B3CB86222D392C000919F36 /* Info.plist */, - ); - path = "Support Files"; + path = MarkdownPage; sourceTree = ""; }; 8B3CB88B22D393C300919F36 /* Core */ = { @@ -549,7 +552,6 @@ 8B6FC585221ECE6A008F7694 /* Jekyll */, 8B424B1F224E28FC00AF9010 /* Markdown */, 8B0CA51622AE669600181BC0 /* Carbon */, - 8BF75F5722CA637B00EC53A1 /* Common.framework */, 8BF75F8522CA71E700EC53A1 /* nef.framework */, 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */, 8B6B119422CB9FDE0060177F /* NefCore.framework */, @@ -557,6 +559,7 @@ 8B4F45A522CF9AF400E6F471 /* NefModels.framework */, 8B22248322D5EAD500C85856 /* NefMarkdown.framework */, 8B12D79B22D6235200D05A70 /* NefJekyll.framework */, + 8B0FB584237C0A5600221548 /* CLIKit.framework */, ); name = Products; sourceTree = ""; @@ -571,6 +574,14 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 8B0FB57F237C0A5600221548 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8B0FB588237C0A5600221548 /* CLIKit.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8B12D79622D6235200D05A70 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -603,14 +614,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8BF75F5222CA637B00EC53A1 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B3CB8C622D396E300919F36 /* NefCommon.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8BF75F8022CA71E700EC53A1 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -643,13 +646,30 @@ buildRules = ( ); dependencies = ( - 8B0FB57B237B31F400221548 /* PBXTargetDependency */, + 8B0FB598237C0B7100221548 /* PBXTargetDependency */, ); name = Carbon; productName = Carbon; productReference = 8B0CA51622AE669600181BC0 /* Carbon */; productType = "com.apple.product-type.tool"; }; + 8B0FB583237C0A5600221548 /* CLIKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8B0FB589237C0A5600221548 /* Build configuration list for PBXNativeTarget "CLIKit" */; + buildPhases = ( + 8B0FB57F237C0A5600221548 /* Headers */, + 8B0FB580237C0A5600221548 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + 8B0FB590237C0AEB00221548 /* PBXTargetDependency */, + ); + name = CLIKit; + productName = CLI; + productReference = 8B0FB584237C0A5600221548 /* CLIKit.framework */; + productType = "com.apple.product-type.framework"; + }; 8B12D79A22D6235200D05A70 /* NefJekyll */ = { isa = PBXNativeTarget; buildConfigurationList = 8B12D7A222D6235200D05A70 /* Build configuration list for PBXNativeTarget "NefJekyll" */; @@ -693,7 +713,7 @@ buildRules = ( ); dependencies = ( - 8B0FB577237B31E900221548 /* PBXTargetDependency */, + 8B0FB594237C0B6C00221548 /* PBXTargetDependency */, ); name = Markdown; productName = Markdown; @@ -760,30 +780,13 @@ buildRules = ( ); dependencies = ( - 8B0FB579237B31F000221548 /* PBXTargetDependency */, + 8B0FB596237C0B6F00221548 /* PBXTargetDependency */, ); name = Jekyll; productName = JekyllMarkdown; productReference = 8B6FC585221ECE6A008F7694 /* Jekyll */; productType = "com.apple.product-type.tool"; }; - 8BF75F5622CA637B00EC53A1 /* Common */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */; - buildPhases = ( - 8BF75F5222CA637B00EC53A1 /* Headers */, - 8BF75F5322CA637B00EC53A1 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - 8B0FB575237B31B900221548 /* PBXTargetDependency */, - ); - name = Common; - productName = Common; - productReference = 8BF75F5722CA637B00EC53A1 /* Common.framework */; - productType = "com.apple.product-type.framework"; - }; 8BF75F8422CA71E700EC53A1 /* nef */ = { isa = PBXNativeTarget; buildConfigurationList = 8BF75F9A22CA71E700EC53A1 /* Build configuration list for PBXNativeTarget "nef" */; @@ -835,6 +838,10 @@ 8B0CA51522AE669600181BC0 = { CreatedOnToolsVersion = 10.2.1; }; + 8B0FB583237C0A5600221548 = { + CreatedOnToolsVersion = 11.1; + LastSwiftMigration = 1110; + }; 8B12D79A22D6235200D05A70 = { CreatedOnToolsVersion = 10.2.1; }; @@ -858,9 +865,6 @@ 8B6FC584221ECE6A008F7694 = { CreatedOnToolsVersion = 10.1; }; - 8BF75F5622CA637B00EC53A1 = { - CreatedOnToolsVersion = 10.2.1; - }; 8BF75F8422CA71E700EC53A1 = { CreatedOnToolsVersion = 10.2.1; LastSwiftMigration = 1020; @@ -886,7 +890,7 @@ 8B424B1E224E28FC00AF9010 /* Markdown */, 8B6FC584221ECE6A008F7694 /* Jekyll */, 8B0CA51522AE669600181BC0 /* Carbon */, - 8BF75F5622CA637B00EC53A1 /* Common */, + 8B0FB583237C0A5600221548 /* CLIKit */, 8BF75F8422CA71E700EC53A1 /* nef */, 8B22248222D5EAD500C85856 /* NefMarkdown */, 8B12D79A22D6235200D05A70 /* NefJekyll */, @@ -918,6 +922,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 8B0FB580237C0A5600221548 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8B0FB59A237C0B9A00221548 /* ConsoleReader.swift in Sources */, + 8B0FB599237C0B9A00221548 /* PlaygroundUtils.swift in Sources */, + 8B0FB59B237C0B9A00221548 /* Array+Slice.swift in Sources */, + 8B0FB59C237C0B9A00221548 /* String+Path.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8B12D79722D6235200D05A70 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -986,23 +1001,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8BF75F5322CA637B00EC53A1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B3CB88922D3933D00919F36 /* Array+Slice.swift in Sources */, - 8B3CB88622D3933D00919F36 /* ConsoleReader.swift in Sources */, - 8B3CB88822D3933D00919F36 /* PlaygroundUtils.swift in Sources */, - 8B3CB88522D3933D00919F36 /* String+Path.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8BF75F8122CA71E700EC53A1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8C222D3964000919F36 /* nef.swift in Sources */, - 8BF53F56235F09780081C27C /* nef+helpers.swift in Sources */, + 8B3CB8C222D3964000919F36 /* Render.swift in Sources */, + 8B0FB59E237C0EF000221548 /* API.swift in Sources */, + 8B0FB5A2237C1AC700221548 /* Page.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1026,25 +1031,25 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 8B0FB575237B31B900221548 /* PBXTargetDependency */ = { + 8B0FB590237C0AEB00221548 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8BF75F8422CA71E700EC53A1 /* nef */; - targetProxy = 8B0FB574237B31B900221548 /* PBXContainerItemProxy */; + targetProxy = 8B0FB58F237C0AEB00221548 /* PBXContainerItemProxy */; }; - 8B0FB577237B31E900221548 /* PBXTargetDependency */ = { + 8B0FB594237C0B6C00221548 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; - targetProxy = 8B0FB576237B31E900221548 /* PBXContainerItemProxy */; + target = 8B0FB583237C0A5600221548 /* CLIKit */; + targetProxy = 8B0FB593237C0B6C00221548 /* PBXContainerItemProxy */; }; - 8B0FB579237B31F000221548 /* PBXTargetDependency */ = { + 8B0FB596237C0B6F00221548 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; - targetProxy = 8B0FB578237B31F000221548 /* PBXContainerItemProxy */; + target = 8B0FB583237C0A5600221548 /* CLIKit */; + targetProxy = 8B0FB595237C0B6F00221548 /* PBXContainerItemProxy */; }; - 8B0FB57B237B31F400221548 /* PBXTargetDependency */ = { + 8B0FB598237C0B7100221548 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8BF75F5622CA637B00EC53A1 /* Common */; - targetProxy = 8B0FB57A237B31F400221548 /* PBXContainerItemProxy */; + target = 8B0FB583237C0A5600221548 /* CLIKit */; + targetProxy = 8B0FB597237C0B7100221548 /* PBXContainerItemProxy */; }; 8B12D7A622D624D900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -1123,6 +1128,65 @@ }; name = Release; }; + 8B0FB58A237C0A5600221548 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "${SRCROOT}/UI/CLIKit/Support Files/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULEMAP_FILE = "${SRCROOT}/UI/CLIKit/Support Files/module.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = com.fortysevendegrees.CLI; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 8B0FB58B237C0A5600221548 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "${SRCROOT}/UI/CLIKit/Support Files/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULEMAP_FILE = "${SRCROOT}/UI/CLIKit/Support Files/module.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = com.fortysevendegrees.CLI; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 8B12D7A022D6235200D05A70 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1556,62 +1620,6 @@ }; name = Release; }; - 8BF75F6822CA637B00EC53A1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/UI/Common/Support Files/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MODULEMAP_FILE = "${SRCROOT}/UI/Common/Support Files/module.modulemap"; - PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Common; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 8BF75F6922CA637B00EC53A1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/UI/Common/Support Files/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MODULEMAP_FILE = "${SRCROOT}/UI/Common/Support Files/module.modulemap"; - PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Common; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; 8BF75F9622CA71E700EC53A1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1737,6 +1745,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 8B0FB589237C0A5600221548 /* Build configuration list for PBXNativeTarget "CLIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8B0FB58A237C0A5600221548 /* Debug */, + 8B0FB58B237C0A5600221548 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 8B12D7A222D6235200D05A70 /* Build configuration list for PBXNativeTarget "NefJekyll" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1809,15 +1826,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8BF75F6C22CA637B00EC53A1 /* Build configuration list for PBXNativeTarget "Common" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8BF75F6822CA637B00EC53A1 /* Debug */, - 8BF75F6922CA637B00EC53A1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 8BF75F9A22CA71E700EC53A1 /* Build configuration list for PBXNativeTarget "nef" */ = { isa = XCConfigurationList; buildConfigurations = ( From e12e27ebf9e3b5ae78613b1709de594f5f7f8a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 13:10:18 +0100 Subject: [PATCH 06/20] carbon FP API minor changes minor changes --- .gitignore | 3 + Package.swift | 8 +- project/Component/NefModels/CarbonModel.swift | 6 +- project/Component/nef/API.swift | 15 ++- .../nef/{Page.swift => PageAPI.swift} | 6 +- .../nef/{Render.swift => RenderAPI.swift} | 42 ++++++- .../nef/Support Files/Private/Carbon.h | 12 -- .../nef/Support Files/Private/Core.h | 12 -- .../nef/Support Files/Private/Jekyll.h | 12 -- .../nef/Support Files/Private/Markdown.h | 12 -- .../nef/Support Files/module.modulemap | 28 ----- .../nef/Support Files/{Public => }/nef.h | 4 + project/Core/Render/Render.swift | 4 +- project/nef.xcodeproj/project.pbxproj | 105 ++++++++++-------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/swiftpm/Package.resolved | 70 ++++++++++++ 16 files changed, 205 insertions(+), 136 deletions(-) rename project/Component/nef/{Page.swift => PageAPI.swift} (95%) rename project/Component/nef/{Render.swift => RenderAPI.swift} (64%) delete mode 100644 project/Component/nef/Support Files/Private/Carbon.h delete mode 100644 project/Component/nef/Support Files/Private/Core.h delete mode 100644 project/Component/nef/Support Files/Private/Jekyll.h delete mode 100644 project/Component/nef/Support Files/Private/Markdown.h rename project/Component/nef/Support Files/{Public => }/nef.h (85%) create mode 100644 project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/.gitignore b/.gitignore index 4a1fbbfa..de95641c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,10 @@ **/.DS_Store **/xcuserdata/ BowPlayground + +## SPM .build +Package.resolved .swiftpm bin-cli diff --git a/Package.swift b/Package.swift index 494a6e50..5b5ac611 100644 --- a/Package.swift +++ b/Package.swift @@ -9,11 +9,15 @@ let package = Package( products: [ .library(name: "nef", targets: ["nef"]), ], + dependencies: [ + .package(url: "https://github.com/bow-swift/bow", from: "0.6.0") + ], targets: [ .target(name: "nef", + dependencies: ["Bow", "BowEffects"], path: "project", - sources: ["nef", - "Core", + sources: ["Core", + "Component/nef", "Component/NefModels", "Component/NefMarkdown", "Component/NefJekyll", diff --git a/project/Component/NefModels/CarbonModel.swift b/project/Component/NefModels/CarbonModel.swift index 4d3ccb9b..a4ae56f1 100644 --- a/project/Component/NefModels/CarbonModel.swift +++ b/project/Component/NefModels/CarbonModel.swift @@ -121,16 +121,16 @@ extension CarbonStyle.Color { public struct CarbonError: Error { public let filename: String public let snippet: String - public let error: CarbonErrorOption + public let error: CarbonError.Option - public init(filename: String, snippet: String, error: CarbonErrorOption) { + public init(filename: String, snippet: String, error: CarbonError.Option) { self.filename = filename self.snippet = snippet self.error = error } // MARK: Error options - public enum CarbonErrorOption: CustomStringConvertible { + public enum Option: Error, CustomStringConvertible { case notFound case invalidSnapshot diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index da61c4e0..e9444f57 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -1,8 +1,11 @@ // Copyright © 2019 The nef Authors. import Foundation +import Bow +import BowEffects -public enum Render: RenderAPI { + +public enum Render: RenderAPI, RenderFP { case api public enum Page: PageAPI { case api @@ -30,6 +33,16 @@ public protocol RenderAPI { func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest } +public protocol RenderFP: RenderAPI { + /// Renders a code selection into multiple Carbon images. + /// + /// - Precondition: this method must be invoked from background thread. + /// + /// - Parameter carbon: content+style to generate code snippet. + /// - Returns: An `EnvIO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. It has access to an immutable environment of type `URL` with the output URL. It can be seen as a Kleisli function `(URL) -> IO`. + func carbonIO(_ carbon: Carbon) -> EnvIO +} + public protocol PageAPI { /// Renders content into Markdown file. /// diff --git a/project/Component/nef/Page.swift b/project/Component/nef/PageAPI.swift similarity index 95% rename from project/Component/nef/Page.swift rename to project/Component/nef/PageAPI.swift index 6034286c..87587574 100644 --- a/project/Component/nef/Page.swift +++ b/project/Component/nef/PageAPI.swift @@ -1,11 +1,9 @@ // Copyright © 2019 The nef Authors. -import NefMarkdown -import NefJekyll -import NefCarbon - +import Foundation public extension PageAPI { + func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { guard Thread.isMainThread else { fatalError("markdown(content:outputPath:success:failure:) should be invoked in main thread") diff --git a/project/Component/nef/Render.swift b/project/Component/nef/RenderAPI.swift similarity index 64% rename from project/Component/nef/Render.swift rename to project/Component/nef/RenderAPI.swift index bad149fe..ba59883d 100644 --- a/project/Component/nef/Render.swift +++ b/project/Component/nef/RenderAPI.swift @@ -1,11 +1,12 @@ // Copyright © 2019 The nef Authors. -import NefMarkdown -import NefJekyll -import NefCarbon +import AppKit +import Bow +import BowEffects public extension RenderAPI { + func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { guard Thread.isMainThread else { fatalError("carbon(code:style:outputPath:success:failure:) should be invoked in main thread") @@ -28,6 +29,41 @@ public extension RenderAPI { } +public extension RenderFP where Self: RenderAPI { + + func carbonIO(_ carbon: Carbon) -> EnvIO { + func runAsync(carbon: Carbon, outputURL: URL) -> IO { + IO.async { callback in + self.carbon(code: carbon.code, + style: carbon.style, + outputPath: outputURL.path, + success: { + let file = URL(fileURLWithPath: "\(outputURL.path).png") + let fileExist = FileManager.default.fileExists(atPath: file.path) + fileExist ? callback(.right(file)) : callback(.left(.notFound)) + }, + failure: { error in + callback(.left(.invalidSnapshot)) + }) + }^ + } + + guard !Thread.isMainThread else { + fatalError("carbon(outputPath:) should be invoked in background thread") + } + + return EnvIO { outputURL in + let file = IO.var() + + return binding( + continueOn(.main), + file <- runAsync(carbon: carbon, outputURL: outputURL), + yield: file.get) + }^ + } +} + + // MARK: - Helpers internal extension RenderAPI { diff --git a/project/Component/nef/Support Files/Private/Carbon.h b/project/Component/nef/Support Files/Private/Carbon.h deleted file mode 100644 index 1334c615..00000000 --- a/project/Component/nef/Support Files/Private/Carbon.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefCarbon. -FOUNDATION_EXPORT double NefCarbonVersionNumber; - -//! Project version string for NefCarbon. -FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefCarbon.h" diff --git a/project/Component/nef/Support Files/Private/Core.h b/project/Component/nef/Support Files/Private/Core.h deleted file mode 100644 index 42cc83c0..00000000 --- a/project/Component/nef/Support Files/Private/Core.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for Markup. -FOUNDATION_EXPORT double MarkupVersionNumber; - -//! Project version string for Markup. -FOUNDATION_EXPORT const unsigned char MarkupVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefCore.h" diff --git a/project/Component/nef/Support Files/Private/Jekyll.h b/project/Component/nef/Support Files/Private/Jekyll.h deleted file mode 100644 index c5d62add..00000000 --- a/project/Component/nef/Support Files/Private/Jekyll.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefJekyll. -FOUNDATION_EXPORT double NefJekyllVersionNumber; - -//! Project version string for NefJekyll. -FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefJekyll.h" diff --git a/project/Component/nef/Support Files/Private/Markdown.h b/project/Component/nef/Support Files/Private/Markdown.h deleted file mode 100644 index c859e40d..00000000 --- a/project/Component/nef/Support Files/Private/Markdown.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefMarkdown. -FOUNDATION_EXPORT double NefMarkdownVersionNumber; - -//! Project version string for NefMarkdown. -FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefMarkdown.h" diff --git a/project/Component/nef/Support Files/module.modulemap b/project/Component/nef/Support Files/module.modulemap index a2ea3da1..fc84baf2 100644 --- a/project/Component/nef/Support Files/module.modulemap +++ b/project/Component/nef/Support Files/module.modulemap @@ -1,32 +1,4 @@ framework module nef { umbrella header "nef.h" - link "NefModels" export * - - explicit module Core { - header "Core.h" - link "NefCore" - export * - } - - explicit module Markdown { - header "Markdown.h" - link "NefMarkdown" - export Core - export * - } - - explicit module Jekyll { - header "Jekyll.h" - link "NefJekyll" - export Core - export * - } - - explicit module Carbon { - header "Carbon.h" - link "NefCarbon" - export Core - export * - } } diff --git a/project/Component/nef/Support Files/Public/nef.h b/project/Component/nef/Support Files/nef.h similarity index 85% rename from project/Component/nef/Support Files/Public/nef.h rename to project/Component/nef/Support Files/nef.h index ff9a56ca..76ce25e8 100644 --- a/project/Component/nef/Support Files/Public/nef.h +++ b/project/Component/nef/Support Files/nef.h @@ -10,3 +10,7 @@ FOUNDATION_EXPORT const unsigned char NefVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import #import "NefModels.h" + +#import "NefMarkdown.h" +#import "NefJekyll.h" +#import "NefCarbon.h" diff --git a/project/Core/Render/Render.swift b/project/Core/Render/Render.swift index 16cd9241..05b1ebd2 100644 --- a/project/Core/Render/Render.swift +++ b/project/Core/Render/Render.swift @@ -2,7 +2,7 @@ import Foundation -public protocol Render { +public protocol CoreRender { func render(content: String) -> String? } @@ -19,7 +19,7 @@ extension Node: Jekyll {} extension Node: Markdown {} // MARK: - default Render :: render(content:) -protocol InternalRender: Render { +protocol InternalRender: CoreRender { func render(node: Node) -> String } diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 1f7c857b..5eb31f7a 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -13,7 +13,10 @@ 8B0FB59B237C0B9A00221548 /* Array+Slice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86622D392C000919F36 /* Array+Slice.swift */; }; 8B0FB59C237C0B9A00221548 /* String+Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85F22D392C000919F36 /* String+Path.swift */; }; 8B0FB59E237C0EF000221548 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB59D237C0EF000221548 /* API.swift */; }; - 8B0FB5A2237C1AC700221548 /* Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5A1237C1AC700221548 /* Page.swift */; }; + 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5A1237C1AC700221548 /* PageAPI.swift */; }; + 8B0FB5A8237C1DD000221548 /* BowOptics in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A4237C1D3700221548 /* BowOptics */; }; + 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; + 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; @@ -47,12 +50,8 @@ 8B3CB8BF22D3963300919F36 /* NefCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84D22D3929B00919F36 /* NefCarbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C022D3963B00919F36 /* CarbonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84222D3929B00919F36 /* CarbonModel.swift */; }; 8B3CB8C122D3963B00919F36 /* NefModels.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84022D3929B00919F36 /* NefModels.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B3CB8C222D3964000919F36 /* Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* Render.swift */; }; + 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */; }; 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; - 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E99237A3CFE0059C9C7 /* Core.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9C237A3CFE0059C9C7 /* Carbon.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8B603EA6237A3CFE0059C9C7 /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9D237A3CFE0059C9C7 /* Markdown.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9F237A3CFE0059C9C7 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -168,14 +167,14 @@ 8B0FB586237C0A5600221548 /* CLIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLIKit.h; sourceTree = ""; }; 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; - 8B0FB5A1237C1AC700221548 /* Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Page.swift; sourceTree = ""; }; + 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B22248322D5EAD500C85856 /* NefMarkdown.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefMarkdown.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B22248522D5EAD600C85856 /* NefMarkdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefMarkdown.h; sourceTree = ""; }; 8B22248622D5EAD600C85856 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8B3CB83A22D3929B00919F36 /* Render.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Render.swift; sourceTree = ""; }; + 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderAPI.swift; sourceTree = ""; }; 8B3CB83D22D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB84022D3929B00919F36 /* NefModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefModels.h; sourceTree = ""; }; 8B3CB84122D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -220,10 +219,6 @@ 8B3CB8C722D3987500919F36 /* Carbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; 8B424B1F224E28FC00AF9010 /* Markdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Markdown; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B603E99237A3CFE0059C9C7 /* Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; - 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; - 8B603E9C237A3CFE0059C9C7 /* Carbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; - 8B603E9D237A3CFE0059C9C7 /* Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -235,6 +230,16 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 8B0FB5A7237C1D6B00221548 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */, + 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */, + 8B0FB5A8237C1DD000221548 /* BowOptics in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8B6B119922CB9FDE0060177F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -320,8 +325,8 @@ isa = PBXGroup; children = ( 8B0FB59D237C0EF000221548 /* API.swift */, - 8B3CB83A22D3929B00919F36 /* Render.swift */, - 8B0FB5A1237C1AC700221548 /* Page.swift */, + 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */, + 8B0FB5A1237C1AC700221548 /* PageAPI.swift */, 8B3CB83B22D3929B00919F36 /* Support Files */, ); path = nef; @@ -330,9 +335,8 @@ 8B3CB83B22D3929B00919F36 /* Support Files */ = { isa = PBXGroup; children = ( - 8B603E98237A3CFE0059C9C7 /* Private */, - 8B603E9E237A3CFE0059C9C7 /* Public */, 8B0FB557237B0E6200221548 /* module.modulemap */, + 8B603E9F237A3CFE0059C9C7 /* nef.h */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -515,25 +519,6 @@ path = "Support Files"; sourceTree = ""; }; - 8B603E98237A3CFE0059C9C7 /* Private */ = { - isa = PBXGroup; - children = ( - 8B603E99237A3CFE0059C9C7 /* Core.h */, - 8B603E9A237A3CFE0059C9C7 /* Jekyll.h */, - 8B603E9C237A3CFE0059C9C7 /* Carbon.h */, - 8B603E9D237A3CFE0059C9C7 /* Markdown.h */, - ); - path = Private; - sourceTree = ""; - }; - 8B603E9E237A3CFE0059C9C7 /* Public */ = { - isa = PBXGroup; - children = ( - 8B603E9F237A3CFE0059C9C7 /* nef.h */, - ); - path = Public; - sourceTree = ""; - }; 8B6FC57C221ECE6A008F7694 = { isa = PBXGroup; children = ( @@ -619,10 +604,6 @@ buildActionMask = 2147483647; files = ( 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */, - 8B603EA6237A3CFE0059C9C7 /* Markdown.h in Headers */, - 8B603EA3237A3CFE0059C9C7 /* Jekyll.h in Headers */, - 8B603EA2237A3CFE0059C9C7 /* Core.h in Headers */, - 8B603EA5237A3CFE0059C9C7 /* Carbon.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -793,6 +774,7 @@ buildPhases = ( 8BF75F8022CA71E700EC53A1 /* Headers */, 8BF75F8122CA71E700EC53A1 /* Sources */, + 8B0FB5A7237C1D6B00221548 /* Frameworks */, ); buildRules = ( ); @@ -804,6 +786,11 @@ 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, ); name = nef; + packageProductDependencies = ( + 8B0FB5A4237C1D3700221548 /* BowOptics */, + 8B0FB5A5237C1D3700221548 /* BowEffects */, + 8B0FB5A6237C1D3700221548 /* Bow */, + ); productName = Nef; productReference = 8BF75F8522CA71E700EC53A1 /* nef.framework */; productType = "com.apple.product-type.framework"; @@ -883,6 +870,9 @@ Base, ); mainGroup = 8B6FC57C221ECE6A008F7694; + packageReferences = ( + 8B0FB5A3237C1D3700221548 /* XCRemoteSwiftPackageReference "bow" */, + ); productRefGroup = 8B6FC586221ECE6A008F7694 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -1005,9 +995,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8C222D3964000919F36 /* Render.swift in Sources */, + 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */, 8B0FB59E237C0EF000221548 /* API.swift in Sources */, - 8B0FB5A2237C1AC700221548 /* Page.swift in Sources */, + 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1638,7 +1628,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1667,7 +1656,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MODULEMAP_FILE = "$(SRCROOT)/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1845,6 +1833,35 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 8B0FB5A3237C1D3700221548 /* XCRemoteSwiftPackageReference "bow" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/bow-swift/bow.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.6.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 8B0FB5A4237C1D3700221548 /* BowOptics */ = { + isa = XCSwiftPackageProductDependency; + package = 8B0FB5A3237C1D3700221548 /* XCRemoteSwiftPackageReference "bow" */; + productName = BowOptics; + }; + 8B0FB5A5237C1D3700221548 /* BowEffects */ = { + isa = XCSwiftPackageProductDependency; + package = 8B0FB5A3237C1D3700221548 /* XCRemoteSwiftPackageReference "bow" */; + productName = BowEffects; + }; + 8B0FB5A6237C1D3700221548 /* Bow */ = { + isa = XCSwiftPackageProductDependency; + package = 8B0FB5A3237C1D3700221548 /* XCRemoteSwiftPackageReference "bow" */; + productName = Bow; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 8B6FC57D221ECE6A008F7694 /* Project object */; } diff --git a/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 3f08cb44..919434a6 100644 --- a/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/project/nef.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..c3b3c406 --- /dev/null +++ b/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,70 @@ +{ + "object": { + "pins": [ + { + "package": "Bow", + "repositoryURL": "https://github.com/bow-swift/bow.git", + "state": { + "branch": null, + "revision": "a1361fdd76660000e1ff1ff98f83ff76f62e1925", + "version": "0.6.0" + } + }, + { + "package": "FileCheck", + "repositoryURL": "https://github.com/llvm-swift/FileCheck.git", + "state": { + "branch": null, + "revision": "0eb888b85ca08c7ce85c8a6a459c94d7f282c1bb", + "version": "0.2.1" + } + }, + { + "package": "Rainbow", + "repositoryURL": "https://github.com/onevcat/Rainbow.git", + "state": { + "branch": null, + "revision": "9c52c1952e9b2305d4507cf473392ac2d7c9b155", + "version": "3.1.5" + } + }, + { + "package": "RxSwift", + "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", + "state": { + "branch": null, + "revision": "b3e888b4972d9bc76495dd74d30a8c7fad4b9395", + "version": "5.0.1" + } + }, + { + "package": "llbuild", + "repositoryURL": "https://github.com/apple/swift-llbuild.git", + "state": { + "branch": null, + "revision": "f73b84bc1525998e5e267f9d830c1411487ac65e", + "version": "0.2.0" + } + }, + { + "package": "SwiftPM", + "repositoryURL": "https://github.com/apple/swift-package-manager.git", + "state": { + "branch": null, + "revision": "9abcc2260438177cecd7cf5185b144d13e74122b", + "version": "0.5.0" + } + }, + { + "package": "SwiftCheck", + "repositoryURL": "https://github.com/typelift/SwiftCheck.git", + "state": { + "branch": null, + "revision": "077c096c3ddfc38db223ac8e525ad16ffb987138", + "version": "0.12.0" + } + } + ] + }, + "version": 1 +} From a629f3d118fb89b2a412246e4a05687472f3241c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 17:04:06 +0100 Subject: [PATCH 07/20] CarbonIO from EnvIO to IO --- project/Component/nef/API.swift | 8 +++++--- project/Component/nef/RenderAPI.swift | 16 +++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index e9444f57..386f240b 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -38,9 +38,11 @@ public protocol RenderFP: RenderAPI { /// /// - Precondition: this method must be invoked from background thread. /// - /// - Parameter carbon: content+style to generate code snippet. - /// - Returns: An `EnvIO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. It has access to an immutable environment of type `URL` with the output URL. It can be seen as a Kleisli function `(URL) -> IO`. - func carbonIO(_ carbon: Carbon) -> EnvIO + /// - Parameters: + /// - carbon: content+style to generate code snippet. + /// - output: output where to render the snippets. + /// - Returns: An `IO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. + func carbonIO(_ carbon: Carbon, output: URL) -> IO } public protocol PageAPI { diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index ba59883d..b00c3257 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -31,7 +31,7 @@ public extension RenderAPI { public extension RenderFP where Self: RenderAPI { - func carbonIO(_ carbon: Carbon) -> EnvIO { + func carbonIO(_ carbon: Carbon, output: URL) -> IO { func runAsync(carbon: Carbon, outputURL: URL) -> IO { IO.async { callback in self.carbon(code: carbon.code, @@ -52,14 +52,12 @@ public extension RenderFP where Self: RenderAPI { fatalError("carbon(outputPath:) should be invoked in background thread") } - return EnvIO { outputURL in - let file = IO.var() - - return binding( - continueOn(.main), - file <- runAsync(carbon: carbon, outputURL: outputURL), - yield: file.get) - }^ + let file = IO.var() + + return binding( + continueOn(.main), + file <- runAsync(carbon: carbon, outputURL: output), + yield: file.get)^ } } From 5396285414034084dcf8904251599635e9cba623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 17:17:39 +0100 Subject: [PATCH 08/20] functional api for markdown and jekyll --- project/Component/nef/API.swift | 25 ++++++++++++++++++- project/Component/nef/Models.swift | 8 ++++++ project/Component/nef/PageAPI.swift | 35 +++++++++++++++++++++++++++ project/nef.xcodeproj/project.pbxproj | 4 +++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 project/Component/nef/Models.swift diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 386f240b..40461e5b 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -7,7 +7,7 @@ import BowEffects public enum Render: RenderAPI, RenderFP { case api - public enum Page: PageAPI { + public enum Page: PageAPI, PageFP { case api } } @@ -69,3 +69,26 @@ public protocol PageAPI { /// - failure: callback with information to notify if something goes wrong. func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) } + +public protocol PageFP { + /// Renders content into Markdown file. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - output: output where to write the Markdown render. + /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. + func markdownIO(content: String, to output: URL) -> IO + + /// Renders content into Jekyll format. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - output: output where to write the Markdown render. + /// - permalink: website relative url where locate the page. + /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. + func jekyllIO(content: String, to output: URL, permalink: String) -> IO +} diff --git a/project/Component/nef/Models.swift b/project/Component/nef/Models.swift new file mode 100644 index 00000000..9e36f00c --- /dev/null +++ b/project/Component/nef/Models.swift @@ -0,0 +1,8 @@ +// Copyright © 2019 The nef Authors. + +import Foundation + +public enum PageError: Error { + case markdown + case jekyll +} diff --git a/project/Component/nef/PageAPI.swift b/project/Component/nef/PageAPI.swift index 87587574..916740e2 100644 --- a/project/Component/nef/PageAPI.swift +++ b/project/Component/nef/PageAPI.swift @@ -1,6 +1,9 @@ // Copyright © 2019 The nef Authors. import Foundation +import Bow +import BowEffects + public extension PageAPI { @@ -27,3 +30,35 @@ public extension PageAPI { failure: failure) } } + +public extension PageFP where Self: PageAPI { + + func markdownIO(content: String, to output: URL) -> IO { + IO.async { callback in + self.markdown(content: content, + to: output.path, + success: { + let fileExist = FileManager.default.fileExists(atPath: output.path) + fileExist ? callback(.right(output)) : callback(.left(.markdown)) + }, + failure: { error in + callback(.left(.markdown)) + }) + }^ + } + + func jekyllIO(content: String, to output: URL, permalink: String) -> IO { + IO.async { callback in + self.jekyll(content: content, + to: output.path, + permalink: permalink, + success: { + let fileExist = FileManager.default.fileExists(atPath: output.path) + fileExist ? callback(.right(output)) : callback(.left(.markdown)) + }, + failure: { error in + callback(.left(.markdown)) + }) + }^ + } +} diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 5eb31f7a..93c1eb69 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 8B0FB5A8237C1DD000221548 /* BowOptics in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A4237C1D3700221548 /* BowOptics */; }; 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; + 8B0FB5B8237C61C000221548 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5B7237C61C000221548 /* Models.swift */; }; 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; @@ -168,6 +169,7 @@ 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; + 8B0FB5B7237C61C000221548 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -327,6 +329,7 @@ 8B0FB59D237C0EF000221548 /* API.swift */, 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */, 8B0FB5A1237C1AC700221548 /* PageAPI.swift */, + 8B0FB5B7237C61C000221548 /* Models.swift */, 8B3CB83B22D3929B00919F36 /* Support Files */, ); path = nef; @@ -998,6 +1001,7 @@ 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */, 8B0FB59E237C0EF000221548 /* API.swift in Sources */, 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */, + 8B0FB5B8237C61C000221548 /* Models.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 9bd2c536d9442991d683b3c575ac910bba13c867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 17:57:11 +0100 Subject: [PATCH 09/20] update copyright to nef authors minor changes --- project/Component/NefJekyll/Support Files/Info.plist | 2 +- project/Component/NefMarkdown/Support Files/Info.plist | 2 +- project/Component/nef/RenderAPI.swift | 2 +- project/UI/CLIKit/Support Files/Info.plist | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project/Component/NefJekyll/Support Files/Info.plist b/project/Component/NefJekyll/Support Files/Info.plist index 12ed6a53..560fdc22 100644 --- a/project/Component/NefJekyll/Support Files/Info.plist +++ b/project/Component/NefJekyll/Support Files/Info.plist @@ -19,6 +19,6 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Copyright © 2019 47 Degrees. All rights reserved. + Copyright © 2019 The nef Authors. diff --git a/project/Component/NefMarkdown/Support Files/Info.plist b/project/Component/NefMarkdown/Support Files/Info.plist index 12ed6a53..560fdc22 100644 --- a/project/Component/NefMarkdown/Support Files/Info.plist +++ b/project/Component/NefMarkdown/Support Files/Info.plist @@ -19,6 +19,6 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Copyright © 2019 47 Degrees. All rights reserved. + Copyright © 2019 The nef Authors. diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index b00c3257..22efe410 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -49,7 +49,7 @@ public extension RenderFP where Self: RenderAPI { } guard !Thread.isMainThread else { - fatalError("carbon(outputPath:) should be invoked in background thread") + fatalError("carbonIO(_ carbon:,output:) should be invoked in background thread") } let file = IO.var() diff --git a/project/UI/CLIKit/Support Files/Info.plist b/project/UI/CLIKit/Support Files/Info.plist index 847da824..f8f0ca15 100644 --- a/project/UI/CLIKit/Support Files/Info.plist +++ b/project/UI/CLIKit/Support Files/Info.plist @@ -19,6 +19,6 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Copyright © 2019 47 Degrees. All rights reserved. + Copyright © 2019 The nef Authors. From 42c1a499f8c29cde6912721c26f8489d90124848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 18:17:08 +0100 Subject: [PATCH 10/20] fix cartfile argument in nef executable --- bin/nef | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/nef b/bin/nef index 6e2aad1a..a1b42b2d 100755 --- a/bin/nef +++ b/bin/nef @@ -317,7 +317,7 @@ playground() { version="" branch="" podfile="" - carfile="" + cartfile="" while [ "$1" != "" ]; do case $2 in @@ -334,7 +334,7 @@ playground() { --bow-version ) shift; version=$1 ;; --bow-branch ) shift; branch=$1 ;; --podfile ) shift; podfile=$1 ;; - --carfile ) shift; carfile=$1 ;; + --cartfile ) shift; cartfile=$1 ;; --use-cache) printHelpCompile; exit 1 ;; @@ -359,7 +359,7 @@ playground() { if [ "${#version}" -gt 0 ]; then nef-playground --name "$projectName" --platform "$platform" --bow-version "$version" else - nef-playground --name "$projectName" --platform "$platform" --bow-branch "$branch" --podfile "$podfile" --carfile "$carfile" + nef-playground --name "$projectName" --platform "$platform" --bow-branch "$branch" --podfile "$podfile" --cartfile "$cartfile" fi nefc install "$projectName.app" From abecd46bc3df51f0214c0cacf5d60ad46754da76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Wed, 13 Nov 2019 18:26:39 +0100 Subject: [PATCH 11/20] fix CI fix CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f6e056b1..5da47950 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ env: - PROJECT="./project/nef.xcodeproj" - JOB="XCODE" - DEST="arch=x86_64" - - SCHEME="Core" + - SCHEME="CoreTests" - SDK="macosx" - ACTION="test" From 784374e972c55f7df33b257c7c72b873cf43639a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Thu, 14 Nov 2019 11:13:01 +0100 Subject: [PATCH 12/20] modularice Package minor changes minor changes --- Package.swift | 20 +++++------ .../NefCarbon/App/CarbonAppDelegate.swift | 1 + .../NefCarbon/App/CarbonApplication.swift | 1 + .../NefCarbon/App/CarbonAssembler.swift | 1 + .../NefCarbon/App/CarbonSyncDownloader.swift | 2 ++ .../NefCarbon/App/CarbonViewer.swift | 1 + .../NefCarbon/App/CarbonWebView.swift | 1 + project/Component/NefCarbon/NefCarbon.swift | 2 ++ .../NefCarbon/Support Files/NefCarbon.h | 1 - project/Component/NefJekyll/NefJekyll.swift | 1 + .../NefJekyll/Support Files/NefJekyll.h | 1 - .../Component/NefMarkdown/NefMarkdown.swift | 1 + .../NefMarkdown/Support Files/NefMarkdown.h | 1 - project/Component/nef/API.swift | 2 ++ project/Component/nef/PageAPI.swift | 4 +++ project/Component/nef/RenderAPI.swift | 3 ++ project/Component/nef/Support Files/Carbon.h | 12 +++++++ project/Component/nef/Support Files/Core.h | 12 +++++++ project/Component/nef/Support Files/Jekyll.h | 12 +++++++ .../Component/nef/Support Files/Markdown.h | 12 +++++++ .../nef/Support Files/module.modulemap | 23 +++++++++++++ project/Component/nef/Support Files/nef.h | 4 --- project/Core/Render/Carbon.swift | 1 + project/Core/Support Files/NefCore.h | 1 - project/nef.xcodeproj/project.pbxproj | 33 ++++++++++++++++++- 25 files changed, 133 insertions(+), 20 deletions(-) create mode 100644 project/Component/nef/Support Files/Carbon.h create mode 100644 project/Component/nef/Support Files/Core.h create mode 100644 project/Component/nef/Support Files/Jekyll.h create mode 100644 project/Component/nef/Support Files/Markdown.h diff --git a/Package.swift b/Package.swift index 5b5ac611..c5496c0f 100644 --- a/Package.swift +++ b/Package.swift @@ -7,21 +7,19 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "nef", targets: ["nef"]), + .library(name: "nef", targets: ["nef", "NefModels"]), ], dependencies: [ .package(url: "https://github.com/bow-swift/bow", from: "0.6.0") ], targets: [ - .target(name: "nef", - dependencies: ["Bow", "BowEffects"], - path: "project", - sources: ["Core", - "Component/nef", - "Component/NefModels", - "Component/NefMarkdown", - "Component/NefJekyll", - "Component/NefCarbon"], - publicHeadersPath: "Component/nef/Support Files"), + .target(name: "NefModels", path: "project/Component/NefModels", publicHeadersPath: "Support Files"), + .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "Support Files"), + .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "Support Files"), + .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "Support Files"), + .target(name: "NefCarbon", dependencies: ["NefModels", "NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "Support Files"), + + + .target(name: "nef", dependencies: ["NefCore", "NefModels", "NefMarkdown", "NefJekyll", "NefCarbon", "Bow", "BowEffects"], path: "project/Component/nef", publicHeadersPath: "Support Files"), ] ) diff --git a/project/Component/NefCarbon/App/CarbonAppDelegate.swift b/project/Component/NefCarbon/App/CarbonAppDelegate.swift index e766443a..3c1bae3c 100644 --- a/project/Component/NefCarbon/App/CarbonAppDelegate.swift +++ b/project/Component/NefCarbon/App/CarbonAppDelegate.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit +import NefCore class CarbonAppDelegate: NSObject, NSApplicationDelegate { private let main: (CarbonDownloader) -> Void diff --git a/project/Component/NefCarbon/App/CarbonApplication.swift b/project/Component/NefCarbon/App/CarbonApplication.swift index 59ec4053..a03d828e 100644 --- a/project/Component/NefCarbon/App/CarbonApplication.swift +++ b/project/Component/NefCarbon/App/CarbonApplication.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit +import NefCore public class CarbonApplication { private static let app = NSApplication.shared diff --git a/project/Component/NefCarbon/App/CarbonAssembler.swift b/project/Component/NefCarbon/App/CarbonAssembler.swift index f0754ffc..328ae8e8 100644 --- a/project/Component/NefCarbon/App/CarbonAssembler.swift +++ b/project/Component/NefCarbon/App/CarbonAssembler.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import AppKit +import NefCore public class CarbonAssembler: CarbonProvider, CarbonAppDelegateAssembler { public init() {} diff --git a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift index e614edcf..e8bf70ec 100644 --- a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift +++ b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift @@ -1,6 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefCore +import NefModels class CarbonSyncDownloader: CarbonDownloader, CarbonViewDelegate { diff --git a/project/Component/NefCarbon/App/CarbonViewer.swift b/project/Component/NefCarbon/App/CarbonViewer.swift index afee1eee..e051534c 100644 --- a/project/Component/NefCarbon/App/CarbonViewer.swift +++ b/project/Component/NefCarbon/App/CarbonViewer.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefModels public enum CarbonViewer { diff --git a/project/Component/NefCarbon/App/CarbonWebView.swift b/project/Component/NefCarbon/App/CarbonWebView.swift index 853b31a1..0deafea5 100644 --- a/project/Component/NefCarbon/App/CarbonWebView.swift +++ b/project/Component/NefCarbon/App/CarbonWebView.swift @@ -2,6 +2,7 @@ import AppKit import WebKit +import NefModels /// Carbon view definition public protocol CarbonView: NSView { diff --git a/project/Component/NefCarbon/NefCarbon.swift b/project/Component/NefCarbon/NefCarbon.swift index f5749a13..e8ca09d2 100644 --- a/project/Component/NefCarbon/NefCarbon.swift +++ b/project/Component/NefCarbon/NefCarbon.swift @@ -1,6 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefCore +import NefModels /// Renders a page into multiple Carbon images. /// diff --git a/project/Component/NefCarbon/Support Files/NefCarbon.h b/project/Component/NefCarbon/Support Files/NefCarbon.h index 70c8f659..0617d1a0 100644 --- a/project/Component/NefCarbon/Support Files/NefCarbon.h +++ b/project/Component/NefCarbon/Support Files/NefCarbon.h @@ -9,4 +9,3 @@ FOUNDATION_EXPORT double NefCarbonVersionNumber; FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import "NefCore.h" diff --git a/project/Component/NefJekyll/NefJekyll.swift b/project/Component/NefJekyll/NefJekyll.swift index cc852edd..094d4dc4 100644 --- a/project/Component/NefJekyll/NefJekyll.swift +++ b/project/Component/NefJekyll/NefJekyll.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefCore /// Renders a page into Jekyll format. /// diff --git a/project/Component/NefJekyll/Support Files/NefJekyll.h b/project/Component/NefJekyll/Support Files/NefJekyll.h index 0bd446fe..c5b34a6c 100644 --- a/project/Component/NefJekyll/Support Files/NefJekyll.h +++ b/project/Component/NefJekyll/Support Files/NefJekyll.h @@ -9,4 +9,3 @@ FOUNDATION_EXPORT double NefJekyllVersionNumber; FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import "NefCore.h" diff --git a/project/Component/NefMarkdown/NefMarkdown.swift b/project/Component/NefMarkdown/NefMarkdown.swift index 38475800..c29559e1 100644 --- a/project/Component/NefMarkdown/NefMarkdown.swift +++ b/project/Component/NefMarkdown/NefMarkdown.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefCore /// Renders a page into Markdown format. /// diff --git a/project/Component/NefMarkdown/Support Files/NefMarkdown.h b/project/Component/NefMarkdown/Support Files/NefMarkdown.h index 59849fdb..686de9d8 100644 --- a/project/Component/NefMarkdown/Support Files/NefMarkdown.h +++ b/project/Component/NefMarkdown/Support Files/NefMarkdown.h @@ -9,4 +9,3 @@ FOUNDATION_EXPORT double NefMarkdownVersionNumber; FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import "NefCore.h" diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 40461e5b..63410c37 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -1,6 +1,8 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefModels + import Bow import BowEffects diff --git a/project/Component/nef/PageAPI.swift b/project/Component/nef/PageAPI.swift index 916740e2..5d3ddfd4 100644 --- a/project/Component/nef/PageAPI.swift +++ b/project/Component/nef/PageAPI.swift @@ -1,6 +1,10 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefModels +import NefMarkdown +import NefJekyll + import Bow import BowEffects diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index 22efe410..5559c741 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -1,6 +1,9 @@ // Copyright © 2019 The nef Authors. import AppKit +import NefModels +import NefCarbon + import Bow import BowEffects diff --git a/project/Component/nef/Support Files/Carbon.h b/project/Component/nef/Support Files/Carbon.h new file mode 100644 index 00000000..1334c615 --- /dev/null +++ b/project/Component/nef/Support Files/Carbon.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefCarbon. +FOUNDATION_EXPORT double NefCarbonVersionNumber; + +//! Project version string for NefCarbon. +FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefCarbon.h" diff --git a/project/Component/nef/Support Files/Core.h b/project/Component/nef/Support Files/Core.h new file mode 100644 index 00000000..42cc83c0 --- /dev/null +++ b/project/Component/nef/Support Files/Core.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for Markup. +FOUNDATION_EXPORT double MarkupVersionNumber; + +//! Project version string for Markup. +FOUNDATION_EXPORT const unsigned char MarkupVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefCore.h" diff --git a/project/Component/nef/Support Files/Jekyll.h b/project/Component/nef/Support Files/Jekyll.h new file mode 100644 index 00000000..c5d62add --- /dev/null +++ b/project/Component/nef/Support Files/Jekyll.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefJekyll. +FOUNDATION_EXPORT double NefJekyllVersionNumber; + +//! Project version string for NefJekyll. +FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefJekyll.h" diff --git a/project/Component/nef/Support Files/Markdown.h b/project/Component/nef/Support Files/Markdown.h new file mode 100644 index 00000000..c859e40d --- /dev/null +++ b/project/Component/nef/Support Files/Markdown.h @@ -0,0 +1,12 @@ +// Copyright © 2019 The nef Authors. + +#import + +//! Project version number for NefMarkdown. +FOUNDATION_EXPORT double NefMarkdownVersionNumber; + +//! Project version string for NefMarkdown. +FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import "NefMarkdown.h" diff --git a/project/Component/nef/Support Files/module.modulemap b/project/Component/nef/Support Files/module.modulemap index fc84baf2..d8a0c473 100644 --- a/project/Component/nef/Support Files/module.modulemap +++ b/project/Component/nef/Support Files/module.modulemap @@ -1,4 +1,27 @@ framework module nef { umbrella header "nef.h" export * + + explicit module Core { + header "Core.h" + export * + } + + explicit module Markdown { + header "Markdown.h" + export Core + export * + } + + explicit module Jekyll { + header "Jekyll.h" + export Core + export * + } + + explicit module Carbon { + header "Carbon.h" + export Core + export * + } } diff --git a/project/Component/nef/Support Files/nef.h b/project/Component/nef/Support Files/nef.h index 76ce25e8..ff9a56ca 100644 --- a/project/Component/nef/Support Files/nef.h +++ b/project/Component/nef/Support Files/nef.h @@ -10,7 +10,3 @@ FOUNDATION_EXPORT const unsigned char NefVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import #import "NefModels.h" - -#import "NefMarkdown.h" -#import "NefJekyll.h" -#import "NefCarbon.h" diff --git a/project/Core/Render/Carbon.swift b/project/Core/Render/Carbon.swift index ad581fd0..2810a581 100644 --- a/project/Core/Render/Carbon.swift +++ b/project/Core/Render/Carbon.swift @@ -1,6 +1,7 @@ // Copyright © 2019 The nef Authors. import Foundation +import NefModels public protocol CarbonDownloader: class { func carbon(withConfiguration configuration: Carbon, filename: String) -> Result diff --git a/project/Core/Support Files/NefCore.h b/project/Core/Support Files/NefCore.h index b3016761..4b156c89 100644 --- a/project/Core/Support Files/NefCore.h +++ b/project/Core/Support Files/NefCore.h @@ -9,4 +9,3 @@ FOUNDATION_EXPORT double CoreVersionNumber; FOUNDATION_EXPORT const unsigned char CoreVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import "NefModels.h" diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 93c1eb69..1c62b2a3 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -18,6 +18,10 @@ 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; 8B0FB5B8237C61C000221548 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5B7237C61C000221548 /* Models.swift */; }; + 8B0FB5BA237D5B7A00221548 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5B9237D5B7A00221548 /* Carbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5BC237D5B9800221548 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BB237D5B9400221548 /* Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5BE237D5BAD00221548 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BD237D5BA900221548 /* Jekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5C0237D5BBF00221548 /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BF237D5BBA00221548 /* Markdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; @@ -88,6 +92,13 @@ remoteGlobalIDString = 8B0FB583237C0A5600221548; remoteInfo = CLI; }; + 8B0FB5C1237D5D6300221548 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8B4F45A422CF9AF400E6F471; + remoteInfo = NefModels; + }; 8B12D7A522D624D900D05A70 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -170,6 +181,10 @@ 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; 8B0FB5B7237C61C000221548 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 8B0FB5B9237D5B7A00221548 /* Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; + 8B0FB5BB237D5B9400221548 /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; + 8B0FB5BD237D5BA900221548 /* Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; + 8B0FB5BF237D5BBA00221548 /* Markdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -340,6 +355,10 @@ children = ( 8B0FB557237B0E6200221548 /* module.modulemap */, 8B603E9F237A3CFE0059C9C7 /* nef.h */, + 8B0FB5BF237D5BBA00221548 /* Markdown.h */, + 8B0FB5BD237D5BA900221548 /* Jekyll.h */, + 8B0FB5B9237D5B7A00221548 /* Carbon.h */, + 8B0FB5BB237D5B9400221548 /* Core.h */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -607,6 +626,10 @@ buildActionMask = 2147483647; files = ( 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */, + 8B0FB5BC237D5B9800221548 /* Core.h in Headers */, + 8B0FB5C0237D5BBF00221548 /* Markdown.h in Headers */, + 8B0FB5BE237D5BAD00221548 /* Jekyll.h in Headers */, + 8B0FB5BA237D5B7A00221548 /* Carbon.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -782,8 +805,8 @@ buildRules = ( ); dependencies = ( - 8B6B11BD22CBA1770060177F /* PBXTargetDependency */, 8B89CD73237B084E007E9152 /* PBXTargetDependency */, + 8B6B11BD22CBA1770060177F /* PBXTargetDependency */, 8B8AA94022D62266006BE290 /* PBXTargetDependency */, 8B12D7A622D624D900D05A70 /* PBXTargetDependency */, 8B6B118C22CB9EA20060177F /* PBXTargetDependency */, @@ -809,6 +832,7 @@ ); dependencies = ( 8B6B11BB22CBA1710060177F /* PBXTargetDependency */, + 8B0FB5C2237D5D6300221548 /* PBXTargetDependency */, ); name = NefCarbon; productName = NefCarbon; @@ -1045,6 +1069,11 @@ target = 8B0FB583237C0A5600221548 /* CLIKit */; targetProxy = 8B0FB597237C0B7100221548 /* PBXContainerItemProxy */; }; + 8B0FB5C2237D5D6300221548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8B4F45A422CF9AF400E6F471 /* NefModels */; + targetProxy = 8B0FB5C1237D5D6300221548 /* PBXContainerItemProxy */; + }; 8B12D7A622D624D900D05A70 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B12D79A22D6235200D05A70 /* NefJekyll */; @@ -1632,6 +1661,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "${SRCROOT}/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1660,6 +1690,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "${SRCROOT}/Component/nef/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.47deg.Nef; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; From f30e7d25baa356fd7e50f175f4ed18a4f931bd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Thu, 14 Nov 2019 11:53:35 +0100 Subject: [PATCH 13/20] using nested package to resolve dependencies --- Package.swift | 22 ++-- project/Package.swift | 27 +++-- project/UI/CLIKit/Support Files/CLIKit.h | 4 - .../UI/CLIKit/Support Files/module.modulemap | 4 - project/UI/CarbonPage/main.swift | 4 + project/UI/JekyllPage/main.swift | 1 + project/UI/MarkdownPage/main.swift | 1 + project/nef.xcodeproj/project.pbxproj | 106 +++++++++++------- .../{Carbon.xcscheme => CarbonPage.xcscheme} | 41 ++----- .../{Jekyll.xcscheme => JekyllPage.xcscheme} | 27 ++--- ...arkdown.xcscheme => MarkdownPage.xcscheme} | 41 ++----- 11 files changed, 122 insertions(+), 156 deletions(-) delete mode 100644 project/UI/CLIKit/Support Files/module.modulemap rename project/nef.xcodeproj/xcshareddata/xcschemes/{Carbon.xcscheme => CarbonPage.xcscheme} (68%) rename project/nef.xcodeproj/xcshareddata/xcschemes/{Jekyll.xcscheme => JekyllPage.xcscheme} (78%) rename project/nef.xcodeproj/xcshareddata/xcschemes/{Markdown.xcscheme => MarkdownPage.xcscheme} (65%) diff --git a/Package.swift b/Package.swift index c5496c0f..68ee5974 100644 --- a/Package.swift +++ b/Package.swift @@ -7,19 +7,21 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "nef", targets: ["nef", "NefModels"]), + .library(name: "nef", targets: ["nef"]), ], dependencies: [ - .package(url: "https://github.com/bow-swift/bow", from: "0.6.0") + .package(url: "https://github.com/bow-swift/bow", from: "0.6.0"), + .package(path: "project"), ], targets: [ - .target(name: "NefModels", path: "project/Component/NefModels", publicHeadersPath: "Support Files"), - .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "Support Files"), - .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "Support Files"), - .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "Support Files"), - .target(name: "NefCarbon", dependencies: ["NefModels", "NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "Support Files"), - - - .target(name: "nef", dependencies: ["NefCore", "NefModels", "NefMarkdown", "NefJekyll", "NefCarbon", "Bow", "BowEffects"], path: "project/Component/nef", publicHeadersPath: "Support Files"), + .target(name: "nef", + dependencies: ["Bow", "BowEffects", + "NefCore", + "NefModels", + "NefMarkdown", + "NefJekyll", + "NefCarbon"], + path: "project/Component/nef", + publicHeadersPath: "Support Files"), ] ) diff --git a/project/Package.swift b/project/Package.swift index ed925f49..2499516a 100644 --- a/project/Package.swift +++ b/project/Package.swift @@ -7,20 +7,27 @@ let package = Package( .macOS(.v10_14), ], products: [ + .library(name: "NefModels", targets: ["NefModels"]), + .library(name: "NefCore", targets: ["NefCore"]), + .library(name: "NefMarkdown", targets: ["NefMarkdown"]), + .library(name: "NefJekyll", targets: ["NefJekyll"]), + .library(name: "NefCarbon", targets: ["NefCarbon"]), + .executable(name: "nef-markdown-page", targets: ["MarkdownPage"]), .executable(name: "nef-jekyll-page", targets: ["JekyllPage"]), .executable(name: "nef-carbon-page", targets: ["CarbonPage"]), ], targets: [ - .target(name: "CLIKit", path: ".", sources: ["Component/NefMarkdown", - "Component/NefJekyll", - "Component/NefCarbon", - "Component/NefModels", - "UI/CLIKit", - "Core"], publicHeadersPath: "UI/CLIKit/Support Files"), - - .target(name: "MarkdownPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/MarkdownPage"]), - .target(name: "JekyllPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/JekyllPage"]), - .target(name: "CarbonPage", dependencies: ["CLIKit"], path: ".", sources: ["UI/CarbonPage"]), + .target(name: "NefModels", path: "Component/NefModels", publicHeadersPath: "Support Files"), + .target(name: "NefCore", dependencies: ["NefModels"], path: "Core", publicHeadersPath: "Support Files"), + .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "Component/NefMarkdown", publicHeadersPath: "Support Files"), + .target(name: "NefJekyll", dependencies: ["NefCore"], path: "Component/NefJekyll", publicHeadersPath: "Support Files"), + .target(name: "NefCarbon", dependencies: ["NefModels", "NefCore"], path: "Component/NefCarbon", publicHeadersPath: "Support Files"), + + .target(name: "CLIKit", path: "UI/CLIKit", publicHeadersPath: "Support Files"), + + .target(name: "MarkdownPage", dependencies: ["CLIKit", "NefMarkdown"], path: "UI/MarkdownPage"), + .target(name: "JekyllPage", dependencies: ["CLIKit", "NefJekyll"], path: "UI/JekyllPage"), + .target(name: "CarbonPage", dependencies: ["CLIKit", "NefModels", "NefCore", "NefCarbon"], path: "UI/CarbonPage"), ] ) diff --git a/project/UI/CLIKit/Support Files/CLIKit.h b/project/UI/CLIKit/Support Files/CLIKit.h index d7a6eafb..352ee422 100644 --- a/project/UI/CLIKit/Support Files/CLIKit.h +++ b/project/UI/CLIKit/Support Files/CLIKit.h @@ -9,7 +9,3 @@ FOUNDATION_EXPORT double CLIVersionNumber; FOUNDATION_EXPORT const unsigned char CLIVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import "NefMarkdown.h" -#import "NefJekyll.h" -#import "NefCarbon.h" - diff --git a/project/UI/CLIKit/Support Files/module.modulemap b/project/UI/CLIKit/Support Files/module.modulemap deleted file mode 100644 index 94b7024a..00000000 --- a/project/UI/CLIKit/Support Files/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -framework module CLIKit { - umbrella header "CLIKit.h" - export * -} diff --git a/project/UI/CarbonPage/main.swift b/project/UI/CarbonPage/main.swift index 8c4c0864..8f3b5e0b 100644 --- a/project/UI/CarbonPage/main.swift +++ b/project/UI/CarbonPage/main.swift @@ -3,6 +3,10 @@ import Foundation import CLIKit +import NefModels +import NefCore +import NefCarbon + let scriptName = "nef-carbon-page" let console = CarbonOutput() diff --git a/project/UI/JekyllPage/main.swift b/project/UI/JekyllPage/main.swift index f56d2ee0..eecc345b 100644 --- a/project/UI/JekyllPage/main.swift +++ b/project/UI/JekyllPage/main.swift @@ -2,6 +2,7 @@ import Foundation import CLIKit +import NefJekyll let scriptName = "nef-jekyll-page" let console = JekyllConsole() diff --git a/project/UI/MarkdownPage/main.swift b/project/UI/MarkdownPage/main.swift index 4f0cc87d..88f690f7 100644 --- a/project/UI/MarkdownPage/main.swift +++ b/project/UI/MarkdownPage/main.swift @@ -2,6 +2,7 @@ import Foundation import CLIKit +import NefMarkdown let scriptName = "nef-markdown-page" let console = MarkdownConsole() diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 1c62b2a3..5854bc60 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -64,13 +64,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 8B0FB58F237C0AEB00221548 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; - remoteInfo = nef; - }; 8B0FB593237C0B6C00221548 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -155,6 +148,27 @@ remoteGlobalIDString = 8B6B119322CB9FDE0060177F; remoteInfo = Markup; }; + 8B848357237D676F0024EA4A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; + }; + 8B848359237D67740024EA4A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; + }; + 8B84835B237D67780024EA4A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8BF75F8422CA71E700EC53A1; + remoteInfo = nef; + }; 8B89CD72237B084E007E9152 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8B6FC57D221ECE6A008F7694 /* Project object */; @@ -172,9 +186,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 8B0CA51622AE669600181BC0 /* Carbon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Carbon; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B0CA51622AE669600181BC0 /* CarbonPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CarbonPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8B0FB557237B0E6200221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = "Component/nef/Support Files/module.modulemap"; sourceTree = SOURCE_ROOT; }; - 8B0FB57E237B341F00221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 8B0FB584237C0A5600221548 /* CLIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CLIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B0FB586237C0A5600221548 /* CLIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLIKit.h; sourceTree = ""; }; 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -234,12 +247,12 @@ 8B3CB8B022D394E600919F36 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB8B122D394E600919F36 /* MarkdownTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarkdownTests.swift; sourceTree = ""; }; 8B3CB8C722D3987500919F36 /* Carbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; - 8B424B1F224E28FC00AF9010 /* Markdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Markdown; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B424B1F224E28FC00AF9010 /* MarkdownPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MarkdownPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B6FC585221ECE6A008F7694 /* Jekyll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Jekyll; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B6FC585221ECE6A008F7694 /* JekyllPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JekyllPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -283,7 +296,6 @@ 8B0FB58E237C0A8F00221548 /* Support Files */ = { isa = PBXGroup; children = ( - 8B0FB57E237B341F00221548 /* module.modulemap */, 8B0FB586237C0A5600221548 /* CLIKit.h */, 8B0FB587237C0A5600221548 /* Info.plist */, ); @@ -556,9 +568,9 @@ 8B6FC586221ECE6A008F7694 /* Products */ = { isa = PBXGroup; children = ( - 8B6FC585221ECE6A008F7694 /* Jekyll */, - 8B424B1F224E28FC00AF9010 /* Markdown */, - 8B0CA51622AE669600181BC0 /* Carbon */, + 8B6FC585221ECE6A008F7694 /* JekyllPage */, + 8B424B1F224E28FC00AF9010 /* MarkdownPage */, + 8B0CA51622AE669600181BC0 /* CarbonPage */, 8BF75F8522CA71E700EC53A1 /* nef.framework */, 8BF75FC622CA7DA500EC53A1 /* NefCarbon.framework */, 8B6B119422CB9FDE0060177F /* NefCore.framework */, @@ -644,20 +656,21 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 8B0CA51522AE669600181BC0 /* Carbon */ = { + 8B0CA51522AE669600181BC0 /* CarbonPage */ = { isa = PBXNativeTarget; - buildConfigurationList = 8B0CA51A22AE669600181BC0 /* Build configuration list for PBXNativeTarget "Carbon" */; + buildConfigurationList = 8B0CA51A22AE669600181BC0 /* Build configuration list for PBXNativeTarget "CarbonPage" */; buildPhases = ( 8B0CA51222AE669600181BC0 /* Sources */, ); buildRules = ( ); dependencies = ( + 8B848358237D676F0024EA4A /* PBXTargetDependency */, 8B0FB598237C0B7100221548 /* PBXTargetDependency */, ); - name = Carbon; + name = CarbonPage; productName = Carbon; - productReference = 8B0CA51622AE669600181BC0 /* Carbon */; + productReference = 8B0CA51622AE669600181BC0 /* CarbonPage */; productType = "com.apple.product-type.tool"; }; 8B0FB583237C0A5600221548 /* CLIKit */ = { @@ -670,7 +683,6 @@ buildRules = ( ); dependencies = ( - 8B0FB590237C0AEB00221548 /* PBXTargetDependency */, ); name = CLIKit; productName = CLI; @@ -711,20 +723,21 @@ productReference = 8B22248322D5EAD500C85856 /* NefMarkdown.framework */; productType = "com.apple.product-type.framework"; }; - 8B424B1E224E28FC00AF9010 /* Markdown */ = { + 8B424B1E224E28FC00AF9010 /* MarkdownPage */ = { isa = PBXNativeTarget; - buildConfigurationList = 8B424B23224E28FC00AF9010 /* Build configuration list for PBXNativeTarget "Markdown" */; + buildConfigurationList = 8B424B23224E28FC00AF9010 /* Build configuration list for PBXNativeTarget "MarkdownPage" */; buildPhases = ( 8B424B1B224E28FC00AF9010 /* Sources */, ); buildRules = ( ); dependencies = ( + 8B84835C237D67780024EA4A /* PBXTargetDependency */, 8B0FB594237C0B6C00221548 /* PBXTargetDependency */, ); - name = Markdown; + name = MarkdownPage; productName = Markdown; - productReference = 8B424B1F224E28FC00AF9010 /* Markdown */; + productReference = 8B424B1F224E28FC00AF9010 /* MarkdownPage */; productType = "com.apple.product-type.tool"; }; 8B4F45A422CF9AF400E6F471 /* NefModels */ = { @@ -778,20 +791,21 @@ productReference = 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 8B6FC584221ECE6A008F7694 /* Jekyll */ = { + 8B6FC584221ECE6A008F7694 /* JekyllPage */ = { isa = PBXNativeTarget; - buildConfigurationList = 8B6FC58C221ECE6A008F7694 /* Build configuration list for PBXNativeTarget "Jekyll" */; + buildConfigurationList = 8B6FC58C221ECE6A008F7694 /* Build configuration list for PBXNativeTarget "JekyllPage" */; buildPhases = ( 8B6FC581221ECE6A008F7694 /* Sources */, ); buildRules = ( ); dependencies = ( + 8B84835A237D67740024EA4A /* PBXTargetDependency */, 8B0FB596237C0B6F00221548 /* PBXTargetDependency */, ); - name = Jekyll; + name = JekyllPage; productName = JekyllMarkdown; - productReference = 8B6FC585221ECE6A008F7694 /* Jekyll */; + productReference = 8B6FC585221ECE6A008F7694 /* JekyllPage */; productType = "com.apple.product-type.tool"; }; 8BF75F8422CA71E700EC53A1 /* nef */ = { @@ -904,9 +918,9 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 8B424B1E224E28FC00AF9010 /* Markdown */, - 8B6FC584221ECE6A008F7694 /* Jekyll */, - 8B0CA51522AE669600181BC0 /* Carbon */, + 8B424B1E224E28FC00AF9010 /* MarkdownPage */, + 8B6FC584221ECE6A008F7694 /* JekyllPage */, + 8B0CA51522AE669600181BC0 /* CarbonPage */, 8B0FB583237C0A5600221548 /* CLIKit */, 8BF75F8422CA71E700EC53A1 /* nef */, 8B22248222D5EAD500C85856 /* NefMarkdown */, @@ -1049,11 +1063,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 8B0FB590237C0AEB00221548 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8BF75F8422CA71E700EC53A1 /* nef */; - targetProxy = 8B0FB58F237C0AEB00221548 /* PBXContainerItemProxy */; - }; 8B0FB594237C0B6C00221548 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B0FB583237C0A5600221548 /* CLIKit */; @@ -1114,6 +1123,21 @@ target = 8B6B119322CB9FDE0060177F /* NefCore */; targetProxy = 8B6B11BC22CBA1770060177F /* PBXContainerItemProxy */; }; + 8B848358237D676F0024EA4A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B848357237D676F0024EA4A /* PBXContainerItemProxy */; + }; + 8B84835A237D67740024EA4A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B848359237D67740024EA4A /* PBXContainerItemProxy */; + }; + 8B84835C237D67780024EA4A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8BF75F8422CA71E700EC53A1 /* nef */; + targetProxy = 8B84835B237D67780024EA4A /* PBXContainerItemProxy */; + }; 8B89CD73237B084E007E9152 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8B4F45A422CF9AF400E6F471 /* NefModels */; @@ -1158,7 +1182,6 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1170,7 +1193,6 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; - MODULEMAP_FILE = "${SRCROOT}/UI/CLIKit/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.fortysevendegrees.CLI; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1188,7 +1210,6 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1200,7 +1221,6 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; - MODULEMAP_FILE = "${SRCROOT}/UI/CLIKit/Support Files/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.fortysevendegrees.CLI; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1759,7 +1779,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8B0CA51A22AE669600181BC0 /* Build configuration list for PBXNativeTarget "Carbon" */ = { + 8B0CA51A22AE669600181BC0 /* Build configuration list for PBXNativeTarget "CarbonPage" */ = { isa = XCConfigurationList; buildConfigurations = ( 8B0CA51B22AE669600181BC0 /* Debug */, @@ -1795,7 +1815,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8B424B23224E28FC00AF9010 /* Build configuration list for PBXNativeTarget "Markdown" */ = { + 8B424B23224E28FC00AF9010 /* Build configuration list for PBXNativeTarget "MarkdownPage" */ = { isa = XCConfigurationList; buildConfigurations = ( 8B424B24224E28FC00AF9010 /* Debug */, @@ -1840,7 +1860,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8B6FC58C221ECE6A008F7694 /* Build configuration list for PBXNativeTarget "Jekyll" */ = { + 8B6FC58C221ECE6A008F7694 /* Build configuration list for PBXNativeTarget "JekyllPage" */ = { isa = XCConfigurationList; buildConfigurations = ( 8B6FC58D221ECE6A008F7694 /* Debug */, diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/CarbonPage.xcscheme similarity index 68% rename from project/nef.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme rename to project/nef.xcodeproj/xcshareddata/xcschemes/CarbonPage.xcscheme index db76dcbb..78a81852 100644 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/CarbonPage.xcscheme @@ -1,6 +1,6 @@ @@ -29,8 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - - - - - - - - + - + diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/Jekyll.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/JekyllPage.xcscheme similarity index 78% rename from project/nef.xcodeproj/xcshareddata/xcschemes/Jekyll.xcscheme rename to project/nef.xcodeproj/xcshareddata/xcschemes/JekyllPage.xcscheme index 495aa4b4..5910b7ae 100644 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/Jekyll.xcscheme +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/JekyllPage.xcscheme @@ -1,6 +1,6 @@ @@ -29,17 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - diff --git a/project/nef.xcodeproj/xcshareddata/xcschemes/Markdown.xcscheme b/project/nef.xcodeproj/xcshareddata/xcschemes/MarkdownPage.xcscheme similarity index 65% rename from project/nef.xcodeproj/xcshareddata/xcschemes/Markdown.xcscheme rename to project/nef.xcodeproj/xcshareddata/xcschemes/MarkdownPage.xcscheme index 60ef6ad6..4a14f4d9 100644 --- a/project/nef.xcodeproj/xcshareddata/xcschemes/Markdown.xcscheme +++ b/project/nef.xcodeproj/xcshareddata/xcschemes/MarkdownPage.xcscheme @@ -1,6 +1,6 @@ @@ -29,17 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - - - - - - - - - From 387c01be218eba84041fa5b6fab4b68a26a07c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Thu, 14 Nov 2019 12:44:28 +0100 Subject: [PATCH 14/20] expose nef models in nef framework minor changes update public api in nef --- Package.swift | 15 ++++++-- project/Component/nef/API.swift | 8 ++--- project/Component/nef/Support Files/Carbon.h | 12 ------- project/Component/nef/Support Files/Core.h | 12 ------- project/Component/nef/Support Files/Jekyll.h | 12 ------- .../Component/nef/Support Files/Markdown.h | 12 ------- project/Component/nef/Support Files/_Carbon.h | 10 ++++++ project/Component/nef/Support Files/_Core.h | 10 ++++++ project/Component/nef/Support Files/_Jekyll.h | 10 ++++++ .../Component/nef/Support Files/_Markdown.h | 10 ++++++ .../nef/Support Files/module.modulemap | 8 ++--- project/Component/nef/Support Files/nef.h | 4 +-- project/Package.swift | 6 ---- project/UI/CLIKit/Support Files/CLIKit.h | 2 -- project/nef.xcodeproj/project.pbxproj | 36 +++++++++---------- 15 files changed, 79 insertions(+), 88 deletions(-) delete mode 100644 project/Component/nef/Support Files/Carbon.h delete mode 100644 project/Component/nef/Support Files/Core.h delete mode 100644 project/Component/nef/Support Files/Jekyll.h delete mode 100644 project/Component/nef/Support Files/Markdown.h create mode 100644 project/Component/nef/Support Files/_Carbon.h create mode 100644 project/Component/nef/Support Files/_Core.h create mode 100644 project/Component/nef/Support Files/_Jekyll.h create mode 100644 project/Component/nef/Support Files/_Markdown.h diff --git a/Package.swift b/Package.swift index 68ee5974..47aa0ce4 100644 --- a/Package.swift +++ b/Package.swift @@ -7,13 +7,24 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "nef", targets: ["nef"]), + .library(name: "nef", + targets: ["nef", + "NefCore", + "NefModels", + "NefMarkdown", + "NefJekyll", + "NefCarbon"]), ], dependencies: [ .package(url: "https://github.com/bow-swift/bow", from: "0.6.0"), - .package(path: "project"), ], targets: [ + .target(name: "NefModels", path: "project/Component/NefModels", publicHeadersPath: "Support Files"), + .target(name: "NefCore", dependencies: ["NefModels"], path: "project/Core", publicHeadersPath: "Support Files"), + .target(name: "NefMarkdown", dependencies: ["NefCore"], path: "project/Component/NefMarkdown", publicHeadersPath: "Support Files"), + .target(name: "NefJekyll", dependencies: ["NefCore"], path: "project/Component/NefJekyll", publicHeadersPath: "Support Files"), + .target(name: "NefCarbon", dependencies: ["NefModels", "NefCore"], path: "project/Component/NefCarbon", publicHeadersPath: "Support Files"), + .target(name: "nef", dependencies: ["Bow", "BowEffects", "NefCore", diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 63410c37..e34b141b 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -1,16 +1,14 @@ // Copyright © 2019 The nef Authors. import Foundation -import NefModels +@_exported import NefModels import Bow import BowEffects -public enum Render: RenderAPI, RenderFP { - case api - public enum Page: PageAPI, PageFP { - case api +public enum Render: RenderAPI, RenderFP { case build + public enum Page: PageAPI, PageFP { case build } } diff --git a/project/Component/nef/Support Files/Carbon.h b/project/Component/nef/Support Files/Carbon.h deleted file mode 100644 index 1334c615..00000000 --- a/project/Component/nef/Support Files/Carbon.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefCarbon. -FOUNDATION_EXPORT double NefCarbonVersionNumber; - -//! Project version string for NefCarbon. -FOUNDATION_EXPORT const unsigned char NefCarbonVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefCarbon.h" diff --git a/project/Component/nef/Support Files/Core.h b/project/Component/nef/Support Files/Core.h deleted file mode 100644 index 42cc83c0..00000000 --- a/project/Component/nef/Support Files/Core.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for Markup. -FOUNDATION_EXPORT double MarkupVersionNumber; - -//! Project version string for Markup. -FOUNDATION_EXPORT const unsigned char MarkupVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefCore.h" diff --git a/project/Component/nef/Support Files/Jekyll.h b/project/Component/nef/Support Files/Jekyll.h deleted file mode 100644 index c5d62add..00000000 --- a/project/Component/nef/Support Files/Jekyll.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefJekyll. -FOUNDATION_EXPORT double NefJekyllVersionNumber; - -//! Project version string for NefJekyll. -FOUNDATION_EXPORT const unsigned char NefJekyllVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefJekyll.h" diff --git a/project/Component/nef/Support Files/Markdown.h b/project/Component/nef/Support Files/Markdown.h deleted file mode 100644 index c859e40d..00000000 --- a/project/Component/nef/Support Files/Markdown.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © 2019 The nef Authors. - -#import - -//! Project version number for NefMarkdown. -FOUNDATION_EXPORT double NefMarkdownVersionNumber; - -//! Project version string for NefMarkdown. -FOUNDATION_EXPORT const unsigned char NefMarkdownVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefMarkdown.h" diff --git a/project/Component/nef/Support Files/_Carbon.h b/project/Component/nef/Support Files/_Carbon.h new file mode 100644 index 00000000..536be37c --- /dev/null +++ b/project/Component/nef/Support Files/_Carbon.h @@ -0,0 +1,10 @@ +// Copyright © 2019 The nef Authors. + +#import +#import "NefCarbon.h" + +//! Project version number for NefCarbon. +FOUNDATION_EXPORT double CarbonVersionNumber; + +//! Project version string for NefCarbon. +FOUNDATION_EXPORT const unsigned char CarbonVersionString[]; diff --git a/project/Component/nef/Support Files/_Core.h b/project/Component/nef/Support Files/_Core.h new file mode 100644 index 00000000..d896fe32 --- /dev/null +++ b/project/Component/nef/Support Files/_Core.h @@ -0,0 +1,10 @@ +// Copyright © 2019 The nef Authors. + +#import +#import "NefCore.h" + +//! Project version number for Markup. +FOUNDATION_EXPORT double NefCoreVersionNumber; + +//! Project version string for Markup. +FOUNDATION_EXPORT const unsigned char NefCoreVersionString[]; diff --git a/project/Component/nef/Support Files/_Jekyll.h b/project/Component/nef/Support Files/_Jekyll.h new file mode 100644 index 00000000..d6f8b6e7 --- /dev/null +++ b/project/Component/nef/Support Files/_Jekyll.h @@ -0,0 +1,10 @@ +// Copyright © 2019 The nef Authors. + +#import +#import "NefJekyll.h" + +//! Project version number for NefJekyll. +FOUNDATION_EXPORT double JekyllVersionNumber; + +//! Project version string for NefJekyll. +FOUNDATION_EXPORT const unsigned char JekyllVersionString[]; diff --git a/project/Component/nef/Support Files/_Markdown.h b/project/Component/nef/Support Files/_Markdown.h new file mode 100644 index 00000000..ec3711ff --- /dev/null +++ b/project/Component/nef/Support Files/_Markdown.h @@ -0,0 +1,10 @@ +// Copyright © 2019 The nef Authors. + +#import +#import "NefMarkdown.h" + +//! Project version number for NefMarkdown. +FOUNDATION_EXPORT double MarkdownVersionNumber; + +//! Project version string for NefMarkdown. +FOUNDATION_EXPORT const unsigned char MarkdownVersionString[]; diff --git a/project/Component/nef/Support Files/module.modulemap b/project/Component/nef/Support Files/module.modulemap index d8a0c473..6ed14c31 100644 --- a/project/Component/nef/Support Files/module.modulemap +++ b/project/Component/nef/Support Files/module.modulemap @@ -3,24 +3,24 @@ framework module nef { export * explicit module Core { - header "Core.h" + header "_Core.h" export * } explicit module Markdown { - header "Markdown.h" + header "_Markdown.h" export Core export * } explicit module Jekyll { - header "Jekyll.h" + header "_Jekyll.h" export Core export * } explicit module Carbon { - header "Carbon.h" + header "_Carbon.h" export Core export * } diff --git a/project/Component/nef/Support Files/nef.h b/project/Component/nef/Support Files/nef.h index ff9a56ca..bce11115 100644 --- a/project/Component/nef/Support Files/nef.h +++ b/project/Component/nef/Support Files/nef.h @@ -1,12 +1,10 @@ // Copyright © 2019 The nef Authors. #import +#import "NefModels.h" //! Project version number for Nef. FOUNDATION_EXPORT double NefVersionNumber; //! Project version string for Nef. FOUNDATION_EXPORT const unsigned char NefVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import "NefModels.h" diff --git a/project/Package.swift b/project/Package.swift index 2499516a..9f298fd0 100644 --- a/project/Package.swift +++ b/project/Package.swift @@ -7,12 +7,6 @@ let package = Package( .macOS(.v10_14), ], products: [ - .library(name: "NefModels", targets: ["NefModels"]), - .library(name: "NefCore", targets: ["NefCore"]), - .library(name: "NefMarkdown", targets: ["NefMarkdown"]), - .library(name: "NefJekyll", targets: ["NefJekyll"]), - .library(name: "NefCarbon", targets: ["NefCarbon"]), - .executable(name: "nef-markdown-page", targets: ["MarkdownPage"]), .executable(name: "nef-jekyll-page", targets: ["JekyllPage"]), .executable(name: "nef-carbon-page", targets: ["CarbonPage"]), diff --git a/project/UI/CLIKit/Support Files/CLIKit.h b/project/UI/CLIKit/Support Files/CLIKit.h index 352ee422..b90cf0c2 100644 --- a/project/UI/CLIKit/Support Files/CLIKit.h +++ b/project/UI/CLIKit/Support Files/CLIKit.h @@ -7,5 +7,3 @@ FOUNDATION_EXPORT double CLIVersionNumber; //! Project version string for CLI. FOUNDATION_EXPORT const unsigned char CLIVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index 5854bc60..b739f48d 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -18,10 +18,10 @@ 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; 8B0FB5B8237C61C000221548 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5B7237C61C000221548 /* Models.swift */; }; - 8B0FB5BA237D5B7A00221548 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5B9237D5B7A00221548 /* Carbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B0FB5BC237D5B9800221548 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BB237D5B9400221548 /* Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B0FB5BE237D5BAD00221548 /* Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BD237D5BA900221548 /* Jekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B0FB5C0237D5BBF00221548 /* Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BF237D5BBA00221548 /* Markdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5BA237D5B7A00221548 /* _Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5B9237D5B7A00221548 /* _Carbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5BC237D5B9800221548 /* _Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BB237D5B9400221548 /* _Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5BE237D5BAD00221548 /* _Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BD237D5BA900221548 /* _Jekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B0FB5C0237D5BBF00221548 /* _Markdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BF237D5BBA00221548 /* _Markdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D79F22D6235200D05A70 /* NefJekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B12D79D22D6235200D05A70 /* NefJekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85522D392C000919F36 /* NefJekyll.swift */; }; 8B22247B22D4C7B400C85856 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85122D3929B00919F36 /* ConsoleOutput.swift */; }; @@ -187,17 +187,16 @@ /* Begin PBXFileReference section */ 8B0CA51622AE669600181BC0 /* CarbonPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CarbonPage; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B0FB557237B0E6200221548 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = "Component/nef/Support Files/module.modulemap"; sourceTree = SOURCE_ROOT; }; 8B0FB584237C0A5600221548 /* CLIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CLIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B0FB586237C0A5600221548 /* CLIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLIKit.h; sourceTree = ""; }; 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; 8B0FB5B7237C61C000221548 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 8B0FB5B9237D5B7A00221548 /* Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Carbon.h; sourceTree = ""; }; - 8B0FB5BB237D5B9400221548 /* Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; - 8B0FB5BD237D5BA900221548 /* Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Jekyll.h; sourceTree = ""; }; - 8B0FB5BF237D5BBA00221548 /* Markdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Markdown.h; sourceTree = ""; }; + 8B0FB5B9237D5B7A00221548 /* _Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Carbon.h; sourceTree = ""; }; + 8B0FB5BB237D5B9400221548 /* _Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Core.h; sourceTree = ""; }; + 8B0FB5BD237D5BA900221548 /* _Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Jekyll.h; sourceTree = ""; }; + 8B0FB5BF237D5BBA00221548 /* _Markdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Markdown.h; sourceTree = ""; }; 8B12D79B22D6235200D05A70 /* NefJekyll.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefJekyll.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B12D79D22D6235200D05A70 /* NefJekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefJekyll.h; sourceTree = ""; }; 8B12D79E22D6235200D05A70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -250,6 +249,7 @@ 8B424B1F224E28FC00AF9010 /* MarkdownPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MarkdownPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; + 8B646F94237D71C50009AB43 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* JekyllPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JekyllPage; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -365,12 +365,12 @@ 8B3CB83B22D3929B00919F36 /* Support Files */ = { isa = PBXGroup; children = ( - 8B0FB557237B0E6200221548 /* module.modulemap */, + 8B646F94237D71C50009AB43 /* module.modulemap */, 8B603E9F237A3CFE0059C9C7 /* nef.h */, - 8B0FB5BF237D5BBA00221548 /* Markdown.h */, - 8B0FB5BD237D5BA900221548 /* Jekyll.h */, - 8B0FB5B9237D5B7A00221548 /* Carbon.h */, - 8B0FB5BB237D5B9400221548 /* Core.h */, + 8B0FB5BF237D5BBA00221548 /* _Markdown.h */, + 8B0FB5BD237D5BA900221548 /* _Jekyll.h */, + 8B0FB5B9237D5B7A00221548 /* _Carbon.h */, + 8B0FB5BB237D5B9400221548 /* _Core.h */, 8B3CB83D22D3929B00919F36 /* Info.plist */, ); path = "Support Files"; @@ -638,10 +638,10 @@ buildActionMask = 2147483647; files = ( 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */, - 8B0FB5BC237D5B9800221548 /* Core.h in Headers */, - 8B0FB5C0237D5BBF00221548 /* Markdown.h in Headers */, - 8B0FB5BE237D5BAD00221548 /* Jekyll.h in Headers */, - 8B0FB5BA237D5B7A00221548 /* Carbon.h in Headers */, + 8B0FB5BC237D5B9800221548 /* _Core.h in Headers */, + 8B0FB5C0237D5BBF00221548 /* _Markdown.h in Headers */, + 8B0FB5BE237D5BAD00221548 /* _Jekyll.h in Headers */, + 8B0FB5BA237D5B7A00221548 /* _Carbon.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; From ec777f106a1f6efba5db292f2cb7580fee9d917b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Thu, 14 Nov 2019 15:05:43 +0100 Subject: [PATCH 15/20] fix signing in carthage project minor changes in carthage compiler --- bin/nefc | 4 +++- template/ios/carthage/PROJECT.xcodeproj/project.pbxproj | 4 ---- template/osx/carthage/PROJECT.xcodeproj/project.pbxproj | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/nefc b/bin/nefc index fa20b1b0..7472d48a 100755 --- a/bin/nefc +++ b/bin/nefc @@ -180,6 +180,8 @@ buildCarthage() { [ $platformIOS -eq 1 ] && platform="iOS" || platform="osx" cd "$cartfilePath" + rm "Cartfile.resolved" 1>/dev/null 2>/dev/null + if [ "$flag" = "$COMPILE_CACHED_DEPENDENCIES" ]; then carthage bootstrap --cache-builds --platform $platform 1> "$log" 2>&1 else @@ -267,7 +269,7 @@ buildProject() { schemeName=$(schemeNameFromProject "$project") sdk=$(sdkForWorkspaceAndScheme "$projectPath/$workspace" "$schemeName") log="$logPath/$workspaceName.log" - + echo -ne "${reset}Building ${green}$workspaceName${normal} ($schemeName) ..." needBuildProject=$(shouldBuildWorkspace "$workspace" "$flag") diff --git a/template/ios/carthage/PROJECT.xcodeproj/project.pbxproj b/template/ios/carthage/PROJECT.xcodeproj/project.pbxproj index a5e83f13..399677ce 100644 --- a/template/ios/carthage/PROJECT.xcodeproj/project.pbxproj +++ b/template/ios/carthage/PROJECT.xcodeproj/project.pbxproj @@ -153,8 +153,6 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = UKS358BH88; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -163,8 +161,6 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = UKS358BH88; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/template/osx/carthage/PROJECT.xcodeproj/project.pbxproj b/template/osx/carthage/PROJECT.xcodeproj/project.pbxproj index c81a3657..54a687fa 100644 --- a/template/osx/carthage/PROJECT.xcodeproj/project.pbxproj +++ b/template/osx/carthage/PROJECT.xcodeproj/project.pbxproj @@ -155,8 +155,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = UKS358BH88; + PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; @@ -164,8 +163,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = UKS358BH88; + PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; From 1fb795eab482fd8ad0be24468e2d3dbce4c58ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Thu, 14 Nov 2019 15:23:53 +0100 Subject: [PATCH 16/20] the same output type for funcional APIs in nef library --- project/Component/nef/API.swift | 6 +++--- project/Component/nef/Models.swift | 4 +++- project/Component/nef/PageAPI.swift | 4 ++-- project/Component/nef/RenderAPI.swift | 9 ++++----- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index e34b141b..9c8ff40d 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -42,7 +42,7 @@ public protocol RenderFP: RenderAPI { /// - carbon: content+style to generate code snippet. /// - output: output where to render the snippets. /// - Returns: An `IO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. - func carbonIO(_ carbon: Carbon, output: URL) -> IO + func carbonIO(_ carbon: Carbon, output: URL) -> IO } public protocol PageAPI { @@ -79,7 +79,7 @@ public protocol PageFP { /// - content: content page in Xcode playground. /// - output: output where to write the Markdown render. /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func markdownIO(content: String, to output: URL) -> IO + func markdownIO(content: String, to output: URL) -> IO /// Renders content into Jekyll format. /// @@ -90,5 +90,5 @@ public protocol PageFP { /// - output: output where to write the Markdown render. /// - permalink: website relative url where locate the page. /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func jekyllIO(content: String, to output: URL, permalink: String) -> IO + func jekyllIO(content: String, to output: URL, permalink: String) -> IO } diff --git a/project/Component/nef/Models.swift b/project/Component/nef/Models.swift index 9e36f00c..04957f9f 100644 --- a/project/Component/nef/Models.swift +++ b/project/Component/nef/Models.swift @@ -2,7 +2,9 @@ import Foundation -public enum PageError: Error { +public enum Error: Swift.Error { case markdown case jekyll + case carbon + case invalidSnapshot } diff --git a/project/Component/nef/PageAPI.swift b/project/Component/nef/PageAPI.swift index 5d3ddfd4..3673db8a 100644 --- a/project/Component/nef/PageAPI.swift +++ b/project/Component/nef/PageAPI.swift @@ -37,7 +37,7 @@ public extension PageAPI { public extension PageFP where Self: PageAPI { - func markdownIO(content: String, to output: URL) -> IO { + func markdownIO(content: String, to output: URL) -> IO { IO.async { callback in self.markdown(content: content, to: output.path, @@ -51,7 +51,7 @@ public extension PageFP where Self: PageAPI { }^ } - func jekyllIO(content: String, to output: URL, permalink: String) -> IO { + func jekyllIO(content: String, to output: URL, permalink: String) -> IO { IO.async { callback in self.jekyll(content: content, to: output.path, diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index 5559c741..de4b7aef 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -34,8 +34,8 @@ public extension RenderAPI { public extension RenderFP where Self: RenderAPI { - func carbonIO(_ carbon: Carbon, output: URL) -> IO { - func runAsync(carbon: Carbon, outputURL: URL) -> IO { + func carbonIO(_ carbon: Carbon, output: URL) -> IO { + func runAsync(carbon: Carbon, outputURL: URL) -> IO { IO.async { callback in self.carbon(code: carbon.code, style: carbon.style, @@ -43,7 +43,7 @@ public extension RenderFP where Self: RenderAPI { success: { let file = URL(fileURLWithPath: "\(outputURL.path).png") let fileExist = FileManager.default.fileExists(atPath: file.path) - fileExist ? callback(.right(file)) : callback(.left(.notFound)) + fileExist ? callback(.right(file)) : callback(.left(.carbon)) }, failure: { error in callback(.left(.invalidSnapshot)) @@ -55,8 +55,7 @@ public extension RenderFP where Self: RenderAPI { fatalError("carbonIO(_ carbon:,output:) should be invoked in background thread") } - let file = IO.var() - + let file = IO.var() return binding( continueOn(.main), file <- runAsync(carbon: carbon, outputURL: output), From 9b184270f90ab79801e54afb2dbfb86cbfdfc941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Sat, 16 Nov 2019 17:53:26 +0100 Subject: [PATCH 17/20] add Carbon View to render code with carbon-style --- project/Component/nef/API.swift | 8 ++ .../nef/{Models.swift => Models/Error.swift} | 0 project/Component/nef/RenderAPI.swift | 2 + project/Component/nef/Views/CarbonView.swift | 86 +++++++++++++++++++ project/nef.xcodeproj/project.pbxproj | 28 +++++- .../xcshareddata/swiftpm/Package.resolved | 70 --------------- 6 files changed, 120 insertions(+), 74 deletions(-) rename project/Component/nef/{Models.swift => Models/Error.swift} (100%) create mode 100644 project/Component/nef/Views/CarbonView.swift delete mode 100644 project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 9c8ff40d..8f6baeef 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -31,6 +31,14 @@ public protocol RenderAPI { /// - Parameter carbon: configuration /// - Returns: URL request to carbon.now.sh func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest + + /// Get an URL Request given a carbon configuration + /// + /// - Parameters: + /// - code: content to render in the view . + /// - state: style to apply to code. + /// - Returns: View + func carbonView(code: String, state: CarbonStyle) -> CarbonView } public protocol RenderFP: RenderAPI { diff --git a/project/Component/nef/Models.swift b/project/Component/nef/Models/Error.swift similarity index 100% rename from project/Component/nef/Models.swift rename to project/Component/nef/Models/Error.swift diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index de4b7aef..db019f9e 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -29,6 +29,8 @@ public extension RenderAPI { } func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest { CarbonViewer.urlRequest(from: carbon) } + + func carbonView(code: String, state: CarbonStyle) -> CarbonView { CarbonWebView(code: code, state: state) } } diff --git a/project/Component/nef/Views/CarbonView.swift b/project/Component/nef/Views/CarbonView.swift new file mode 100644 index 00000000..3b2b9506 --- /dev/null +++ b/project/Component/nef/Views/CarbonView.swift @@ -0,0 +1,86 @@ +// Copyright © 2019 The nef Authors. + +import AppKit +import WebKit + +public protocol CarbonLoadingView: NSView { + func show() + func hide() +} + +public protocol CarbonView: NSView { + var loadingView: CarbonLoadingView? { get set } + func update(state: CarbonStyle) +} + + +class CarbonWebView: WKWebView, WKNavigationDelegate { + private let code: String + private var state: CarbonStyle + weak var loadingView: CarbonLoadingView? + + init(code: String, state: CarbonStyle) { + self.code = code + self.state = state + super.init(frame: .zero, configuration: WKWebViewConfiguration()) + + self.navigationDelegate = self + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewWillMove(toSuperview newSuperview: NSView?) { + guard newSuperview != nil else { return } + + if #available(OSX 10.15, *) { + isHorizontalContentSizeConstraintActive = false + isVerticalContentSizeConstraintActive = false + } + + loadCarbonWebView() + } + + override func hitTest(_ point: NSPoint) -> NSView? { + return nil // disabled user interaction + } + + private func loadCarbonWebView() { + loadingView?.show() + + let carbon = Carbon(code: code, style: state) + let request = nef.Render.build.carbonURLRequest(withConfiguration: carbon) + load(request) + } + + // MARK: delegate + func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { + loadingView?.show() + } + + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { + resetPosition { [weak self] in self?.loadingView?.hide() } + } + + // MARK: javascript + private func resetPosition(completionHandler: @escaping () -> Void) { + let javaScript = "var main = document.getElementsByClassName('main')[0];" + + "var container = document.getElementsByClassName('export-container')[0];" + + "main.replaceWith(container);" + + "container.className = 'export-container';" + + "container.setAttribute('style', 'position: absolute; width: 100%; height: 200px; top: 0px');" + + evaluateJavaScript(javaScript) { (_, _) in + DispatchQueue.main.asyncAfter(wallDeadline: .now() + .milliseconds(500), execute: completionHandler) + } + } +} + +extension CarbonWebView: CarbonView { + public func update(state: CarbonStyle) { + guard self.state != state else { return } + self.state = state + loadCarbonWebView() + } +} diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index b739f48d..caad7c46 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ 8B0FB5A8237C1DD000221548 /* BowOptics in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A4237C1D3700221548 /* BowOptics */; }; 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; - 8B0FB5B8237C61C000221548 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5B7237C61C000221548 /* Models.swift */; }; + 8B0FB5B8237C61C000221548 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5B7237C61C000221548 /* Error.swift */; }; 8B0FB5BA237D5B7A00221548 /* _Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5B9237D5B7A00221548 /* _Carbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B0FB5BC237D5B9800221548 /* _Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BB237D5B9400221548 /* _Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B0FB5BE237D5BAD00221548 /* _Jekyll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0FB5BD237D5BA900221548 /* _Jekyll.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -59,6 +59,7 @@ 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9F237A3CFE0059C9C7 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; + 8B75AF9123805A5200388B1C /* CarbonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B75AF9023805A5200388B1C /* CarbonView.swift */; }; 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8BCDC72022F0455D00174A19 /* CarbonViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */; }; /* End PBXBuildFile section */ @@ -192,7 +193,7 @@ 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; - 8B0FB5B7237C61C000221548 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 8B0FB5B7237C61C000221548 /* Error.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; 8B0FB5B9237D5B7A00221548 /* _Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Carbon.h; sourceTree = ""; }; 8B0FB5BB237D5B9400221548 /* _Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Core.h; sourceTree = ""; }; 8B0FB5BD237D5BA900221548 /* _Jekyll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Jekyll.h; sourceTree = ""; }; @@ -253,6 +254,7 @@ 8B6B119422CB9FDE0060177F /* NefCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* JekyllPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JekyllPage; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B75AF9023805A5200388B1C /* CarbonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarbonView.swift; sourceTree = ""; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -356,7 +358,8 @@ 8B0FB59D237C0EF000221548 /* API.swift */, 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */, 8B0FB5A1237C1AC700221548 /* PageAPI.swift */, - 8B0FB5B7237C61C000221548 /* Models.swift */, + 8B75AF9523805B3400388B1C /* Models */, + 8B75AF9223805B1900388B1C /* Views */, 8B3CB83B22D3929B00919F36 /* Support Files */, ); path = nef; @@ -590,6 +593,22 @@ name = Frameworks; sourceTree = ""; }; + 8B75AF9223805B1900388B1C /* Views */ = { + isa = PBXGroup; + children = ( + 8B75AF9023805A5200388B1C /* CarbonView.swift */, + ); + path = Views; + sourceTree = ""; + }; + 8B75AF9523805B3400388B1C /* Models */ = { + isa = PBXGroup; + children = ( + 8B0FB5B7237C61C000221548 /* Error.swift */, + ); + path = Models; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1037,9 +1056,10 @@ buildActionMask = 2147483647; files = ( 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */, + 8B75AF9123805A5200388B1C /* CarbonView.swift in Sources */, 8B0FB59E237C0EF000221548 /* API.swift in Sources */, 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */, - 8B0FB5B8237C61C000221548 /* Models.swift in Sources */, + 8B0FB5B8237C61C000221548 /* Error.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index c3b3c406..00000000 --- a/project/nef.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,70 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Bow", - "repositoryURL": "https://github.com/bow-swift/bow.git", - "state": { - "branch": null, - "revision": "a1361fdd76660000e1ff1ff98f83ff76f62e1925", - "version": "0.6.0" - } - }, - { - "package": "FileCheck", - "repositoryURL": "https://github.com/llvm-swift/FileCheck.git", - "state": { - "branch": null, - "revision": "0eb888b85ca08c7ce85c8a6a459c94d7f282c1bb", - "version": "0.2.1" - } - }, - { - "package": "Rainbow", - "repositoryURL": "https://github.com/onevcat/Rainbow.git", - "state": { - "branch": null, - "revision": "9c52c1952e9b2305d4507cf473392ac2d7c9b155", - "version": "3.1.5" - } - }, - { - "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", - "state": { - "branch": null, - "revision": "b3e888b4972d9bc76495dd74d30a8c7fad4b9395", - "version": "5.0.1" - } - }, - { - "package": "llbuild", - "repositoryURL": "https://github.com/apple/swift-llbuild.git", - "state": { - "branch": null, - "revision": "f73b84bc1525998e5e267f9d830c1411487ac65e", - "version": "0.2.0" - } - }, - { - "package": "SwiftPM", - "repositoryURL": "https://github.com/apple/swift-package-manager.git", - "state": { - "branch": null, - "revision": "9abcc2260438177cecd7cf5185b144d13e74122b", - "version": "0.5.0" - } - }, - { - "package": "SwiftCheck", - "repositoryURL": "https://github.com/typelift/SwiftCheck.git", - "state": { - "branch": null, - "revision": "077c096c3ddfc38db223ac8e525ad16ffb987138", - "version": "0.12.0" - } - } - ] - }, - "version": 1 -} From 135ab1cfc17de91e41b78b7c513616a256314a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Sat, 16 Nov 2019 20:00:00 +0100 Subject: [PATCH 18/20] fix margins in carbon webview --- project/Component/NefModels/CarbonModel.swift | 9 +++++++++ project/Component/nef/Views/CarbonView.swift | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/project/Component/NefModels/CarbonModel.swift b/project/Component/NefModels/CarbonModel.swift index a4ae56f1..0dcf9f1e 100644 --- a/project/Component/NefModels/CarbonModel.swift +++ b/project/Component/NefModels/CarbonModel.swift @@ -168,6 +168,15 @@ extension CarbonStyle.Color { guard let value = CarbonStyle.Color.all[string.lowercased()] else { return nil } self = value } + + public var hex: String { + let opacity = UInt8(255 * a) + return "\(r.hex)\(g.hex)\(b.hex)\(opacity.hex)" + } +} + +private extension UInt8 { + var hex: String { String(format: "%02X", self) } } // MARK: Helpers diff --git a/project/Component/nef/Views/CarbonView.swift b/project/Component/nef/Views/CarbonView.swift index 3b2b9506..96726728 100644 --- a/project/Component/nef/Views/CarbonView.swift +++ b/project/Component/nef/Views/CarbonView.swift @@ -65,11 +65,15 @@ class CarbonWebView: WKWebView, WKNavigationDelegate { // MARK: javascript private func resetPosition(completionHandler: @escaping () -> Void) { - let javaScript = "var main = document.getElementsByClassName('main')[0];" + + let javaScript = "var html = document.getElementsByTagName('html')[0];" + + "var body = document.getElementsByTagName('body')[0];" + + "var main = document.getElementsByClassName('main')[0];" + "var container = document.getElementsByClassName('export-container')[0];" + "main.replaceWith(container);" + "container.className = 'export-container';" + - "container.setAttribute('style', 'position: absolute; width: 100%; height: 200px; top: 0px');" + "container.setAttribute('style', 'position: absolute; height: 0px; width: 100%; float: left; top: 0px;');" + + "html.setAttribute('style', 'min-height: 0px; margin: 0px; background: #\(state.background.hex);');" + + "body.setAttribute('style', 'min-height: 0px; margin: 0px; background: transparent;');" evaluateJavaScript(javaScript) { (_, _) in DispatchQueue.main.asyncAfter(wallDeadline: .now() + .milliseconds(500), execute: completionHandler) From 52bac773817affff22e8166f5ffa79b5e1ae1b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Sat, 16 Nov 2019 22:52:32 +0100 Subject: [PATCH 19/20] minor changes in the nef functional api definition --- project/Component/nef/API.swift | 12 ++++++------ project/Component/nef/PageAPI.swift | 6 ++++-- project/Component/nef/RenderAPI.swift | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 8f6baeef..5174200a 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -48,9 +48,9 @@ public protocol RenderFP: RenderAPI { /// /// - Parameters: /// - carbon: content+style to generate code snippet. - /// - output: output where to render the snippets. + /// - file: output where to render the snippets (path to the file without extension). /// - Returns: An `IO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. - func carbonIO(_ carbon: Carbon, output: URL) -> IO + func carbonIO(carbon: Carbon, toFile file: URL) -> IO } public protocol PageAPI { @@ -85,9 +85,9 @@ public protocol PageFP { /// /// - Parameters: /// - content: content page in Xcode playground. - /// - output: output where to write the Markdown render. + /// - file: output where to write the Markdown render (path to the file without extension). /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func markdownIO(content: String, to output: URL) -> IO + func markdownIO(content: String, toFile file: URL) -> IO /// Renders content into Jekyll format. /// @@ -95,8 +95,8 @@ public protocol PageFP { /// /// - Parameters: /// - content: content page in Xcode playground. - /// - output: output where to write the Markdown render. + /// - file: output where to write the Markdown render (path to the file without extension). /// - permalink: website relative url where locate the page. /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func jekyllIO(content: String, to output: URL, permalink: String) -> IO + func jekyllIO(content: String, toFile file: URL, permalink: String) -> IO } diff --git a/project/Component/nef/PageAPI.swift b/project/Component/nef/PageAPI.swift index 3673db8a..a9a4621a 100644 --- a/project/Component/nef/PageAPI.swift +++ b/project/Component/nef/PageAPI.swift @@ -37,8 +37,9 @@ public extension PageAPI { public extension PageFP where Self: PageAPI { - func markdownIO(content: String, to output: URL) -> IO { + func markdownIO(content: String, toFile file: URL) -> IO { IO.async { callback in + let output = URL(fileURLWithPath: "\(file.path).md") self.markdown(content: content, to: output.path, success: { @@ -51,8 +52,9 @@ public extension PageFP where Self: PageAPI { }^ } - func jekyllIO(content: String, to output: URL, permalink: String) -> IO { + func jekyllIO(content: String, toFile file: URL, permalink: String) -> IO { IO.async { callback in + let output = URL(fileURLWithPath: "\(file.path).md") self.jekyll(content: content, to: output.path, permalink: permalink, diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/RenderAPI.swift index db019f9e..4ddd4601 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/RenderAPI.swift @@ -36,7 +36,7 @@ public extension RenderAPI { public extension RenderFP where Self: RenderAPI { - func carbonIO(_ carbon: Carbon, output: URL) -> IO { + func carbonIO(carbon: Carbon, toFile output: URL) -> IO{ func runAsync(carbon: Carbon, outputURL: URL) -> IO { IO.async { callback in self.carbon(code: carbon.code, From 97d62da6ea9fabff2c542b143b87db41e2b4fc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=CC=81ngel=20Di=CC=81az?= Date: Mon, 18 Nov 2019 17:59:33 +0100 Subject: [PATCH 20/20] comments in PR comments in PR comments in PR --- .gitignore | 1 + .../NefCarbon/App/CarbonSyncDownloader.swift | 4 +- .../NefCarbon/App/CarbonViewer.swift | 2 +- .../NefCarbon/App/CarbonWebView.swift | 12 +-- project/Component/NefCarbon/NefCarbon.swift | 2 +- project/Component/NefModels/CarbonModel.swift | 10 +-- project/Component/nef/API.swift | 82 +++++-------------- .../nef/{RenderAPI.swift => CarbonAPI.swift} | 77 +++++++++-------- project/Component/nef/JekyllAPI.swift | 53 ++++++++++++ project/Component/nef/MarkdownAPI.swift | 50 +++++++++++ project/Component/nef/PageAPI.swift | 70 ---------------- project/Component/nef/Views/CarbonView.swift | 4 +- .../Render/{Carbon.swift => CoreCarbon.swift} | 6 +- .../Render/{Jekyll.swift => CoreJekyll.swift} | 0 .../{Markdown.swift => CoreMarkdown.swift} | 0 .../Render/{Render.swift => CoreRender.swift} | 8 +- project/nef.xcodeproj/project.pbxproj | 52 ++++++------ 17 files changed, 218 insertions(+), 215 deletions(-) rename project/Component/nef/{RenderAPI.swift => CarbonAPI.swift} (70%) create mode 100644 project/Component/nef/JekyllAPI.swift create mode 100644 project/Component/nef/MarkdownAPI.swift delete mode 100644 project/Component/nef/PageAPI.swift rename project/Core/Render/{Carbon.swift => CoreCarbon.swift} (89%) rename project/Core/Render/{Jekyll.swift => CoreJekyll.swift} (100%) rename project/Core/Render/{Markdown.swift => CoreMarkdown.swift} (100%) rename project/Core/Render/{Render.swift => CoreRender.swift} (87%) diff --git a/.gitignore b/.gitignore index de95641c..8207b377 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ BowPlayground Package.resolved .swiftpm bin-cli +swiftpm ## Jekyll _site diff --git a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift index e8bf70ec..1b68c5a3 100644 --- a/project/Component/NefCarbon/App/CarbonSyncDownloader.swift +++ b/project/Component/NefCarbon/App/CarbonSyncDownloader.swift @@ -20,8 +20,8 @@ class CarbonSyncDownloader: CarbonDownloader, CarbonViewDelegate { } // MARK: delegate - func carbon(withConfiguration configuration: Carbon, filename: String) -> Result { - guard let view = view else { return .failure(CarbonError(filename: filename, snippet: configuration.code, error: .notFound)) } + func carbon(withConfiguration configuration: CarbonModel, filename: String) -> Result { + guard let view = view else { return .failure(CarbonError(filename: filename, snippet: configuration.code, cause: .notFound)) } run { let filename = self.multiFiles ? "\(filename)-\(self.counter)" : filename diff --git a/project/Component/NefCarbon/App/CarbonViewer.swift b/project/Component/NefCarbon/App/CarbonViewer.swift index e051534c..38d75aed 100644 --- a/project/Component/NefCarbon/App/CarbonViewer.swift +++ b/project/Component/NefCarbon/App/CarbonViewer.swift @@ -5,7 +5,7 @@ import NefModels public enum CarbonViewer { - public static func urlRequest(from carbon: Carbon) -> URLRequest { + public static func urlRequest(from carbon: CarbonModel) -> URLRequest { let backgroundColorItem = URLQueryItem(name: "bg", value: "\(carbon.style.background)") let themeItem = URLQueryItem(name: "t", value: carbon.style.theme.rawValue) let windowsThemeItem = URLQueryItem(name: "wt", value: "none") diff --git a/project/Component/NefCarbon/App/CarbonWebView.swift b/project/Component/NefCarbon/App/CarbonWebView.swift index 0deafea5..6d75b87a 100644 --- a/project/Component/NefCarbon/App/CarbonWebView.swift +++ b/project/Component/NefCarbon/App/CarbonWebView.swift @@ -7,7 +7,7 @@ import NefModels /// Carbon view definition public protocol CarbonView: NSView { var carbonDelegate: CarbonViewDelegate? { get set } - func load(carbon: Carbon, filename: String) + func load(carbon: CarbonModel, filename: String) } public protocol CarbonViewDelegate: class { @@ -20,7 +20,7 @@ public protocol CarbonViewDelegate: class { class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView { private var filename: String? - private var carbon: Carbon? + private var carbon: CarbonModel? private var isCached: Bool = false weak var carbonDelegate: CarbonViewDelegate? @@ -33,7 +33,7 @@ class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView { fatalError("init(coder:) has not been implemented") } - func load(carbon: Carbon, filename: String) { + func load(carbon: CarbonModel, filename: String) { self.filename = filename self.carbon = carbon isCached ? launchCachedRequest() : buildCache() @@ -42,7 +42,7 @@ class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView { // MARK: private methods private func buildCache() { let style = CarbonStyle(background: .bow, theme: .dracula, size: .x5, fontType: .firaCode, lineNumbers: true, watermark: true) - let carbon = Carbon(code: "", style: style) + let carbon = CarbonModel(code: "", style: style) let request = CarbonViewer.urlRequest(from: carbon) launch(carbonRequest: request) } @@ -62,7 +62,7 @@ class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView { private func screenshot() { guard let filename = filename, let code = carbon?.code else { didFailLoadingCarbonWebView(); return } - let screenshotError = CarbonError(filename: filename, snippet: code, error: .invalidSnapshot) + let screenshotError = CarbonError(filename: filename, snippet: code, cause: .invalidSnapshot) let scale = CGFloat(carbon?.style.size.rawValue ?? 1) setZoom(in: self, scale: scale) @@ -100,7 +100,7 @@ class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView { } private func didFailLoadingCarbonWebView() { - let error = CarbonError(filename: filename ?? "", snippet: carbon?.code ?? "", error: .notFound) + let error = CarbonError(filename: filename ?? "", snippet: carbon?.code ?? "", cause: .notFound) carbonDelegate?.didFailLoadCarbon(error: error) } diff --git a/project/Component/NefCarbon/NefCarbon.swift b/project/Component/NefCarbon/NefCarbon.swift index e8ca09d2..e020ac28 100644 --- a/project/Component/NefCarbon/NefCarbon.swift +++ b/project/Component/NefCarbon/NefCarbon.swift @@ -25,6 +25,6 @@ public func renderCarbon(downloader: CarbonDownloader, code content: String, sty /// /// - Parameter carbon: configuration /// - Returns: URL request to carbon.now.sh -public func carbonURLRequest(from carbon: Carbon) -> URLRequest { +public func carbonURLRequest(from carbon: CarbonModel) -> URLRequest { return CarbonViewer.urlRequest(from: carbon) } diff --git a/project/Component/NefModels/CarbonModel.swift b/project/Component/NefModels/CarbonModel.swift index 0dcf9f1e..5b02b76a 100644 --- a/project/Component/NefModels/CarbonModel.swift +++ b/project/Component/NefModels/CarbonModel.swift @@ -2,7 +2,7 @@ import Foundation -public struct Carbon: Codable, Equatable { +public struct CarbonModel: Codable, Equatable { public let code: String public let style: CarbonStyle @@ -121,16 +121,16 @@ extension CarbonStyle.Color { public struct CarbonError: Error { public let filename: String public let snippet: String - public let error: CarbonError.Option + public let cause: CarbonError.Cause - public init(filename: String, snippet: String, error: CarbonError.Option) { + public init(filename: String, snippet: String, cause: CarbonError.Cause) { self.filename = filename self.snippet = snippet - self.error = error + self.cause = cause } // MARK: Error options - public enum Option: Error, CustomStringConvertible { + public enum Cause: Error, CustomStringConvertible { case notFound case invalidSnapshot diff --git a/project/Component/nef/API.swift b/project/Component/nef/API.swift index 5174200a..4b7479ef 100644 --- a/project/Component/nef/API.swift +++ b/project/Component/nef/API.swift @@ -7,78 +7,36 @@ import Bow import BowEffects -public enum Render: RenderAPI, RenderFP { case build - public enum Page: PageAPI, PageFP { case build - } -} +public enum Markdown: MarkdownAPI {} +public enum Jekyll: JekyllAPI {} +public enum Carbon: CarbonAPI {} -public protocol RenderAPI { - /// Renders a code selection into multiple Carbon images. +public protocol CarbonAPI { + /// Renders a code selection into Carbon image. /// - /// - Precondition: this method must be invoked from main thread. + /// - Precondition: this method must be invoked from background thread. /// /// - Parameters: - /// - code: content to generate the snippet. - /// - style: style to apply to exported code snippet. - /// - outputPath: output where to render the snippets. - /// - success: callback to notify if everything goes well. - /// - failure: callback with information to notify if something goes wrong. - func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) + /// - carbon: content+style to generate code snippet. + /// - file: output where to render the snippets (path to the file without extension). + /// - Returns: An `IO` to perform IO operations that produce carbon error of type `CarbonError.Cause` and values with the file generated of type `URL`. + static func render(carbon: CarbonModel, toFile file: URL) -> IO /// Get an URL Request given a carbon configuration /// /// - Parameter carbon: configuration /// - Returns: URL request to carbon.now.sh - func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest + static func request(with configuration: CarbonModel) -> URLRequest - /// Get an URL Request given a carbon configuration - /// - /// - Parameters: - /// - code: content to render in the view . - /// - state: style to apply to code. - /// - Returns: View - func carbonView(code: String, state: CarbonStyle) -> CarbonView -} - -public protocol RenderFP: RenderAPI { - /// Renders a code selection into multiple Carbon images. - /// - /// - Precondition: this method must be invoked from background thread. + /// Get a NSView given a carbon configuration /// - /// - Parameters: - /// - carbon: content+style to generate code snippet. - /// - file: output where to render the snippets (path to the file without extension). - /// - Returns: An `IO` to perform IO operations that produce carbon error of type `CarbonError.Option` and values with the file generated of type `URL`. - func carbonIO(carbon: Carbon, toFile file: URL) -> IO -} - -public protocol PageAPI { - /// Renders content into Markdown file. - /// - /// - Precondition: this method must be invoked from main thread. - /// - /// - Parameters: - /// - content: content page in Xcode playground. - /// - outputPath: output where to write the Markdown render. - /// - success: callback to notify if everything goes well. - /// - failure: callback with information to notify if something goes wrong. - func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) - - /// Renders content into Jekyll format. - /// - /// - Precondition: this method must be invoked from main thread. - /// - /// - Parameters: - /// - content: content page in Xcode playground. - /// - outputPath: output where to write the Markdown render. - /// - permalink: website relative url where locate the page. - /// - success: callback to notify if everything goes well. - /// - failure: callback with information to notify if something goes wrong. - func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) + /// - Parameter carbon: configuration + /// - Returns: NSView + static func view(with configuration: CarbonModel) -> CarbonView } -public protocol PageFP { +public protocol MarkdownAPI { /// Renders content into Markdown file. /// /// - Precondition: this method must be invoked from main thread. @@ -87,8 +45,10 @@ public protocol PageFP { /// - content: content page in Xcode playground. /// - file: output where to write the Markdown render (path to the file without extension). /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func markdownIO(content: String, toFile file: URL) -> IO - + static func render(content: String, toFile file: URL) -> IO +} + +public protocol JekyllAPI { /// Renders content into Jekyll format. /// /// - Precondition: this method must be invoked from main thread. @@ -98,5 +58,5 @@ public protocol PageFP { /// - file: output where to write the Markdown render (path to the file without extension). /// - permalink: website relative url where locate the page. /// - Returns: An `IO` to perform IO operations that produce carbon error of type `PageError` and values with the file generated of type `URL`. - func jekyllIO(content: String, toFile file: URL, permalink: String) -> IO + static func render(content: String, toFile file: URL, permalink: String) -> IO } diff --git a/project/Component/nef/RenderAPI.swift b/project/Component/nef/CarbonAPI.swift similarity index 70% rename from project/Component/nef/RenderAPI.swift rename to project/Component/nef/CarbonAPI.swift index 4ddd4601..dcbbd6f3 100644 --- a/project/Component/nef/RenderAPI.swift +++ b/project/Component/nef/CarbonAPI.swift @@ -7,37 +7,10 @@ import NefCarbon import Bow import BowEffects - -public extension RenderAPI { - - func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("carbon(code:style:outputPath:success:failure:) should be invoked in main thread") - } - - let assembler = CarbonAssembler() - let window = assembler.resolveWindow() - let view = window.contentView! - let retainSuccess = { success(); _ = view } - let retainFailure = { (output: String) in failure(output); _ = view } - - carbon(parentView: view, - code: code, - style: style, - outputPath: outputPath, - success: retainSuccess, failure: retainFailure) - } - - func carbonURLRequest(withConfiguration carbon: Carbon) -> URLRequest { CarbonViewer.urlRequest(from: carbon) } +public extension CarbonAPI { - func carbonView(code: String, state: CarbonStyle) -> CarbonView { CarbonWebView(code: code, state: state) } -} - - -public extension RenderFP where Self: RenderAPI { - - func carbonIO(carbon: Carbon, toFile output: URL) -> IO{ - func runAsync(carbon: Carbon, outputURL: URL) -> IO { + static func render(carbon: CarbonModel, toFile output: URL) -> IO { + func runAsync(carbon: CarbonModel, outputURL: URL) -> IO { IO.async { callback in self.carbon(code: carbon.code, style: carbon.style, @@ -63,11 +36,43 @@ public extension RenderFP where Self: RenderAPI { file <- runAsync(carbon: carbon, outputURL: output), yield: file.get)^ } + + static func request(with configuration: CarbonModel) -> URLRequest { CarbonViewer.urlRequest(from: configuration) } + + static func view(with configuration: CarbonModel) -> CarbonView { CarbonWebView(code: configuration.code, state: configuration.style) } } // MARK: - Helpers -internal extension RenderAPI { +fileprivate extension CarbonAPI { + + /// Renders a code selection into multiple Carbon images. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - code: content to generate the snippet. + /// - style: style to apply to exported code snippet. + /// - outputPath: output where to render the snippets. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + static func carbon(code: String, style: CarbonStyle, outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("carbon(code:style:outputPath:success:failure:) should be invoked in main thread") + } + + let assembler = CarbonAssembler() + let window = assembler.resolveWindow() + let view = window.contentView! + let retainSuccess = { success(); _ = view } + let retainFailure = { (output: String) in failure(output); _ = view } + + carbon(parentView: view, + code: code, + style: style, + outputPath: outputPath, + success: retainSuccess, failure: retainFailure) + } /// Renders a code selection into multiple Carbon images. /// @@ -80,11 +85,11 @@ internal extension RenderAPI { /// - outputPath: output where to render the snippets. /// - success: callback to notify if everything goes well. /// - failure: callback with information to notify if something goes wrong. - func carbon(parentView: NSView, - code: String, - style: CarbonStyle, - outputPath: String, - success: @escaping () -> Void, failure: @escaping (String) -> Void) { + static func carbon(parentView: NSView, + code: String, + style: CarbonStyle, + outputPath: String, + success: @escaping () -> Void, failure: @escaping (String) -> Void) { guard Thread.isMainThread else { fatalError("carbon(parentView:code:style:outputPath:success:failure:) should be invoked in main thread") } diff --git a/project/Component/nef/JekyllAPI.swift b/project/Component/nef/JekyllAPI.swift new file mode 100644 index 00000000..44b84620 --- /dev/null +++ b/project/Component/nef/JekyllAPI.swift @@ -0,0 +1,53 @@ +// Copyright © 2019 The nef Authors. + +import Foundation +import NefModels +import NefJekyll + +import Bow +import BowEffects + +public extension JekyllAPI { + + static func render(content: String, toFile file: URL, permalink: String) -> IO { + IO.async { callback in + let output = URL(fileURLWithPath: "\(file.path).md") + self.jekyll(content: content, + to: output.path, + permalink: permalink, + success: { + let fileExist = FileManager.default.fileExists(atPath: output.path) + fileExist ? callback(.right(output)) : callback(.left(.markdown)) + }, + failure: { error in + callback(.left(.markdown)) + }) + }^ + } +} + +// MARK: - Helpers +fileprivate extension JekyllAPI { + + /// Renders content into Jekyll format. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - outputPath: output where to write the Markdown render. + /// - permalink: website relative url where locate the page. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + static func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("jekyll(content:outputPath:permalink:success:failure:) should be invoked in main thread") + } + + renderJekyll(content: content, + to: outputPath, + permalink: permalink, + success: success, + failure: failure) + } +} diff --git a/project/Component/nef/MarkdownAPI.swift b/project/Component/nef/MarkdownAPI.swift new file mode 100644 index 00000000..c329df69 --- /dev/null +++ b/project/Component/nef/MarkdownAPI.swift @@ -0,0 +1,50 @@ +// Copyright © 2019 The nef Authors. + +import Foundation +import NefModels +import NefMarkdown + +import Bow +import BowEffects + +public extension MarkdownAPI { + + static func render(content: String, toFile file: URL) -> IO { + IO.async { callback in + let output = URL(fileURLWithPath: "\(file.path).md") + self.markdown(content: content, + to: output.path, + success: { + let fileExist = FileManager.default.fileExists(atPath: output.path) + fileExist ? callback(.right(output)) : callback(.left(.markdown)) + }, + failure: { error in + callback(.left(.markdown)) + }) + }^ + } +} + +// MARK: - Helpers +fileprivate extension MarkdownAPI { + + /// Renders content into Markdown file. + /// + /// - Precondition: this method must be invoked from main thread. + /// + /// - Parameters: + /// - content: content page in Xcode playground. + /// - outputPath: output where to write the Markdown render. + /// - success: callback to notify if everything goes well. + /// - failure: callback with information to notify if something goes wrong. + static func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { + guard Thread.isMainThread else { + fatalError("markdown(content:outputPath:success:failure:) should be invoked in main thread") + } + + renderMarkdown(content: content, + to: outputPath, + success: success, + failure: failure) + } +} diff --git a/project/Component/nef/PageAPI.swift b/project/Component/nef/PageAPI.swift deleted file mode 100644 index a9a4621a..00000000 --- a/project/Component/nef/PageAPI.swift +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright © 2019 The nef Authors. - -import Foundation -import NefModels -import NefMarkdown -import NefJekyll - -import Bow -import BowEffects - - -public extension PageAPI { - - func markdown(content: String, to outputPath: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("markdown(content:outputPath:success:failure:) should be invoked in main thread") - } - - renderMarkdown(content: content, - to: outputPath, - success: success, - failure: failure) - } - - func jekyll(content: String, to outputPath: String, permalink: String, success: @escaping () -> Void, failure: @escaping (String) -> Void) { - guard Thread.isMainThread else { - fatalError("jekyll(content:outputPath:permalink:success:failure:) should be invoked in main thread") - } - - renderJekyll(content: content, - to: outputPath, - permalink: permalink, - success: success, - failure: failure) - } -} - -public extension PageFP where Self: PageAPI { - - func markdownIO(content: String, toFile file: URL) -> IO { - IO.async { callback in - let output = URL(fileURLWithPath: "\(file.path).md") - self.markdown(content: content, - to: output.path, - success: { - let fileExist = FileManager.default.fileExists(atPath: output.path) - fileExist ? callback(.right(output)) : callback(.left(.markdown)) - }, - failure: { error in - callback(.left(.markdown)) - }) - }^ - } - - func jekyllIO(content: String, toFile file: URL, permalink: String) -> IO { - IO.async { callback in - let output = URL(fileURLWithPath: "\(file.path).md") - self.jekyll(content: content, - to: output.path, - permalink: permalink, - success: { - let fileExist = FileManager.default.fileExists(atPath: output.path) - fileExist ? callback(.right(output)) : callback(.left(.markdown)) - }, - failure: { error in - callback(.left(.markdown)) - }) - }^ - } -} diff --git a/project/Component/nef/Views/CarbonView.swift b/project/Component/nef/Views/CarbonView.swift index 96726728..65391860 100644 --- a/project/Component/nef/Views/CarbonView.swift +++ b/project/Component/nef/Views/CarbonView.swift @@ -49,8 +49,8 @@ class CarbonWebView: WKWebView, WKNavigationDelegate { private func loadCarbonWebView() { loadingView?.show() - let carbon = Carbon(code: code, style: state) - let request = nef.Render.build.carbonURLRequest(withConfiguration: carbon) + let carbon = CarbonModel(code: code, style: state) + let request = nef.Carbon.request(with: carbon) load(request) } diff --git a/project/Core/Render/Carbon.swift b/project/Core/Render/CoreCarbon.swift similarity index 89% rename from project/Core/Render/Carbon.swift rename to project/Core/Render/CoreCarbon.swift index 2810a581..ead1ae5e 100644 --- a/project/Core/Render/Carbon.swift +++ b/project/Core/Render/CoreCarbon.swift @@ -4,7 +4,7 @@ import Foundation import NefModels public protocol CarbonDownloader: class { - func carbon(withConfiguration configuration: Carbon, filename: String) -> Result + func carbon(withConfiguration configuration: CarbonModel, filename: String) -> Result } public struct CarbonGenerator: InternalRender { @@ -34,7 +34,7 @@ protocol CarbonCodeDownloader { extension CarbonGenerator: CarbonCodeDownloader { func carbon(code: String) -> String { - let configuration = Carbon(code: code, style: style) + let configuration = CarbonModel(code: code, style: style) let result = downloader.carbon(withConfiguration: configuration, filename: output) switch result { @@ -44,7 +44,7 @@ extension CarbonGenerator: CarbonCodeDownloader { case let .failure(carbonError): return """ Downloading Carbon snippet for '\(carbonError.filename)' ☓ - error: \(carbonError.error) + error: \(carbonError.cause) code snippet: \(carbonError.snippet) """ diff --git a/project/Core/Render/Jekyll.swift b/project/Core/Render/CoreJekyll.swift similarity index 100% rename from project/Core/Render/Jekyll.swift rename to project/Core/Render/CoreJekyll.swift diff --git a/project/Core/Render/Markdown.swift b/project/Core/Render/CoreMarkdown.swift similarity index 100% rename from project/Core/Render/Markdown.swift rename to project/Core/Render/CoreMarkdown.swift diff --git a/project/Core/Render/Render.swift b/project/Core/Render/CoreRender.swift similarity index 87% rename from project/Core/Render/Render.swift rename to project/Core/Render/CoreRender.swift index 05b1ebd2..d3352f7d 100644 --- a/project/Core/Render/Render.swift +++ b/project/Core/Render/CoreRender.swift @@ -6,17 +6,17 @@ public protocol CoreRender { func render(content: String) -> String? } -protocol Jekyll { +protocol CoreJekyll { func jekyll(permalink: String) -> String } -protocol Markdown { +protocol CoreMarkdown { func markdown() -> String } // Dependencies -extension Node: Jekyll {} -extension Node: Markdown {} +extension Node: CoreJekyll {} +extension Node: CoreMarkdown {} // MARK: - default Render :: render(content:) protocol InternalRender: CoreRender { diff --git a/project/nef.xcodeproj/project.pbxproj b/project/nef.xcodeproj/project.pbxproj index caad7c46..eddf895e 100644 --- a/project/nef.xcodeproj/project.pbxproj +++ b/project/nef.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ 8B0FB59B237C0B9A00221548 /* Array+Slice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB86622D392C000919F36 /* Array+Slice.swift */; }; 8B0FB59C237C0B9A00221548 /* String+Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85F22D392C000919F36 /* String+Path.swift */; }; 8B0FB59E237C0EF000221548 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB59D237C0EF000221548 /* API.swift */; }; - 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0FB5A1237C1AC700221548 /* PageAPI.swift */; }; 8B0FB5A8237C1DD000221548 /* BowOptics in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A4237C1D3700221548 /* BowOptics */; }; 8B0FB5A9237C1DD000221548 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A5237C1D3700221548 /* BowEffects */; }; 8B0FB5AA237C1DD000221548 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 8B0FB5A6237C1D3700221548 /* Bow */; }; @@ -32,10 +31,10 @@ 8B3CB88122D3932000919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85922D392C000919F36 /* main.swift */; }; 8B3CB88322D3932400919F36 /* ConsoleOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85C22D392C000919F36 /* ConsoleOutput.swift */; }; 8B3CB88422D3932400919F36 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB85D22D392C000919F36 /* main.swift */; }; - 8B3CB8A122D393F100919F36 /* Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89322D393C300919F36 /* Render.swift */; }; - 8B3CB8A222D393F100919F36 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89422D393C300919F36 /* Markdown.swift */; }; + 8B3CB8A122D393F100919F36 /* CoreRender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89322D393C300919F36 /* CoreRender.swift */; }; + 8B3CB8A222D393F100919F36 /* CoreMarkdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89422D393C300919F36 /* CoreMarkdown.swift */; }; 8B3CB8A322D393F100919F36 /* Node+Render.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89522D393C300919F36 /* Node+Render.swift */; }; - 8B3CB8A422D393F100919F36 /* Jekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89622D393C300919F36 /* Jekyll.swift */; }; + 8B3CB8A422D393F100919F36 /* CoreJekyll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89622D393C300919F36 /* CoreJekyll.swift */; }; 8B3CB8A622D393F100919F36 /* String+Format.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89C22D393C300919F36 /* String+Format.swift */; }; 8B3CB8A722D393F100919F36 /* Syntax.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89E22D393C300919F36 /* Syntax.swift */; }; 8B3CB8A822D393F100919F36 /* MarkupNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB89F22D393C300919F36 /* MarkupNode.swift */; }; @@ -55,11 +54,13 @@ 8B3CB8BF22D3963300919F36 /* NefCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84D22D3929B00919F36 /* NefCarbon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B3CB8C022D3963B00919F36 /* CarbonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB84222D3929B00919F36 /* CarbonModel.swift */; }; 8B3CB8C122D3963B00919F36 /* NefModels.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84022D3929B00919F36 /* NefModels.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */; }; - 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* Carbon.swift */; }; + 8B3CB8C222D3964000919F36 /* CarbonAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* CarbonAPI.swift */; }; + 8B3CB8C822D3987500919F36 /* CoreCarbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* CoreCarbon.swift */; }; 8B603EA7237A3CFE0059C9C7 /* nef.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B603E9F237A3CFE0059C9C7 /* nef.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8B6B119D22CB9FDE0060177F /* NefCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6B119422CB9FDE0060177F /* NefCore.framework */; }; 8B75AF9123805A5200388B1C /* CarbonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B75AF9023805A5200388B1C /* CarbonView.swift */; }; + 8B89BA0E238300A80025BC04 /* JekyllAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B89BA0C238300A80025BC04 /* JekyllAPI.swift */; }; + 8B89BA0F238300A80025BC04 /* MarkdownAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B89BA0D238300A80025BC04 /* MarkdownAPI.swift */; }; 8B9954EB23798AB300C81A2A /* NefMarkdown.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B22248522D5EAD600C85856 /* NefMarkdown.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8BCDC72022F0455D00174A19 /* CarbonViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */; }; /* End PBXBuildFile section */ @@ -192,7 +193,6 @@ 8B0FB586237C0A5600221548 /* CLIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CLIKit.h; sourceTree = ""; }; 8B0FB587237C0A5600221548 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B0FB59D237C0EF000221548 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; - 8B0FB5A1237C1AC700221548 /* PageAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageAPI.swift; sourceTree = ""; }; 8B0FB5B7237C61C000221548 /* Error.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; 8B0FB5B9237D5B7A00221548 /* _Carbon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Carbon.h; sourceTree = ""; }; 8B0FB5BB237D5B9400221548 /* _Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _Core.h; sourceTree = ""; }; @@ -204,7 +204,7 @@ 8B22248322D5EAD500C85856 /* NefMarkdown.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefMarkdown.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B22248522D5EAD600C85856 /* NefMarkdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefMarkdown.h; sourceTree = ""; }; 8B22248622D5EAD600C85856 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderAPI.swift; sourceTree = ""; }; + 8B3CB83A22D3929B00919F36 /* CarbonAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonAPI.swift; sourceTree = ""; }; 8B3CB83D22D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB84022D3929B00919F36 /* NefModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefModels.h; sourceTree = ""; }; 8B3CB84122D3929B00919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -232,10 +232,10 @@ 8B3CB86422D392C000919F36 /* NSImage+Store.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Store.swift"; sourceTree = ""; }; 8B3CB86522D392C000919F36 /* PlaygroundUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaygroundUtils.swift; sourceTree = ""; }; 8B3CB86622D392C000919F36 /* Array+Slice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Slice.swift"; sourceTree = ""; }; - 8B3CB89322D393C300919F36 /* Render.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Render.swift; sourceTree = ""; }; - 8B3CB89422D393C300919F36 /* Markdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Markdown.swift; sourceTree = ""; }; + 8B3CB89322D393C300919F36 /* CoreRender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreRender.swift; sourceTree = ""; }; + 8B3CB89422D393C300919F36 /* CoreMarkdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreMarkdown.swift; sourceTree = ""; }; 8B3CB89522D393C300919F36 /* Node+Render.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Node+Render.swift"; sourceTree = ""; }; - 8B3CB89622D393C300919F36 /* Jekyll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Jekyll.swift; sourceTree = ""; }; + 8B3CB89622D393C300919F36 /* CoreJekyll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreJekyll.swift; sourceTree = ""; }; 8B3CB89922D393C300919F36 /* NefCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NefCore.h; sourceTree = ""; }; 8B3CB89A22D393C300919F36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB89C22D393C300919F36 /* String+Format.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Format.swift"; sourceTree = ""; }; @@ -246,7 +246,7 @@ 8B3CB8AE22D394E600919F36 /* JekyllTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JekyllTests.swift; sourceTree = ""; }; 8B3CB8B022D394E600919F36 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8B3CB8B122D394E600919F36 /* MarkdownTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarkdownTests.swift; sourceTree = ""; }; - 8B3CB8C722D3987500919F36 /* Carbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Carbon.swift; sourceTree = ""; }; + 8B3CB8C722D3987500919F36 /* CoreCarbon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreCarbon.swift; sourceTree = ""; }; 8B424B1F224E28FC00AF9010 /* MarkdownPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MarkdownPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4F45A522CF9AF400E6F471 /* NefModels.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NefModels.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8B603E9F237A3CFE0059C9C7 /* nef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nef.h; sourceTree = ""; }; @@ -255,6 +255,8 @@ 8B6B119C22CB9FDE0060177F /* CoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8B6FC585221ECE6A008F7694 /* JekyllPage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JekyllPage; sourceTree = BUILT_PRODUCTS_DIR; }; 8B75AF9023805A5200388B1C /* CarbonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarbonView.swift; sourceTree = ""; }; + 8B89BA0C238300A80025BC04 /* JekyllAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JekyllAPI.swift; sourceTree = ""; }; + 8B89BA0D238300A80025BC04 /* MarkdownAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarkdownAPI.swift; sourceTree = ""; }; 8BC8E94022D3A65D009740E4 /* CoreTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CoreTestPlan.xctestplan; sourceTree = ""; }; 8BCDC71F22F0455D00174A19 /* CarbonViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbonViewer.swift; sourceTree = ""; }; 8BF75F8522CA71E700EC53A1 /* nef.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = nef.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -356,8 +358,9 @@ isa = PBXGroup; children = ( 8B0FB59D237C0EF000221548 /* API.swift */, - 8B3CB83A22D3929B00919F36 /* RenderAPI.swift */, - 8B0FB5A1237C1AC700221548 /* PageAPI.swift */, + 8B89BA0D238300A80025BC04 /* MarkdownAPI.swift */, + 8B89BA0C238300A80025BC04 /* JekyllAPI.swift */, + 8B3CB83A22D3929B00919F36 /* CarbonAPI.swift */, 8B75AF9523805B3400388B1C /* Models */, 8B75AF9223805B1900388B1C /* Views */, 8B3CB83B22D3929B00919F36 /* Support Files */, @@ -492,10 +495,10 @@ 8B3CB89222D393C300919F36 /* Render */ = { isa = PBXGroup; children = ( - 8B3CB8C722D3987500919F36 /* Carbon.swift */, - 8B3CB89622D393C300919F36 /* Jekyll.swift */, - 8B3CB89422D393C300919F36 /* Markdown.swift */, - 8B3CB89322D393C300919F36 /* Render.swift */, + 8B3CB8C722D3987500919F36 /* CoreCarbon.swift */, + 8B3CB89622D393C300919F36 /* CoreJekyll.swift */, + 8B3CB89422D393C300919F36 /* CoreMarkdown.swift */, + 8B3CB89322D393C300919F36 /* CoreRender.swift */, ); path = Render; sourceTree = ""; @@ -1023,12 +1026,12 @@ 8B3CB8A722D393F100919F36 /* Syntax.swift in Sources */, 8B3CB8A922D393F100919F36 /* Lexical.swift in Sources */, 8B3CB8A822D393F100919F36 /* MarkupNode.swift in Sources */, - 8B3CB8A422D393F100919F36 /* Jekyll.swift in Sources */, + 8B3CB8A422D393F100919F36 /* CoreJekyll.swift in Sources */, 8B3CB8A322D393F100919F36 /* Node+Render.swift in Sources */, 8B3CB8A622D393F100919F36 /* String+Format.swift in Sources */, - 8B3CB8A222D393F100919F36 /* Markdown.swift in Sources */, - 8B3CB8A122D393F100919F36 /* Render.swift in Sources */, - 8B3CB8C822D3987500919F36 /* Carbon.swift in Sources */, + 8B3CB8A222D393F100919F36 /* CoreMarkdown.swift in Sources */, + 8B3CB8A122D393F100919F36 /* CoreRender.swift in Sources */, + 8B3CB8C822D3987500919F36 /* CoreCarbon.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1055,10 +1058,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B3CB8C222D3964000919F36 /* RenderAPI.swift in Sources */, + 8B3CB8C222D3964000919F36 /* CarbonAPI.swift in Sources */, + 8B89BA0E238300A80025BC04 /* JekyllAPI.swift in Sources */, + 8B89BA0F238300A80025BC04 /* MarkdownAPI.swift in Sources */, 8B75AF9123805A5200388B1C /* CarbonView.swift in Sources */, 8B0FB59E237C0EF000221548 /* API.swift in Sources */, - 8B0FB5A2237C1AC700221548 /* PageAPI.swift in Sources */, 8B0FB5B8237C61C000221548 /* Error.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0;