diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..2e8708dc
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,14 @@
+# These are supported funding model platforms
+
+github: [sbarex] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+# patreon: # Replace with a single Patreon username
+# open_collective: # Replace with a single Open Collective username
+# ko_fi: # Replace with a single Ko-fi username
+# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+# liberapay: # Replace with a single Liberapay username
+# issuehunt: # Replace with a single IssueHunt username
+# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+# polar: # Replace with a single Polar username
+buy_me_a_coffee: sbarex # Replace with a single Buy Me a Coffee username
+# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.gitignore b/.gitignore
index 01866b6a..d41f9d5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,4 @@ DerivedData/
.idea/
-._DS_STORE
+.DS_Store
diff --git a/Application/AboutViewController.swift b/Application/AboutViewController.swift
index 2d63d9a0..a02b66ac 100644
--- a/Application/AboutViewController.swift
+++ b/Application/AboutViewController.swift
@@ -6,16 +6,31 @@
//
import Cocoa
-import WebKit
+@preconcurrency import WebKit
class AboutViewController: NSViewController, WKNavigationDelegate {
@IBOutlet weak var imageView: NSImageView!
@IBOutlet weak var titleField: NSTextField!
@IBOutlet weak var versionField: NSTextField!
@IBOutlet weak var copyrightField: NSTextField!
- @IBOutlet weak var infoWebView: WKWebView!
+ @IBOutlet weak var hLine: NSBox!
+ var infoWebView: WKWebView!
override func viewDidLoad() {
+ infoWebView = WKWebView(frame: NSRect.zero)
+ infoWebView.navigationDelegate = self
+ infoWebView.translatesAutoresizingMaskIntoConstraints = false
+ self.view.addSubview(infoWebView)
+
+ NSLayoutConstraint.activate([
+ infoWebView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
+ infoWebView.topAnchor.constraint(equalTo: hLine.bottomAnchor),
+ infoWebView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
+ infoWebView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
+
+ infoWebView.heightAnchor.constraint(greaterThanOrEqualToConstant: 200)
+ ])
+
imageView.image = NSApplication.shared.applicationIconImage
if let info = Bundle.main.infoDictionary {
let version = info["CFBundleShortVersionString"] as? String ?? ""
diff --git a/Application/AppDelegate.swift b/Application/AppDelegate.swift
index 86e6055b..49079e27 100644
--- a/Application/AppDelegate.swift
+++ b/Application/AppDelegate.swift
@@ -49,6 +49,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
isAdvancedSettingsVisible = !isAdvancedSettingsVisible
}
+ func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
+ return true
+ }
+
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
return SCSHWrapper.shared.applicationShouldTerminate()
}
@@ -255,11 +259,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
}
}
+ public lazy var CLIURL: URL = {
+ return URL(fileURLWithPath: utsname.isAppleSilicon ? "/opt/sbarex/syntax_highlight_cli" : "/usr/local/bin/syntax_highlight_cli");
+ }()
+
@IBAction func installCLITool(_ sender: Any) {
guard let srcApp = Bundle.main.url(forResource: "syntax_highlight_cli", withExtension: nil) else {
return
}
- let dstApp = URL(fileURLWithPath: "/usr/local/bin/syntax_highlight_cli")
+
+ let dstApp = CLIURL;
let alert1 = NSAlert()
alert1.messageText = "The tool will be installed in \(dstApp.path) \nDo you want to continue?"
@@ -270,6 +279,24 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
guard alert1.runModal() == .alertFirstButtonReturn else {
return
}
+
+ /*if !FileManager.default.fileExists(atPath: dstApp.deletingLastPathComponent().path) {
+ do {
+ var error: NSDictionary?
+ NSAppleScript(source: "do shell script \"sudo mkdir -p \(dstApp.deletingLastPathComponent().path)\" with administrator " + "privileges")!.executeAndReturnError(&error)
+ guard error == nil else {
+ throw MyShellError.runtimeError(error!.description)
+ }
+ } catch {
+ let alert = NSAlert()
+ alert.messageText = "Unable to install the command line tool"
+ alert.informativeText = "(\(error.localizedDescription))\n\nYou can manually install the tool from a Terminal shell with this command: \nln -sfv \"\(srcApp.path)\" \"\(dstApp.path)\""
+ alert.alertStyle = .critical
+ alert.runModal()
+ return
+ }
+ }*/
+
guard access(dstApp.deletingLastPathComponent().path, W_OK) == 0 else {
let alert = NSAlert()
alert.messageText = "Unable to install the tool: \(dstApp.deletingLastPathComponent().path) is not writable"
@@ -282,6 +309,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
let alert = NSAlert()
do {
+ if FileManager.default.fileExists(atPath: dstApp.deletingLastPathComponent().path) {
+ var error: NSDictionary?
+ NSAppleScript(source: "do shell script \"sudo mkdir1 -p \(dstApp.deletingLastPathComponent().path)\" with administrator privileges")!.executeAndReturnError(&error)
+ guard error == nil else {
+ throw MyShellError.runtimeError(error!.description)
+ }
+ }
try FileManager.default.createSymbolicLink(at: dstApp, withDestinationURL: srcApp)
alert.messageText = "Command line tool installed"
alert.informativeText = "You can call it from this path: \(dstApp.path)"
@@ -295,7 +329,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
}
@IBAction func revealCLITool(_ sender: Any) {
- let u = URL(fileURLWithPath: "/usr/local/bin/syntax_highlight_cli")
+ let u = CLIURL
if FileManager.default.fileExists(atPath: u.path) {
// Open the Finder to the settings file.
NSWorkspace.shared.activateFileViewerSelecting([u])
@@ -307,5 +341,28 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
alert.runModal()
}
}
+
+ @IBAction func buyMeACoffee(_ sender: Any?) {
+ let url = URL(string: "https://www.buymeacoffee.com/sbarex")!
+ NSWorkspace.shared.open(url)
+ }
+}
+
+extension utsname {
+ static var sMachine: String {
+ var utsname = utsname()
+ uname(&utsname)
+ return withUnsafePointer(to: &utsname.machine) {
+ $0.withMemoryRebound(to: CChar.self, capacity: Int(_SYS_NAMELEN)) {
+ String(cString: $0)
+ }
+ }
+ }
+ static var isAppleSilicon: Bool {
+ sMachine == "arm64"
+ }
}
+fileprivate enum MyShellError: Error {
+ case runtimeError(String)
+}
diff --git a/Application/CustomTypeViewController.swift b/Application/CustomTypeViewController.swift
index 4ec12270..e5d5fb18 100644
--- a/Application/CustomTypeViewController.swift
+++ b/Application/CustomTypeViewController.swift
@@ -22,6 +22,7 @@
import Cocoa
import Syntax_Highlight_XPC_Service
+import UniformTypeIdentifiers
enum UTISupported {
case unknown
@@ -64,6 +65,10 @@ class DropSensor: NSView {
registerForDraggedTypes(acceptableTypes)
}
+ override func hitTest(_ point: NSPoint) -> NSView? {
+ return nil
+ }
+
override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
self.dropDelegate?.enterDrag(sender)
return .every
@@ -223,12 +228,28 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie
}
let ext = url.pathExtension
- if !ext.isEmpty {
- let tags = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, ext as CFString, nil)
- if let t = tags?.takeRetainedValue() as? [String] {
- for u in t {
- if UTIs.first(where: { $0.UTI.UTI == u }) == nil {
- UTIs.append(UTIStatus(UTI: UTI(u), standard: false))
+
+ if #available(macOS 11.0, *) {
+ if !ext.isEmpty, let type = UTType(filenameExtension: ext) {
+ let identifier = type.identifier
+
+ if UTIs.first(where: { $0.UTI.UTI == identifier }) == nil {
+ UTIs.append(
+ UTIStatus(
+ UTI: UTI(identifier),
+ standard: false
+ )
+ )
+ }
+ }
+ } else {
+ if !ext.isEmpty {
+ let tags = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, ext as CFString, nil)
+ if let t = tags?.takeRetainedValue() as? [String] {
+ for u in t {
+ if UTIs.first(where: { $0.UTI.UTI == u }) == nil {
+ UTIs.append(UTIStatus(UTI: UTI(u), standard: false))
+ }
}
}
}
diff --git a/Application/HighlightWrapper.swift b/Application/HighlightWrapper.swift
index 127329f1..1bd4391c 100644
--- a/Application/HighlightWrapper.swift
+++ b/Application/HighlightWrapper.swift
@@ -8,6 +8,7 @@
import Cocoa
import Syntax_Highlight_XPC_Service
+import UniformTypeIdentifiers
enum HighlightWrapperError: Error {
@@ -272,7 +273,11 @@ class HighlightWrapper {
let openPanel = NSOpenPanel()
openPanel.canCreateDirectories = false
openPanel.showsTagField = false
- openPanel.allowedFileTypes = ["theme"]
+ if #available(macOS 11.0, *) {
+ openPanel.allowedContentTypes = [UTType(filenameExtension: "theme") ?? .data]
+ } else {
+ openPanel.allowedFileTypes = ["theme"]
+ }
openPanel.isExtensionHidden = false
openPanel.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.modalPanelWindow)))
diff --git a/Application/Info.plist b/Application/Info.plist
index 9fc076ee..34862517 100644
--- a/Application/Info.plist
+++ b/Application/Info.plist
@@ -33,7 +33,7 @@
LSMinimumSystemVersion
$(MACOSX_DEPLOYMENT_TARGET)
NSHumanReadableCopyright
- Developed by SBAREX (2019-2024).
+ Developed by SBAREX (2019-2026).
NSMainStoryboardFile
Storyboard
NSPrincipalClass
@@ -88,6 +88,22 @@
+
+ UTTypeConformsTo
+
+ public.xml
+ dyn.ah62d4rv4ge8048drru
+
+ UTTypeIdentifier
+ com.adobe.mxml
+ UTTypeTagSpecification
+
+ com.apple.ostype
+
+ mxml
+
+
+
UTTypeConformsTo
@@ -107,6 +123,23 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge81a65nsq
+ dyn.age81a65nsq
+ public.javascript
+
+ UTTypeIdentifier
+ com.adobe.psjs
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ js
+
+
+
UTTypeConformsTo
@@ -124,6 +157,23 @@
+
+ UTTypeConformsTo
+
+ public.c-plus-plus-source
+ public.source-code
+ dyn.ah62d4rv4ge80g7k
+
+ UTTypeIdentifier
+ com.nvidia.cuda
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ cu
+
+
+
UTTypeConformsTo
@@ -192,6 +242,26 @@
+
+ UTTypeDescription
+ Rexx source file
+ UTTypeConformsTo
+
+ public.item
+ dyn.ah62d4rv4ge81e3p2ta
+ dyn.ah62d4rv4ge81e3p2
+
+ UTTypeIdentifier
+ com.ibm.rexx
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ rexx
+ rex
+
+
+
UTTypeConformsTo
@@ -210,6 +280,24 @@
+
+ UTTypeConformsTo
+
+ public.source-code
+ dyn.ah62d4rv4ge8046my
+ dyn.ah62d4rv4ge8046mz
+
+ UTTypeIdentifier
+ com.metatrader.mq
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ mq4
+ mq5
+
+
+
UTTypeConformsTo
@@ -245,6 +333,40 @@
+
+ UTTypeDescription
+ Visual Studio C# Project
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge80g65usm10y
+ public.xml
+
+ UTTypeIdentifier
+ com.microsoft.csproj
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ csproj
+
+
+
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge80k8xm
+ public.xml
+
+ UTTypeIdentifier
+ com.microsoft.dzi
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ dzi
+
+
+
UTTypeConformsTo
@@ -405,6 +527,8 @@
+ UTTypeDescription
+ Stata source file
UTTypeConformsTo
public.item
@@ -507,6 +631,26 @@
+ UTTypeDescription
+ Unity document
+ UTTypeConformsTo
+
+ public.plain-text
+ dyn.ah62d4rv4ge81n5xmsv6u
+
+ UTTypeIdentifier
+ com.unity.document
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ unity
+
+
+
+
+ UTTypeDescription
+ Astro source files
UTTypeConformsTo
public.item
@@ -522,6 +666,25 @@
+
+ UTTypeDescription
+ Nix Expression Language
+ UTTypeConformsTo
+
+ public.data
+ public.item
+ dyn.ah62d4rv4ge8064p2
+
+ UTTypeIdentifier
+ dev.nix.source
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ nix
+
+
+
UTTypeConformsTo
@@ -578,6 +741,8 @@
+ UTTypeDescription
+ Nextflow files
UTTypeConformsTo
dyn.ah62d4rv4ge8063u
@@ -594,11 +759,14 @@
+ UTTypeDescription
+ Terraform files
UTTypeConformsTo
dyn.ah62d4rv4ge81k3x0qf3hg
dyn.ah62d4rv4ge81k3u
dyn.ah62d4rv4ge80u25q
+ dyn.ah62d4rv4ge81k3xxsvu1k3
public.item
UTTypeIdentifier
@@ -607,6 +775,7 @@
public.filename-extension
+ tfstate
tf
tfvars
hcl
@@ -716,6 +885,25 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge80e2u
+ org.clojure.script
+ public.source-code
+ public.plain-text
+ public.text
+
+ UTTypeIdentifier
+ org.babashka.source
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ bb
+
+
+
UTTypeConformsTo
@@ -735,6 +923,8 @@
+ UTTypeDescription
+ Bazel source file
UTTypeConformsTo
public.item
@@ -844,6 +1034,8 @@
+ UTTypeDescription
+ Crystal source file
UTTypeConformsTo
public.item
@@ -930,6 +1122,24 @@
+
+ UTTypeDescription
+ XML Font Tool file
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge81k7d2
+ public.xml
+
+ UTTypeIdentifier
+ org.fonttools.ttx
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ ttx
+
+
+
UTTypeConformsTo
@@ -1028,6 +1238,54 @@
+
+ UTTypeConformsTo
+
+ public.item
+ dyn.ah62d4rv4ge81g25q
+
+ UTTypeIdentifier
+ org.huygens-fokker.scala
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ scl
+
+
+
+
+ UTTypeConformsTo
+
+ public.xml
+ dyn.ah62d4rv4ge806252
+
+ UTTypeIdentifier
+ org.idpf.ncx
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ ncx
+
+
+
+
+ UTTypeConformsTo
+
+ public.xnl
+ dyn.ah62d4rv4ge8086dg
+
+ UTTypeIdentifier
+ org.idpf.opf
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ opf
+
+
+
UTTypeConformsTo
@@ -1082,6 +1340,22 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge80y65tr24u
+ public.json
+
+ UTTypeIdentifier
+ org.json5.json5
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ json5
+
+
+
UTTypeConformsTo
@@ -1098,6 +1372,24 @@
+
+ UTTypeDescription
+ Jupyter Notebook
+ UTTypeConformsTo
+
+ public.json
+ dyn.ah62d4rv4ge80w6d3r3va
+
+ UTTypeIdentifier
+ org.jupyter.ipynb
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ ipynb
+
+
+
UTTypeConformsTo
@@ -1132,6 +1424,24 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge8007a
+
+ UTTypeDescription
+ Kotlin Source File
+ UTTypeIdentifier
+ org.kotlinlang.kotlin-source
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ kts
+ kt
+
+
+
UTTypeConformsTo
@@ -1170,6 +1480,8 @@
+ UTTypeDescription
+ Lilypond source file
UTTypeConformsTo
public.item
@@ -1182,6 +1494,7 @@
public.filename-extension
ly
+ ily
@@ -1203,6 +1516,24 @@
+
+ UTTypeDescription
+ MAMEdev layout file
+ UTTypeConformsTo
+
+ public.xml
+ dyn.ah62d4rv4ge8022p3
+
+ UTTypeIdentifier
+ org.mamedev.lay
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ lay
+
+
+
UTTypeConformsTo
@@ -1220,6 +1551,22 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge80462
+ public.item
+
+ UTTypeIdentifier
+ org.miniscript.ms
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ ms
+
+
+
UTTypeConformsTo
@@ -1453,6 +1800,11 @@
public.filename-extension
scm
+ ss
+ sls
+ sps
+ sld
+ sch
@@ -1621,6 +1973,25 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge81g25bqu
+ public.c-plus-plus-source
+ public.source-code
+ public.plain-text
+ public.text
+
+ UTTypeIdentifier
+ org.openscad.source
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ scad
+
+
+
UTTypeConformsTo
@@ -1691,6 +2062,22 @@
+
+ UTTypeConformsTo
+
+ public.plain-text
+ dyn.ah62d4rv4ge81e2prru
+
+ UTTypeIdentifier
+ org.raml.raml
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ raml
+
+
+
UTTypeConformsTo
@@ -1927,11 +2314,14 @@
sc
sbt
+ mill
scala
+ UTTypeDescription
+ Smali source file
UTTypeConformsTo
public.item
@@ -1963,6 +2353,25 @@
+
+ UTTypeDescription
+ OpenType feature syntax
+ UTTypeConformsTo
+
+ public.text
+ public.data
+ dyn.ah62d4rv4ge80q3pb
+
+ UTTypeIdentifier
+ org.unifiedfontobject.fea
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ fea
+
+
+
UTTypeConformsTo
@@ -1998,6 +2407,25 @@
+
+ UTTypeConformsTo
+
+ dyn.ah62d4rv4ge81e55cr74g8
+ public.text
+ public.source-code
+
+ UTTypeDescription
+ Robot Framework File
+ UTTypeIdentifier
+ org.robotframework.robot
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ robot
+
+
+
UTTypeConformsTo
@@ -2017,6 +2445,8 @@
UTTypeConformsTo
+ public.xsd
+ public.xml
public.item
dyn.ah62d4rv4ge81u6pzqz3hw
dyn.ah62d4rv4ge81u6k
@@ -2040,6 +2470,8 @@
UTTypeConformsTo
+ public.xsd
+ publix.xml
public.item
dyn.ah62d4rv4ge81u65e
@@ -2514,6 +2946,24 @@
+
+ UTTypeDescription
+ JSON Canvas
+ UTTypeConformsTo
+
+ public.json
+ dyn.ah62d4rv4ge80g2pss3u1g
+
+ UTTypeIdentifier
+ org.jsoncanvas.canvas
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ canvas
+
+
+
UTTypeConformsTo
@@ -2785,6 +3235,23 @@
text/x-gdscript
+
+ UTTypeConformsTo
+
+ public.source-code
+ public.plain-text
+ public.text
+
+ UTTypeIdentifier
+ run.gleam.source
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ gleam
+
+
+
UTTypeDescription
Python Bytecode Document
diff --git a/Application/PlainSettingsView.xib b/Application/PlainSettingsView.xib
index 38cfa3c9..5a0d8b8d 100644
--- a/Application/PlainSettingsView.xib
+++ b/Application/PlainSettingsView.xib
@@ -1,8 +1,8 @@
-
+
-
+
@@ -285,13 +285,13 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Application/PreviewView.swift b/Application/PreviewView.swift
index 7ae7aa9a..5b41d556 100644
--- a/Application/PreviewView.swift
+++ b/Application/PreviewView.swift
@@ -57,12 +57,14 @@ class PreviewView: NSView, SettingsSplitViewElement {
@IBOutlet weak var refreshIndicator: NSProgressIndicator!
@IBOutlet weak var appearanceButton: NSButton!
- @IBOutlet weak var webView: WKWebView!
+ var webView: WKWebViewDrop!
@IBOutlet weak var scrollView: NSScrollView!
@IBOutlet weak var textView: NSTextView!
+ @IBOutlet weak var hLine: NSBox!
+ @IBOutlet weak var previewBox: NSBox!
var isLocked = false
- fileprivate (set) var isRefreshig = false
+ fileprivate(set) var isRefreshig = false
var isLight: Bool = {
@@ -188,6 +190,18 @@ class PreviewView: NSView, SettingsSplitViewElement {
subview.edges == view.edges
}*/
+ webView = WKWebViewDrop(frame: scrollView.bounds, configuration: WKWebViewConfiguration())
+ webView.translatesAutoresizingMaskIntoConstraints = false
+
+ previewBox.addSubview(webView)
+
+ NSLayoutConstraint.activate([
+ webView.leadingAnchor.constraint(equalTo: previewBox.leadingAnchor),
+ webView.topAnchor.constraint(equalTo: previewBox.topAnchor),
+ webView.trailingAnchor.constraint(equalTo: previewBox.trailingAnchor),
+ webView.bottomAnchor.constraint(equalTo: previewBox.bottomAnchor)
+ ])
+
// Populate the example files list.
examples = (NSApplication.shared.delegate as? AppDelegate)?.getAvailableExamples() ?? []
diff --git a/Application/PreviewView.xib b/Application/PreviewView.xib
index 1c72cae4..b6306ad4 100644
--- a/Application/PreviewView.xib
+++ b/Application/PreviewView.xib
@@ -1,9 +1,8 @@
-
+
-
-
+
@@ -12,10 +11,11 @@
+
+
-
@@ -30,39 +30,47 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -90,14 +98,14 @@
NSHumanReadableCopyright
- Developed by SBAREX (2019-2024).
+ Developed by SBAREX (2019-2026).
diff --git a/QLExtension/PreviewViewController.swift b/QLExtension/PreviewViewController.swift
index c386d4bb..b524c9b8 100644
--- a/QLExtension/PreviewViewController.swift
+++ b/QLExtension/PreviewViewController.swift
@@ -79,6 +79,16 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat
var textScrollView: NSScrollView?
var textView: NSTextView?
var webView: WKWebView?
+ var appearanceObserver: NSKeyValueObservation?
+
+ /// Check if the appearance is Dark
+ lazy var isDarkMode: Bool = {
+ // fixme: nell'estensione non sempre restituisce il valore aggiornato!
+ if let appearance = self.view.effectiveAppearance.bestMatch(from: [.darkAqua, .aqua]) {
+ return appearance == .darkAqua
+ }
+ return false
+ }()
lazy var connection: NSXPCConnection = {
let connection = NSXPCConnection(serviceName: "org.sbarex.SourceCodeSyntaxHighlight.XPCRender")
@@ -105,12 +115,20 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat
view.layer?.borderWidth = 0
}
+ self.appearanceObserver = NSApp.observe(\.effectiveAppearance, options: [.new, .old, .initial, .prior]) { app, change in
+ self.isDarkMode = change.newValue?.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
+ }
+
+ self.textView?.linkTextAttributes = [:]
+
DistributedNotificationCenter.default().addObserver(self, selector: #selector(self.handleSettingsChanged(_:)), name: .SettingsUpdated, object: nil)
}
deinit {
self.connection.invalidate()
DistributedNotificationCenter.default().removeObserver(self, name: .SettingsUpdated, object: nil)
+ self.appearanceObserver?.invalidate()
+ self.appearanceObserver = nil
}
/// Reload settings after they have been changed in the main app.
@@ -138,7 +156,7 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat
var handler: ((Error?) -> Void)? = nil
func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) {
- // This code will not be called on macOS 12 Monterey with QLIsDataBasedPreview set.
+ // This code will *not* be called on macOS 12 Monterey with QLIsDataBasedPreview set.
// Add the supported content types to the QLSupportedContentTypes array in the Info.plist of the extension.
diff --git a/QLExtension/QLExtension.entitlements b/QLExtension/QLExtension.entitlements
index 866ec39d..1e81cf4b 100644
--- a/QLExtension/QLExtension.entitlements
+++ b/QLExtension/QLExtension.entitlements
@@ -2,12 +2,16 @@
- com.apple.security.get-task-allow
-
com.apple.security.app-sandbox
+ com.apple.security.application-groups
+
+ group.org.sbarex.syntaxhighlight
+
com.apple.security.files.user-selected.read-only
+ com.apple.security.get-task-allow
+
com.apple.security.network.client
com.apple.security.temporary-exception.mach-lookup.global-name
diff --git a/README.md b/README.md
index cf3d67e9..b8f318e7 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,24 @@
[](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) [](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases)
+[](https://www.buymeacoffee.com/sbarex)
+
+
# Syntax Highlight
-The application offers a Quick Look Extension for macOS 10.15 Catalina and later for previewing source files.
-Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) to render source code with syntax highlighting.
+The application offers a Quick Look Extension for macOS 12.0 and later for previewing source files.
+Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) to render source code with syntax highlighting. (For macOS 11 and 10.15, the latest compatible version is 2.1.30).
> **`Syntax Highlight` is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY.**
+If you like this application and find it useful, [buy me a coffee](https://www.buymeacoffee.com/sbarex)!
+
- [Installation](#installation)
- [Download precompiled release](#download-precompiled-release)
- - [Install with Homebrew Cask](#install-with-homebrew-cask)
+ - [Install with Homebrew](#install-with-homebrew)
- [Note for the precompiled release](#note-for-the-precompiled-release)
- [Build from source](#build-from-source)
- [Enable the Quick Look extension](#enable-the-quick-look-extension)
@@ -32,6 +37,7 @@ Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight
- [Known bugs](#known-bugs)
- [Note for developers](#note-for-developers)
- [Info about decoding dynamic UTI identifiers](#info-about-decoding-dynamic-uti-identifiers)
+ - [Other useful links](#other-useful-links)
- [Credits](#credits)
@@ -44,27 +50,16 @@ After installation, _the application must be launched at least once to allow the
### Download precompiled release
Head over to the [releases](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) page to view the latest version. Move `Syntax Highlight.app` into the `Applications` folder.
-### Install with Homebrew Cask
-Syntax Highlight can also be installed via [Homebrew Cask](https://github.com/Homebrew/homebrew-cask). If you have not installed Homebrew, follow the simple instructions [here](https://brew.sh/). After that, install the current version of Syntax Highlight with the following command:
+### Install with Homebrew
+Syntax Highlight can also be installed via [Homebrew](https://brew.sh). If you have not installed Homebrew, follow the simple instructions [here](https://brew.sh/). After that, install the current version of Syntax Highlight with the following command:
```bash
-brew install --cask --no-quarantine syntax-highlight
+brew install syntax-highlight
```
### Note for the precompiled release
-The [precompiled app](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) is not notarized or signed, so the first time you run the app the system may show a warning about the impossibility to check for malicious software.
-
-To fix, you can launch the app with right-click (or Control-click) on the app icon and choose the open action.
-
-You can also execute this command from the terminal:
-
-```bash
-xattr -r -d com.apple.quarantine "FULL PATH OF Syntax Highlight.app (you can drag the file to get the pull path)"
-```
-
-Alternatively, after trying to launch the app for the first time, you can open the `System Preferences > Security & Privacy > General (tab)` and click the `Open Anyway` button.
+The [precompiled app](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) is codesigned and notarized.
-This will resolve the error of an unsigned application when launching the app.
### Build from source
@@ -85,19 +80,6 @@ _To use the Quick Look preview you must launch the Application at least once._ I

-When opening the app _for the first time_, you may see a pop-up warning about unable to check malicious software.
-
-To fix follow these steps:
-
-- Switch to Finder and navigate to the application.
-- Right-click (or Control-click) `Syntax Highlight.app` and choose the `Open` item from the contextual menu.
-- A modal popup appears stating:
- > "Syntax Highlight.app" can’t be opened because Apple cannot check it for malicious software.
-- Click `Open` to confirm.
-
-This warning is because the app is neither codesigned nor notarized.
-
-For more info see the [note for the precompiled release](#note-for-the-precompiled-release).
## File format management
@@ -120,16 +102,20 @@ The application can also handle some [plain files](#plain-files) **without exten
- Ada (`.ada`)
- Adobe Acrobat Sequence files (`.sequ`) _as `XML`_
- Adobe Flash ActionScript source files (`.as`)
+- Adobe Flex files (`.mxml`) files _as `XML`_
- Adobe JSX script files (`.jsx`)
+- Adobe UPX Javascript (`.psjs`)
+- Apple loctable (`.loctable`) _as `plist (XML)`_
- Apple workflow (`.wflow`) _as `plist (XML)`_
- AppleScript (`.scpt`, `.applescript`, `.ascr`) _automatically decompiled with `osadecompile`_
- Apple shell script files (`.command`)
- Assembler source files (`.asm`, `.s79`)
-- Astro files (`.astro`) _as JSX_.
+- Astro files (`.astro`) _as `JSX`_.
- Autolit files (`.au3`, `.a3x`)
- Azkaban flow files (`.flow`) as _`YAML`_
- ATL files (`.atl`)
- (G)AWK files (`.awk`)
+- Babashka (`.bb`) files _as `Clojure`_.
- Bash Script files (`.bash`)
- Bezel (`.bezel`) as _plain text_
- BibTex (`.bib`)
@@ -147,8 +133,10 @@ The application can also handle some [plain files](#plain-files) **without exten
- Crystal language (`.cr`)
- CSON source files (`.cson`)
- CSS files (`.css`)
+- Cuda files (`.cu`) _as `C++`_
- D (`.d`)
- Dart source files (`.dart`) **`.dart` is reserved by macOS and cannot be handled.**
+- Designspace files (`.designspace`) _as `XML`_
- Diff files (`.diff`, `.patch`)
- Dockerfile (`.dockerfile`)
- Document Type Definition (`.dtd`)
@@ -157,14 +145,21 @@ The application can also handle some [plain files](#plain-files) **without exten
- ECore files (`.ecore`)
- Eiffel project files (`.ecf`) _as `XML`_
- Eiffel source files (`.e`, `.ex`, `.exs`)
+- Elixir files (`.ex`, `.exs`, `.heex`)
+- Enviroment files (`.env`) _as `INI`_
+- ePub [Navigation Center eXtended](https://idpf.org/epub/20/spec/OPF_2.0_latest.htm#Section2.4.1) (`.ncx`) _as XML_.
+- ePub [Open Packaging Format](https://idpf.org/epub/20/spec/OPF_2.0_latest.htm) (`.opf`) files _as XML_.
- Erlang source files (`.erl`, `.hri`)
- F# source files (`.fsx`, `.fs`)
- fish source files (`.fish`)
+- FonTool files (`.ttx`) _as `XML`_.
- Fortran source files (`.f`, `.for`, `.f90`, `.f95`)
- GCC linked files (`.ld`, `.map`, `.d`)
- Gdscript (Godot engine) (`.gd`).
+- Gleam (`.gleam`)
- Golang source files (`.go`)
- Google Earth KML Document files (`.kml`) _as `XML`_
+- GPS eXchange Format) (`.gpx`) _as `XML`_
- Gradle source files (`.gradle`)
- Graphics Language Transmission Format (`.gltf`) _as `JSON`_
- Groovy source files (`.groovy`)
@@ -185,30 +180,40 @@ The application can also handle some [plain files](#plain-files) **without exten
- Java Web Start (`.jnlp`)
- JavaFX ML (`.fxml`)
- JavaScript files (`.js`, `.jscript`, `.javascript`, `.mjs`, `.jsm`)
-- JSON files (`.json`, `.jsonc`) ** On macOS 13 Ventura with Apple Silicon the `.json` extension is reserved by the system and cannot be handled.**
+- JSON files (`.json`, `.jsonc`, `.json5`) ** On macOS 13 Ventura with Apple Silicon the `.json` extension is reserved by the system and cannot be handled.**
+- JSON Canvas (`.canvas`) _as `JSON`_
- JSON Line files (`.jsonl`) _as `JSON`_
- Julia source files (`.jl`)
+- Jupyter Notebook files (`.ipynb`) _as `JSON`_
- Kermeta source files (`.kmt`)
- Korn Shell script files (`.ksh`)
- Kotlin source files (`.kt`, `.kts`)
- LESS stylesheet (`.less`)
-- Lilypond files (`.ly`)x1
+- Lilypond files (`.ly`, `.ily`)
- Lisp source files (`.lisp`, `.lsp`, `.asd`, `.el`)
- Logos source files (`.xm`)
- Lua source files (`.lua`)
- Makefile files (`.mk`, `.mak`)
+- MAMEdev layout files (`.lay`) _as `XML`_.
- Markdown files (`.md`, `.rmd`): _please use [QLMarkdown](https://github.com/sbarex/QLMarkdown)_ which allows you to choose whether to display formatted output or the highlighted source code.
-- Media Presentation Description (`.mpd`) _as XML_.
+- Media Presentation Description (`.mpd`) _as `XML`_.
+- MetaTrader (`.mq4`, `.mq5`) files _as CPP_.
- MF source files (`.mf`)
- Microsoft Active Server Page files (`.asp`, `.aspx`)
- Microsoft PowerShell files (`.psm1`, `.psd1`, `.ps1`)
-- NextFlow (`.nf`) _as Groovy (Java)_
+- Microsoft Visual Studio C# Project (`.csproj`) _as `XML`_
+- [MiniScript](https://miniscript.org/) files (`.ms`)
+- NextFlow (`.nf`) _as `Groovy (Java)`_
- Nim source files (`.nim`)
+- Nix Expression Language (`.nix`)
- Node CommonJS module (`.cjs`)
- Objective-C source files (`.m`)
- Objective-C++ source files (`.mm`)
- OCaml source files (`.ml`, `.mll`, `.mly`)
+- OpenSCAD files (`.scad`) _as `CPP`_.
- OpenSSH RSA public key (`.pub`) _as plain text_
+- OpenTimelineIO files (`.otio`) _as JSON_
+- OpenType feature file specification (`.fea`)
- OPML (Outline Processor Markup Language) files (`.opml`) _as `XML`_
- Oracle PL/SQL files (`.fnc`, `.prc`, `.trg`, `.pks`, `.pkb`, `.pck`, `.tps`, `.tpb`, `.typ`, `.tab`, `.avt`, `.con`, `.sqs`, `.vw`, `.mvw`, `.trg`) _as `SQL`_
- Paradox files (`.sc`)
@@ -218,15 +223,19 @@ The application can also handle some [plain files](#plain-files) **without exten
- Perl script files (`.pl`, `.pm`, `.t`)
- Planning Domain Description Language (`.pddl`) _as `Lisp`_
- PHP source files (`.php`, `.php3`, `.php4`, `.ph3`, `.ph4`, `.phtml`)
+- Project Object Model files (`.pom`) _as XML_
- Properties files (`.properties`) _as `INI`_
- Property List files (`.plist`) _dynamically decompiled with `plutil`_ **On macOS 10.15 Catalina `.plist` is reserved by the system and cannot be handled.**
-- Python source files (`.py`)
+- Python source files (`.py`, `.py3`, `.pyi`)
- R (`.r`)
- Racket (`.rkt`) _as `Lisp`_
+- RAML (`.raml`) _as `YAML`_
+- Rexx (`.rex`, `.rexx`)
- RDF files (`.rdf`)
- README files (`.readme`) _as plain text_
- reStructuredText document (`.rst`)
- Rez files (`.r`)
+- Robot framework (`.robot`) _as `python`_.
- Ruby on Rails files (`.rhtml`, `.erb`, `.rjs`)
- Ruby Gems file (`.gemfile`)
- Ruby script (`.rb`, `.rbw`)
@@ -234,8 +243,9 @@ The application can also handle some [plain files](#plain-files) **without exten
- SageMath files (`.sage`) _as `Python`_
- SAS files (`.sas`)
- SASS/SCSS files (`.scss`)
-- Scala source files (`.sc`, `.sbt`, `.scala`)
-- Scheme source files (`.scm`)
+- Scala source files (`.sc`, `.sbt`, `.scala`, `.mill`)
+- [Scala scale file format](https://huygens-fokker.org/scala/scl_format.html) (`.scl`) _as plain text_
+- Scheme source files (`.scm`, `.ss`, `.sls`, `.sps`, `.sld`, `.sch`) _as `Lisp`_
- Shell script files (`.bashrc`, `.zshrc`, `.sh`)
- Smali (`.smali`) _as plain text_.
- Solidity source files (`.sol`)
@@ -243,31 +253,36 @@ The application can also handle some [plain files](#plain-files) **without exten
- Standard ML source files (`.ml`)
- Stata files (`.do`, `.ado`) _as plain text_
- Steam app manifest files (`.acf`) _as plain text_.
-- Svelte (`.svelte`) _as `HTML`_
+- Svelte (`.svelte`)
- Swift source files (`.swift`)
- Symfony Twig files (`.twig`)
- TCL source files (`.tcl`)
- Tenex C Shell script files (`.tcsh`)
-- Terraform files (`.tfvars`, `.tf`, `.hcl`) _as `YAML`_
+- Terraform files (`.tfvars`, `.tfstate`, `.tf`, `.hcl`) _as `YAML`_
- TeX and LaTeX files (`.tex`, `.sty`, `.cls`, `.latex`, `.ltx`, `.texi`, `.ctx`, `.sty`)
- Text files (`.txt`, `.text`)
- TOML files (`.toml`)
- TypeScript files (`.ts`, `.tsx`, `.cts`, `.mts`) **`.ts` and `.mts` are reserved by macOS and cannot be handled.**
-- Visual Studio Code Workspace (`.code-workspace`) _ as `JSON`_
+- Unity document (`.unity`) _as `YAML`_
+- Visual Studio Code Workspace (`.code-workspace`) _as `JSON`_
- Verilog HDL files (`.v`, `.vl`)
- VHDL source files (`.vhd`, `.vhdl`)
- VIM script files (`.vim`)
- Visual Basic source files (`.vb`, `.bas`, `.basic`, `.vbs`)
- Vue source files (`.vue`)
-- XAML source files (`.xaml`) _as XML_
-- Xcode entitlement files (`.entitlements`) (dynamically decompiled with `plutil`) _as XML_
-- Xcode localizable strings files (`.strings`, `.stringsdict`) (dynamically decompiled with `plutil`) _as XML_
+- XAML source files (`.xaml`) _as `XML`_
+- Xcode entitlement files (`.entitlements`) (dynamically decompiled with `plutil`) _as `XML`_
+- Xcode localizable strings files (`.strings`, `.stringsdict`) (dynamically decompiled with `plutil`) _as `XML`_
+_ Xcode scheme _as `XML`_
- XHTML files (`.xhtml`)
- XML files (`.xml`) **Before macOS 12 Monterey `.xml` is reserved by the system and cannot be handled.**
- XSD Schema files (`.xsd`, `.xquery`, `.xq`, `.xu`)
- XUL files (`.xul`)
- YAML files (`.yaml`)
- Z shell script files (`.zsh`)
+- Zig source files (`.zig`)
+- Zig Object Notation files (`.zon`) _as JSON_.
+
## Application settings
@@ -299,6 +314,7 @@ You can set the settings for all supported formats on the _General_ tab.
|Convert line ending| Allow to convert Windows (`CRLF`) and Mac Classic (`CR`) line ending to the Unix style (`LN`). This option is ignored when a _preprocessor_ is set or when a _Language Server_ is enabled. The line ending conversion is made my [`dos2unix`](https://waterlan.home.xs4all.nl/dos2unix.html). |Yes|
|VCS Support| If enabled, allow to highlight lines added/edited/removed from last commit. It can handle VCS based on `git` and `mercurial`. |Yes|
|Custom Quick Look size|Allow you to choose a custom size for the content area of the Quick Look window. _Use with caution on macOS before version 12 Monterey_.||
+|Show about info | If enabled, shows information about this application at the bottom of the preview page.|Yes|
|Debug | If enabled, a `colorize.log` and `colorize.rtf\|html` file will be created on your Desktop folder with the log of last rendering.|Yes|
You can also override the global options for some formats on the _Formats_ tab.
@@ -423,7 +439,7 @@ The tool is located inside the `Syntax Highlight.app/Contents/Resources` folder
From the Application menu you can create a symbolic link into `/usr/local/bin` folder.
```bash
-/Application/Syntax\ Highlight.app/Contents/Resources/syntax_highlight_cli -h
+/Applications/Syntax\ Highlight.app/Contents/Resources/syntax_highlight_cli -h
```
```
Usage: syntax_highlight_cli [-o ] [..]
@@ -483,8 +499,6 @@ The CLI interface uses the same settings as the Quick Look extension, but you ca
The highlighted data is printed to the `stdout` or writed to file if you use the `-o` option.
-The command line tool require macOS 10.15.4 or later.
-
## Add support to a custom format
@@ -572,7 +586,7 @@ The application embed the [`Highlight`](http://www.andre-simon.de/doku/highlight

-### Info about decoding dynamic UTI identifiers:
+### Info about decoding dynamic UTI identifiers
- https://gist.github.com/jtbandes/19646e7457208ae9b1ad
- https://alastairs-place.net/blog/2012/06/06/utis-are-better-than-you-think-and-heres-why/
@@ -644,6 +658,19 @@ pluginkit -mAvvv -p com.apple.quicklook.preview
pluginkit -m -v -i org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension --raw
```
+### Other useful links
+
+https://eclecticlight.co/2024/11/04/how-does-quicklook-create-thumbnails-and-previews-with-an-update-to-mints/
+
+https://eclecticlight.co/2024/11/02/a-brief-history-of-icons-thumbnails-and-quicklook/
+
+https://eclecticlight.co/2024/10/31/how-sequoia-has-changed-quicklook-and-its-thumbnails/
+
+https://mjtsai.com/blog/2024/11/05/sequoia-no-longer-supports-quicklook-generator-plug-ins/
+
+https://eclecticlight.co/2025/10/25/explainer-how-does-macos-recognise-file-types/
+
+
## Credits
Developed by [sbarex](https://github.com/sbarex) with :heart:.
@@ -652,3 +679,5 @@ Highlight is developed by [Andre Simon](http://www.andre-simon.de/).
Dos2unix is developed by [Erwin Waterlander](https://waterlan.home.xs4all.nl/dos2unix.html).
This application was inspired by [anthonygelibert/QLColorCode](https://github.com/anthonygelibert/QLColorCode) and [NSGod/qlstephen](https://github.com/NSGod/qlstephen).
+
+If you find this application useful, [buy me a coffee](https://www.buymeacoffee.com/sbarex).
diff --git a/Resources/qlsource.icon/Assets/ql_eye.svg b/Resources/qlsource.icon/Assets/ql_eye.svg
new file mode 100644
index 00000000..ddb13ad2
--- /dev/null
+++ b/Resources/qlsource.icon/Assets/ql_eye.svg
@@ -0,0 +1,16 @@
+
+
diff --git a/Resources/qlsource.icon/Assets/source_code.svg b/Resources/qlsource.icon/Assets/source_code.svg
new file mode 100644
index 00000000..5bd5477f
--- /dev/null
+++ b/Resources/qlsource.icon/Assets/source_code.svg
@@ -0,0 +1,21 @@
+
+
diff --git a/Resources/qlsource.icon/icon.json b/Resources/qlsource.icon/icon.json
new file mode 100644
index 00000000..fe392831
--- /dev/null
+++ b/Resources/qlsource.icon/icon.json
@@ -0,0 +1,66 @@
+{
+ "fill" : "automatic",
+ "groups" : [
+ {
+ "layers" : [
+ {
+ "fill" : "automatic",
+ "image-name" : "source_code.svg",
+ "name" : "source_code",
+ "position-specializations" : [
+ {
+ "idiom" : "square",
+ "value" : {
+ "scale" : 1.25,
+ "translation-in-points" : [
+ 0,
+ 0
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "blend-mode" : "normal",
+ "fill" : {
+ "automatic-gradient" : "extended-srgb:1.00000,0.23137,0.18824,1.00000"
+ },
+ "glass" : true,
+ "hidden-specializations" : [
+ {
+ "idiom" : "macOS",
+ "value" : false
+ }
+ ],
+ "image-name" : "ql_eye.svg",
+ "name" : "ql_eye",
+ "position-specializations" : [
+ {
+ "idiom" : "square",
+ "value" : {
+ "scale" : 1.25,
+ "translation-in-points" : [
+ 0,
+ 0
+ ]
+ }
+ }
+ ]
+ }
+ ],
+ "shadow" : {
+ "kind" : "neutral",
+ "opacity" : 0.5
+ },
+ "translucency" : {
+ "enabled" : true,
+ "value" : 0.5
+ }
+ }
+ ],
+ "supported-platforms" : {
+ "squares" : [
+ "macOS"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ShortcutCommand/Info.plist b/ShortcutCommand/Info.plist
new file mode 100644
index 00000000..8d15acbe
--- /dev/null
+++ b/ShortcutCommand/Info.plist
@@ -0,0 +1,11 @@
+
+
+
+
+ EXAppExtensionAttributes
+
+ EXExtensionPointIdentifier
+ com.apple.appintents-extension
+
+
+
diff --git a/ShortcutCommand/Localizable.xcstrings b/ShortcutCommand/Localizable.xcstrings
new file mode 100644
index 00000000..ae10432a
--- /dev/null
+++ b/ShortcutCommand/Localizable.xcstrings
@@ -0,0 +1,136 @@
+{
+ "sourceLanguage" : "en",
+ "strings" : {
+ "Engine" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Motore di formattazione"
+ }
+ }
+ }
+ },
+ "Generate debug log" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Genera file di log"
+ }
+ }
+ }
+ },
+ "Highlight source code of ${inputFile} to a ${engine} file." : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Formatta il codice sorgente di${inputFile} in un file ${engine}."
+ }
+ }
+ }
+ },
+ "HTML" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "HTML"
+ }
+ }
+ }
+ },
+ "Input File" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "File"
+ }
+ }
+ }
+ },
+ "Option engine" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Opzione del motore di formattazione"
+ }
+ }
+ }
+ },
+ "predefined" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "predefinito"
+ }
+ }
+ }
+ },
+ "RTF" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "RTF"
+ }
+ }
+ }
+ },
+ "Save log to ~/Desktop/colorize.log" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Salva un file di log in ~/Scrivania/colorize.log"
+ }
+ }
+ }
+ },
+ "Syntax Highlight source file" : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Evidenzia la sintassi del codice sorgente"
+ }
+ }
+ }
+ },
+ "Syntax Highlights the source code of a file." : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Evidenzia la sintassi del codice sorgente di un file"
+ }
+ }
+ }
+ },
+ "The rendering engine." : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Motore di formattazione."
+ }
+ }
+ }
+ },
+ "The source file to hightlights." : {
+ "localizations" : {
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "File sorgente da formattare."
+ }
+ }
+ }
+ }
+ },
+ "version" : "1.0"
+}
\ No newline at end of file
diff --git a/ShortcutCommand/ShortcutCommand.entitlements b/ShortcutCommand/ShortcutCommand.entitlements
new file mode 100644
index 00000000..5f06052b
--- /dev/null
+++ b/ShortcutCommand/ShortcutCommand.entitlements
@@ -0,0 +1,40 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.application-groups
+
+ group.org.sbarex.syntaxhighlight
+
+ com.apple.security.assets.movies.read-only
+
+ com.apple.security.assets.music.read-only
+
+ com.apple.security.assets.pictures.read-only
+
+ com.apple.security.files.downloads.read-only
+
+ com.apple.security.files.user-selected.read-only
+
+ com.apple.security.network.client
+
+ com.apple.security.temporary-exception.files.absolute-path.read-only
+
+ /
+
+ com.apple.security.temporary-exception.files.home-relative-path.read-write
+
+ /Desktop
+ /Desktop/colorize.html
+ /Desktop/colorize.log
+ /Desktop/colorize.rtf
+ /Library/Application Support/Syntax Highlight/Themes/
+
+ com.apple.security.temporary-exception.shared-preference.read-only
+
+ org.sbarex.SourceCodeSyntaxHighlight
+
+
+
diff --git a/ShortcutCommand/ShortcutCommand.swift b/ShortcutCommand/ShortcutCommand.swift
new file mode 100644
index 00000000..1b7e4c07
--- /dev/null
+++ b/ShortcutCommand/ShortcutCommand.swift
@@ -0,0 +1,125 @@
+//
+// ShortcutCommand.swift
+// ShortcutCommand
+//
+// Created by Sbarex on 25/12/24.
+// Copyright © 2024 sbarex. All rights reserved.
+//
+
+import AppIntents
+import AppKit
+import OSLog
+import UniformTypeIdentifiers
+
+enum ShortcutCommandError: Error {
+ case invalidConfiguration
+}
+
+enum OptionalEngineEnum: String, AppEnum {
+ static var typeDisplayRepresentation: TypeDisplayRepresentation = TypeDisplayRepresentation(name: "Option engine")
+
+ case predefined
+ case html
+ case rtf
+
+ static let caseDisplayRepresentations: [Self: DisplayRepresentation] = [
+ .predefined: "predefined",
+ .html: "HTML",
+ .rtf: "RTF",
+ ]
+}
+
+struct ShortcutCommand: AppIntent {
+ static var title: LocalizedStringResource { "Syntax Highlight source file" }
+ static var description: LocalizedStringResource { "Syntax Highlights the source code of a file." }
+ static var openAppWhenRun: Bool = false
+
+ static var parameterSummary: some ParameterSummary {
+ Summary("Highlight source code of \(\.$inputFile) to a \(\.$engine) file.") {
+ \.$debugLog
+ }
+ }
+
+ // Define the input parameter
+ @Parameter(title: "Input File",
+ description: "The source file to hightlights.",
+ supportedContentTypes: [UTType.sourceCode, UTType.text, UTType.data, UTType.item])
+ var inputFile: IntentFile
+ @Parameter(title: "Engine",
+ description: "The rendering engine.", default: .predefined)
+ var engine: OptionalEngineEnum
+
+ @Parameter(title: "Generate debug log",
+ description: "Save log to ~/Desktop/colorize.log", default: false)
+ var debugLog: Bool
+
+ func perform() async throws -> some ReturnsValue {
+ let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "shortcut extension")
+
+ os_log(
+ "Generating preview for file %{public}s…",
+ log: log,
+ type: .info,
+ inputFile.fileURL?.absoluteString ?? "?"
+ )
+
+ let _ = inputFile.data
+
+ let settings = Settings(defaultsDomain: SCSHBaseXPCService.XPCDomain)
+ if self.engine != .predefined {
+ settings.format = self.engine == .html ? .html : .rtf
+ }
+ if let dir = SCSHBaseXPCService.getCustomStylesUrl(createIfMissing: false) {
+ settings.populateCSS(cssFolder: dir)
+ }
+
+ let logFile = debugLog ? SCSHBaseXPCService.initLog(forSettings: settings) : URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("colorize.log")
+ if !debugLog {
+ // Reset the log file.
+ try? "".write(to: logFile, atomically: true, encoding: .utf8)
+ }
+ defer {
+ if !debugLog {
+ try? FileManager.default.removeItem(at: logFile)
+ }
+ }
+
+ os_log(
+ "Storing log on file %{public}s…",
+ log: log,
+ type: .debug,
+ logFile.path(percentEncoded: false)
+ )
+
+ let appBundleUrl = Bundle.main.bundleURL.appendingPathComponent("Contents/Resources")
+
+ // TODO: Sandbox prevent to access the bundle of the main app, so is required to have a second copy of all highlight resources inside this extension bundle.
+ guard
+ let highlightBin = Bundle.main.url(forResource: "highlight", withExtension: "", subdirectory: "highlight/bin"),
+ let highlightDataDir = Bundle.main.url(forResource: "share", withExtension: "", subdirectory: "highlight"),
+ let dos2unix = Bundle.main.url(forResource: "dos2unix", withExtension: "")?.path,
+ let languages = Bundle.main.url(forResource: "languages", withExtension: "json"),
+ let extraCSS = Bundle.main.url(forResource: "style", withExtension: "css", subdirectory: "highlight")
+ else {
+ throw ShortcutCommandError.invalidConfiguration
+ }
+
+ let highlightLanguages: [String: [String]] = (try? SCSHBaseXPCService.parseHighlightLanguages(file: languages)) ?? [:]
+
+ do {
+ let r: (data: Data, settings: SettingsRendering) = try SCSHBaseXPCService.colorize(url: inputFile.fileURL!, settings: settings, highlightBin: highlightBin.path, dataDir: highlightDataDir.path, rsrcEsc: appBundleUrl.path, dos2unixBin: dos2unix, highlightLanguages: highlightLanguages, extraCss: extraCSS, overridingSettings: [:], logFile: logFile, logOs: log)
+ let dst = inputFile.fileURL!.deletingPathExtension().lastPathComponent + (settings.format == .html ? ".html" : ".rtf")
+ return .result(value: IntentFile(data: r.data, filename: dst, type: settings.format == .html ? UTType.html : UTType.rtf))
+ } catch {
+ os_log(
+ "Error processing %{public}s: %{public}s!",
+ log: log,
+ type: .error,
+ inputFile.fileURL!.path,
+ error.localizedDescription
+ )
+ throw error
+ }
+ }
+}
+
diff --git a/ShortcutCommand/ShortcutCommandExtension.swift b/ShortcutCommand/ShortcutCommandExtension.swift
new file mode 100644
index 00000000..58ee513e
--- /dev/null
+++ b/ShortcutCommand/ShortcutCommandExtension.swift
@@ -0,0 +1,13 @@
+//
+// ShortcutCommandExtension.swift
+// ShortcutCommand
+//
+// Created by Sbarex on 25/12/24.
+// Copyright © 2024 sbarex. All rights reserved.
+//
+
+import AppIntents
+
+@main
+struct ShortcutCommandExtension: AppIntentsExtension {
+}
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj b/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj
index 35022af3..24dc8810 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj
+++ b/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 54;
+ objectVersion = 70;
objects = {
/* Begin PBXBuildFile section */
@@ -14,11 +14,11 @@
8304B0B8238FA897007A455C /* TaskResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0B6238FA897007A455C /* TaskResult.swift */; };
8304B0B9238FA920007A455C /* SCSHError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8359239C23570C52001506B6 /* SCSHError.swift */; };
8304B0BD238FBCC4007A455C /* SCSHBaseXPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */; };
- 830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; };
830D15542378182800D5535C /* SCSHTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923EB235A3A85001506B6 /* SCSHTheme.swift */; };
830D15552378419F00D5535C /* NSColor+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923E9235A022C001506B6 /* NSColor+ext.swift */; };
830D1559237961C900D5535C /* WarningUTIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830D1558237961C900D5535C /* WarningUTIViewController.swift */; };
- 830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; };
8311D9C7235DE6D7006DC138 /* Data+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8311D9C6235DE6D7006DC138 /* Data+Ext.swift */; };
8311D9C8235DE6D7006DC138 /* Data+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8311D9C6235DE6D7006DC138 /* Data+Ext.swift */; };
8319450926383626002E5B86 /* dos2unix in Resources */ = {isa = PBXBuildFile; fileRef = 8319450826383626002E5B86 /* dos2unix */; };
@@ -38,6 +38,8 @@
831FD81E2691FF6400C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; };
831FD8202691FF6500C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; };
831FD821269203EF00C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; };
+ 832700BE2C0EEFAF00DD3E9D /* about.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 832700BB2C0EE86700DD3E9D /* about.lua */; };
+ 832F7E5E2E054B9F0015DBBC /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 832F7E5D2E054B9F0015DBBC /* Yams */; };
83408DDE23804A0700128B0C /* examples in Resources */ = {isa = PBXBuildFile; fileRef = 83408DDD23804A0600128B0C /* examples */; };
83408DE02380505000128B0C /* CSSControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83408DDF2380505000128B0C /* CSSControlView.swift */; };
8342C90E277EF4340018FCD8 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 8342C90D277EF4340018FCD8 /* Sparkle */; };
@@ -100,8 +102,9 @@
836257A325A8BD8E00475069 /* HighlightWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8362579725A8BD6A00475069 /* HighlightWrapper.swift */; };
836257BB25A9D7CB00475069 /* colorize.sh in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 8359236F2355B19F001506B6 /* colorize.sh */; };
8362582925A9F3E100475069 /* Syntax Highlight XPC Render.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 83632E812F8E2BA5008B95DE /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 83632E802F8E2BA5008B95DE /* Yams */; };
836A09E0270442F30067AF0D /* languages.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836A09DE270441680067AF0D /* languages.json */; };
- 836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; };
836CBCDC2712C70200A228AE /* VCSSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836CBCDB2712C70200A228AE /* VCSSettingsViewController.swift */; };
836CD780283024BF00F074CB /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 836CD77F283024BF00F074CB /* Yams */; };
836CD783283024D000F074CB /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 836CD782283024D000F074CB /* Yams */; };
@@ -157,13 +160,44 @@
83A0691123672FD100C795D6 /* style.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 83A0691023672FD100C795D6 /* style.css */; };
83A1C609245C441E0045C2AC /* ThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A1C608245C441E0045C2AC /* ThemeCollectionViewItem.swift */; };
83A1C60A245C45980045C2AC /* ThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8390B19023815FF200EA028A /* ThemeCollectionViewItem.xib */; };
+ 83A25C432D1DA9DD00C8B349 /* languages.json in Resources */ = {isa = PBXBuildFile; fileRef = 836A09DE270441680067AF0D /* languages.json */; };
+ 83A25C452D1DAA2200C8B349 /* share in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 831C70DA2618ABAB0011C3F8 /* share */; };
+ 83A25C462D1DAA3800C8B349 /* colorize.sh in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 8359236F2355B19F001506B6 /* colorize.sh */; };
+ 83A25C472D1DAA3D00C8B349 /* style.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 83A0691023672FD100C795D6 /* style.css */; };
+ 83A25C482D1DAA3D00C8B349 /* style2.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 834DA8332735BC0B00519C78 /* style2.css */; };
+ 83A25C492D1DD79B00C8B349 /* libwrapper_highlight.dylib in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 83A25C4A2D1DD79B00C8B349 /* libhighlight.dylib in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 8383705825AB7F700048A737 /* libhighlight.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 83A25C522D1DD91700C8B349 /* highlight in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 83A25C512D1DD91700C8B349 /* highlight */; };
+ 83A25C552D1DD9EC00C8B349 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; };
+ 83A25C562D1DD9F500C8B349 /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; };
+ 83A25C572D1DD9FC00C8B349 /* about.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 832700BB2C0EE86700DD3E9D /* about.lua */; };
+ 83A25C582D1DDA0000C8B349 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; };
+ 83A25C5A2D1DDA6500C8B349 /* dos2unix in Resources */ = {isa = PBXBuildFile; fileRef = 8319450826383626002E5B86 /* dos2unix */; };
+ 83A25C5B2D1DDA7700C8B349 /* settings.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 836CD788283029B600F074CB /* settings.yaml */; };
+ 83A25C6A2D1E055600C8B349 /* touch_files.sh in Resources */ = {isa = PBXBuildFile; fileRef = 83A25C692D1E055000C8B349 /* touch_files.sh */; };
+ 83A25C6B2D1E055600C8B349 /* touch_files.sh in Resources */ = {isa = PBXBuildFile; fileRef = 83A25C692D1E055000C8B349 /* touch_files.sh */; };
+ 83ABC9C42D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex in Embed ExtensionKit Extensions */ = {isa = PBXBuildFile; fileRef = 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 83ABC9CC2D1BF64700CF8972 /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 83ABC9CB2D1BF64700CF8972 /* Yams */; };
+ 83ABC9CD2D1BFE4500CF8972 /* SCSHBaseXPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */; };
+ 83ABC9CE2D1BFE7800CF8972 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836FE00125F22A360053B6E2 /* Settings.swift */; };
+ 83ABC9CF2D1BFE9200CF8972 /* Settings+Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831C6C9C2616476B0011C3F8 /* Settings+Service.swift */; };
+ 83ABC9D02D1BFF9D00CF8972 /* PlainSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834DA83B2736B84200519C78 /* PlainSettings.swift */; };
+ 83ABC9D12D1BFFA900CF8972 /* NotificationCenter+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83950DB125FD79CF002CF526 /* NotificationCenter+ext.swift */; };
+ 83ABC9D22D1BFFB300CF8972 /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; };
+ 83ABC9D32D1BFFB900CF8972 /* ColorizeArgument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834DA8412737C55B00519C78 /* ColorizeArgument.swift */; };
+ 83ABC9D42D1BFFC100CF8972 /* File+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836D01E32386C7CD00B85545 /* File+Ext.swift */; };
+ 83ABC9D52D1BFFCC00CF8972 /* TaskResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0B6238FA897007A455C /* TaskResult.swift */; };
+ 83ABC9D62D1BFFD600CF8972 /* SCSHError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8359239C23570C52001506B6 /* SCSHError.swift */; };
+ 83ABC9D72D1BFFDE00CF8972 /* String+GShell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 839098C32379E34A005D3E7C /* String+GShell.swift */; };
+ 83ABC9D82D1BFFE700CF8972 /* MagicAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8373D5CF2716B0A100B43140 /* MagicAttributes.swift */; };
+ 83ABC9D92D1C001000CF8972 /* String+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836D01E52386DE4E00B85545 /* String+ext.swift */; };
+ 83ABC9DA2D1C002500CF8972 /* NSColor+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923E9235A022C001506B6 /* NSColor+ext.swift */; };
83B4642A25A7198B00DE0CF4 /* UTIInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B4642925A7198B00DE0CF4 /* UTIInfoViewController.swift */; };
83B4644425A76D9700DE0CF4 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B4644325A76D9700DE0CF4 /* AboutViewController.swift */; };
83BA16E825EBC5AB0054A404 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83BA16E725EBC5AB0054A404 /* SliderView.swift */; };
83E5E67C25AE1FF900FAF5E2 /* SaveAsFormatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83E5E67925AE1FF900FAF5E2 /* SaveAsFormatView.swift */; };
83E5E68225AE242F00FAF5E2 /* SaveAsFormatView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83E5E67B25AE1FF900FAF5E2 /* SaveAsFormatView.xib */; };
83EDC92D25F6E23100B1621E /* FontSelectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83EDC92C25F6E23100B1621E /* FontSelectorViewController.swift */; };
- 83FD6ED3246B061600F5BDF3 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FD6ED2246B061600F5BDF3 /* main.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -188,6 +222,13 @@
remoteGlobalIDString = 83257FD82638126E00A8888F;
remoteInfo = dos2unix;
};
+ 832F7E5F2E05510C0015DBBC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 8359233D235599F6001506B6 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 832F7E552E054B8E0015DBBC;
+ remoteInfo = settings_chk;
+ };
8359236823559A2B001506B6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8359233D235599F6001506B6 /* Project object */;
@@ -223,9 +264,53 @@
remoteGlobalIDString = 838F4659238D813500268B4A;
remoteInfo = SyntaxHighlightRenderXPC;
};
+ 83A25C702D1E08B000C8B349 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 8359233D235599F6001506B6 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 83A25C6C2D1E06CC00C8B349;
+ remoteInfo = extra_resources;
+ };
+ 83A25C742D1E08D000C8B349 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 8359233D235599F6001506B6 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 83A25C6C2D1E06CC00C8B349;
+ remoteInfo = extra_resources;
+ };
+ 83A25C762D1E08DF00C8B349 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 83B4645425A779FC00DE0CF4;
+ remoteInfo = "highlight-wrapper";
+ };
+ 83A25C782D1E08E900C8B349 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 832580AF263812C800A8888F /* dos2unix.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 83257FD82638126E00A8888F;
+ remoteInfo = dos2unix;
+ };
+ 83ABC9C22D1BF61900CF8972 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 8359233D235599F6001506B6 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 83ABC9B92D1BF61900CF8972;
+ remoteInfo = ShortcutCommand;
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
+ 832F7E542E054B8E0015DBBC /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
8359236E23559A2B001506B6 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -332,11 +417,64 @@
files = (
830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */,
836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */,
+ 832700BE2C0EEFAF00DD3E9D /* about.lua in Copy extra plugins */,
830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */,
);
name = "Copy extra plugins";
runOnlyForDeploymentPostprocessing = 0;
};
+ 83A25C532D1DD9AD00C8B349 /* Copy Highlight executable */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = highlight/bin;
+ dstSubfolderSpec = 7;
+ files = (
+ 83A25C522D1DD91700C8B349 /* highlight in Copy Highlight executable */,
+ 83A25C4A2D1DD79B00C8B349 /* libhighlight.dylib in Copy Highlight executable */,
+ 83A25C492D1DD79B00C8B349 /* libwrapper_highlight.dylib in Copy Highlight executable */,
+ );
+ name = "Copy Highlight executable";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 83A25C542D1DD9D300C8B349 /* Copy extra plugins */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = highlight/share/plugins;
+ dstSubfolderSpec = 7;
+ files = (
+ 83A25C582D1DDA0000C8B349 /* debug.lua in Copy extra plugins */,
+ 83A25C572D1DD9FC00C8B349 /* about.lua in Copy extra plugins */,
+ 83A25C562D1DD9F500C8B349 /* vcs.lua in Copy extra plugins */,
+ 83A25C552D1DD9EC00C8B349 /* html_editor.lua in Copy extra plugins */,
+ );
+ name = "Copy extra plugins";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 83A25C592D1DDA1B00C8B349 /* Copy Highlight share files */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = highlight;
+ dstSubfolderSpec = 7;
+ files = (
+ 83A25C462D1DAA3800C8B349 /* colorize.sh in Copy Highlight share files */,
+ 83A25C452D1DAA2200C8B349 /* share in Copy Highlight share files */,
+ 83A25C472D1DAA3D00C8B349 /* style.css in Copy Highlight share files */,
+ 83A25C482D1DAA3D00C8B349 /* style2.css in Copy Highlight share files */,
+ );
+ name = "Copy Highlight share files";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 83ABC9C52D1BF61900CF8972 /* Embed ExtensionKit Extensions */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "$(EXTENSIONS_FOLDER_PATH)";
+ dstSubfolderSpec = 16;
+ files = (
+ 83ABC9C42D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex in Embed ExtensionKit Extensions */,
+ );
+ name = "Embed ExtensionKit Extensions";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
83B4856E25A7A1BF00DE0CF4 /* Copy Highlight share files */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 12;
@@ -351,18 +489,10 @@
name = "Copy Highlight share files";
runOnlyForDeploymentPostprocessing = 0;
};
- 83FD6ECE246B061600F5BDF3 /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 8304A20B2F61616200FFFB35 /* syntax-highlight.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = "syntax-highlight.rb"; sourceTree = ""; };
8304B0B4238E8B21007A455C /* about_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_highlight.png; sourceTree = ""; };
8304B0B6238FA897007A455C /* TaskResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskResult.swift; sourceTree = ""; };
8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCSHBaseXPCService.swift; sourceTree = ""; };
@@ -542,6 +672,8 @@
832580C0263812C800A8888F /* djgpp.mak */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = djgpp.mak; sourceTree = ""; };
832580C1263812C800A8888F /* DEVEL.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = DEVEL.txt; sourceTree = ""; };
832580C2263812C800A8888F /* unix2dos.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = unix2dos.c; sourceTree = ""; };
+ 832700BB2C0EE86700DD3E9D /* about.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = about.lua; sourceTree = ""; };
+ 832F7E562E054B8E0015DBBC /* settings_chk */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = settings_chk; sourceTree = BUILT_PRODUCTS_DIR; };
833C295C236028B000B14757 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; };
83408DDD23804A0600128B0C /* examples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = examples; sourceTree = ""; };
83408DDF2380505000128B0C /* CSSControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSSControlView.swift; sourceTree = ""; };
@@ -629,10 +761,16 @@
83950DB125FD79CF002CF526 /* NotificationCenter+ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationCenter+ext.swift"; sourceTree = ""; };
83A0691023672FD100C795D6 /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = ""; };
83A1C608245C441E0045C2AC /* ThemeCollectionViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeCollectionViewItem.swift; sourceTree = ""; };
+ 83A25C4B2D1DD7DB00C8B349 /* highlight */ = {isa = PBXFileReference; lastKnownFileType = text; name = highlight; path = "../../../../../../../../Develop/macos/QLExt/highlight-wrapper/highlight/build-Debug/bin/highlight"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 83A25C512D1DD91700C8B349 /* highlight */ = {isa = PBXFileReference; lastKnownFileType = text; name = highlight; path = highlight/highlight; sourceTree = BUILT_PRODUCTS_DIR; };
+ 83A25C622D1E014B00C8B349 /* support_files.xcfilelist */ = {isa = PBXFileReference; lastKnownFileType = text.xcfilelist; path = support_files.xcfilelist; sourceTree = ""; };
+ 83A25C692D1E055000C8B349 /* touch_files.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = touch_files.sh; sourceTree = ""; };
+ 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.extensionkit-extension"; includeInIndex = 0; path = "Syntax Hightlight Shortcut Action.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 83B3CBA12F8E65640021057D /* entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = entitlements.entitlements; sourceTree = ""; };
+ 83B3CBA22F8E67480021057D /* entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = entitlements.entitlements; sourceTree = ""; };
83B4642925A7198B00DE0CF4 /* UTIInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UTIInfoViewController.swift; sourceTree = ""; };
83B4644325A76D9700DE0CF4 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; };
83B4646825A779FD00DE0CF4 /* highlight-wrapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "highlight-wrapper.xcodeproj"; sourceTree = ""; };
- 83B47B9C25A77A5600DE0CF4 /* wrapper_highlight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrapper_highlight.h; sourceTree = ""; };
83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "highlight-wrapper.xcodeproj"; path = "highlight-wrapper/highlight-wrapper.xcodeproj"; sourceTree = ""; };
83B47BC225A77C1000DE0CF4 /* SourceCodeSyntaxHighlight-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SourceCodeSyntaxHighlight-Bridging-Header.h"; sourceTree = ""; };
83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libwrapper_highlight.dylib; path = highlight/libwrapper_highlight.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -644,12 +782,34 @@
83E5E67B25AE1FF900FAF5E2 /* SaveAsFormatView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SaveAsFormatView.xib; sourceTree = ""; };
83EAEE842740FD2F0093B9B7 /* vcs_preview.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vcs_preview.png; sourceTree = ""; };
83EDC92C25F6E23100B1621E /* FontSelectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSelectorViewController.swift; sourceTree = ""; };
- 83FD6ED0246B061600F5BDF3 /* relaunch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = relaunch; sourceTree = BUILT_PRODUCTS_DIR; };
- 83FD6ED2246B061600F5BDF3 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; };
+ 83F70DCF305ACC8900D4853F /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
83FD6EED246C71C600F5BDF3 /* Syntax Highlight XPC Render.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Syntax Highlight XPC Render.entitlements"; sourceTree = ""; };
/* End PBXFileReference section */
+/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
+ 83ABC9C82D1BF61900CF8972 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
+ isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
+ membershipExceptions = (
+ Info.plist,
+ );
+ target = 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */;
+ };
+/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
+
+/* Begin PBXFileSystemSynchronizedRootGroup section */
+ 832F7E572E054B8E0015DBBC /* settings_chk */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = settings_chk; sourceTree = ""; };
+ 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (83ABC9C82D1BF61900CF8972 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = ShortcutCommand; sourceTree = ""; };
+/* End PBXFileSystemSynchronizedRootGroup section */
+
/* Begin PBXFrameworksBuildPhase section */
+ 832F7E532E054B8E0015DBBC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 832F7E5E2E054B9F0015DBBC /* Yams in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
83592342235599F6001506B6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -667,6 +827,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 83632E812F8E2BA5008B95DE /* Yams in Frameworks */,
8359235F23559A2B001506B6 /* Quartz.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -695,10 +856,11 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- 83FD6ECD246B061600F5BDF3 /* Frameworks */ = {
+ 83ABC9B72D1BF61900CF8972 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 83ABC9CC2D1BF64700CF8972 /* Yams in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -712,6 +874,14 @@
name = Products;
sourceTree = "";
};
+ 8304A20C2F61616200FFFB35 /* Casks */ = {
+ isa = PBXGroup;
+ children = (
+ 8304A20B2F61616200FFFB35 /* syntax-highlight.rb */,
+ );
+ path = Casks;
+ sourceTree = "";
+ };
83194503263812E2002E5B86 /* Products */ = {
isa = PBXGroup;
children = (
@@ -722,8 +892,10 @@
831C6CF92618AAA50011C3F8 /* resources */ = {
isa = PBXGroup;
children = (
+ 83A25C692D1E055000C8B349 /* touch_files.sh */,
830A2DA82626C39A00C89F29 /* html_editor.lua */,
836DAC07270AD7A900053043 /* vcs.lua */,
+ 832700BB2C0EE86700DD3E9D /* about.lua */,
830E8318273E9E6C00B15859 /* debug.lua */,
8319450826383626002E5B86 /* dos2unix */,
831C6CFA2618AAB50011C3F8 /* highlight */,
@@ -1040,6 +1212,7 @@
832580C3263812C800A8888F /* dos2unix */ = {
isa = PBXGroup;
children = (
+ 83B3CBA22F8E67480021057D /* entitlements.entitlements */,
83D33410263A96C3003CEEFD /* .gitignore */,
83258038263812C800A8888F /* man */,
83258039263812C800A8888F /* COPYING.txt */,
@@ -1081,6 +1254,8 @@
8359233C235599F6001506B6 = {
isa = PBXGroup;
children = (
+ 8304A20C2F61616200FFFB35 /* Casks */,
+ 83A25C622D1E014B00C8B349 /* support_files.xcfilelist */,
8311D9A3235CDAA1006DC138 /* README.md */,
836D01DF2385214D00B85545 /* CHANGELOG.md */,
8383704C25AB733E0048A737 /* TODO.md */,
@@ -1093,8 +1268,9 @@
8359236023559A2B001506B6 /* QLExtension */,
8359237C23563BDF001506B6 /* XPCService */,
838F465B238D813500268B4A /* SyntaxHighlightRenderXPC */,
- 83FD6ED1246B061600F5BDF3 /* relaunch */,
8373D5C42716161800B43140 /* syntax_highlight_cli */,
+ 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */,
+ 832F7E572E054B8E0015DBBC /* settings_chk */,
8359235D23559A2B001506B6 /* Frameworks */,
83592346235599F6001506B6 /* Products */,
83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */,
@@ -1108,8 +1284,11 @@
8359235C23559A2B001506B6 /* Syntax Highlight Quick Look Extension.appex */,
8359237B23563BDF001506B6 /* Syntax Highlight XPC Service.xpc */,
838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */,
- 83FD6ED0246B061600F5BDF3 /* relaunch */,
+ 83A25C512D1DD91700C8B349 /* highlight */,
8373D5C32716161800B43140 /* syntax_highlight_cli */,
+ 83A25C4B2D1DD7DB00C8B349 /* highlight */,
+ 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */,
+ 832F7E562E054B8E0015DBBC /* settings_chk */,
);
name = Products;
sourceTree = "";
@@ -1148,6 +1327,7 @@
8359235D23559A2B001506B6 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 83F70DCF305ACC8900D4853F /* CoreServices.framework */,
83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */,
8383705825AB7F700048A737 /* libhighlight.dylib */,
8359239A23565890001506B6 /* Foundation.framework */,
@@ -1273,9 +1453,9 @@
83B4646725A779FD00DE0CF4 /* highlight-wrapper */ = {
isa = PBXGroup;
children = (
+ 83B3CBA12F8E65640021057D /* entitlements.entitlements */,
8361B16E263A962300B85467 /* .gitignore */,
83B4646825A779FD00DE0CF4 /* highlight-wrapper.xcodeproj */,
- 83B47B9C25A77A5600DE0CF4 /* wrapper_highlight.h */,
);
path = "highlight-wrapper";
sourceTree = "";
@@ -1304,17 +1484,68 @@
name = Themes;
sourceTree = "";
};
- 83FD6ED1246B061600F5BDF3 /* relaunch */ = {
- isa = PBXGroup;
- children = (
- 83FD6ED2246B061600F5BDF3 /* main.swift */,
+/* End PBXGroup section */
+
+/* Begin PBXLegacyTarget section */
+ 83A25C6C2D1E06CC00C8B349 /* extra_resources */ = {
+ isa = PBXLegacyTarget;
+ buildArgumentsString = "touch_files.sh $(SRCROOT)/support_files.xcfilelist";
+ buildConfigurationList = 83A25C6D2D1E06CC00C8B349 /* Build configuration list for PBXLegacyTarget "extra_resources" */;
+ buildPhases = (
);
- path = relaunch;
- sourceTree = "";
+ buildToolPath = /bin/sh;
+ buildWorkingDirectory = "$(SRCROOT)/Application/resources/";
+ dependencies = (
+ );
+ name = extra_resources;
+ packageProductDependencies = (
+ );
+ passBuildSettingsInEnvironment = 1;
+ productName = extra_resources;
};
-/* End PBXGroup section */
+ 83FDB5322D10493D00D55608 /* yaml checker */ = {
+ isa = PBXLegacyTarget;
+ buildArgumentsString = "${SRCROOT}/settings_chk/check.sh";
+ buildConfigurationList = 83FDB5332D10493D00D55608 /* Build configuration list for PBXLegacyTarget "yaml checker" */;
+ buildPhases = (
+ );
+ buildToolPath = /bin/sh;
+ buildWorkingDirectory = "";
+ dependencies = (
+ 832F7E602E05510C0015DBBC /* PBXTargetDependency */,
+ );
+ name = "yaml checker";
+ packageProductDependencies = (
+ );
+ passBuildSettingsInEnvironment = 1;
+ productName = "yaml checker";
+ };
+/* End PBXLegacyTarget section */
/* Begin PBXNativeTarget section */
+ 832F7E552E054B8E0015DBBC /* settings_chk */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 832F7E5A2E054B8E0015DBBC /* Build configuration list for PBXNativeTarget "settings_chk" */;
+ buildPhases = (
+ 832F7E522E054B8E0015DBBC /* Sources */,
+ 832F7E532E054B8E0015DBBC /* Frameworks */,
+ 832F7E542E054B8E0015DBBC /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ fileSystemSynchronizedGroups = (
+ 832F7E572E054B8E0015DBBC /* settings_chk */,
+ );
+ name = settings_chk;
+ packageProductDependencies = (
+ 832F7E5D2E054B9F0015DBBC /* Yams */,
+ );
+ productName = settings_chk;
+ productReference = 832F7E562E054B8E0015DBBC /* settings_chk */;
+ productType = "com.apple.product-type.tool";
+ };
83592344235599F6001506B6 /* Syntax Highlight */ = {
isa = PBXNativeTarget;
buildConfigurationList = 83592355235599F9001506B6 /* Build configuration list for PBXNativeTarget "Syntax Highlight" */;
@@ -1330,16 +1561,19 @@
8396DF3A257C4203005D6489 /* Embed Frameworks */,
836257C625A9DA1A00475069 /* Copy Highlight executable */,
839BAB942601480A00D399ED /* Copy extra plugins */,
+ 83ABC9C52D1BF61900CF8972 /* Embed ExtensionKit Extensions */,
);
buildRules = (
);
dependencies = (
+ 83A25C752D1E08D000C8B349 /* PBXTargetDependency */,
836B55CE272E92D9008297D5 /* PBXTargetDependency */,
1F39AA712741F97600569E96 /* PBXTargetDependency */,
8319450F26394445002E5B86 /* PBXTargetDependency */,
8359236923559A2B001506B6 /* PBXTargetDependency */,
8359238523563BDF001506B6 /* PBXTargetDependency */,
838F4664238D813500268B4A /* PBXTargetDependency */,
+ 83ABC9C32D1BF61900CF8972 /* PBXTargetDependency */,
);
name = "Syntax Highlight";
packageProductDependencies = (
@@ -1429,22 +1663,34 @@
productReference = 838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */;
productType = "com.apple.product-type.xpc-service";
};
- 83FD6ECF246B061600F5BDF3 /* relaunch */ = {
+ 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 83FD6EDA246B061600F5BDF3 /* Build configuration list for PBXNativeTarget "relaunch" */;
+ buildConfigurationList = 83ABC9C92D1BF61900CF8972 /* Build configuration list for PBXNativeTarget "Syntax Hightlight Shortcut Action" */;
buildPhases = (
- 83FD6ECC246B061600F5BDF3 /* Sources */,
- 83FD6ECD246B061600F5BDF3 /* Frameworks */,
- 83FD6ECE246B061600F5BDF3 /* CopyFiles */,
+ 83ABC9B62D1BF61900CF8972 /* Sources */,
+ 83ABC9B72D1BF61900CF8972 /* Frameworks */,
+ 83ABC9B82D1BF61900CF8972 /* Resources */,
+ 83A25C592D1DDA1B00C8B349 /* Copy Highlight share files */,
+ 83A25C532D1DD9AD00C8B349 /* Copy Highlight executable */,
+ 83A25C542D1DD9D300C8B349 /* Copy extra plugins */,
);
buildRules = (
);
dependencies = (
+ 83A25C792D1E08E900C8B349 /* PBXTargetDependency */,
+ 83A25C772D1E08DF00C8B349 /* PBXTargetDependency */,
+ 83A25C712D1E08B000C8B349 /* PBXTargetDependency */,
);
- name = relaunch;
- productName = relaunch;
- productReference = 83FD6ED0246B061600F5BDF3 /* relaunch */;
- productType = "com.apple.product-type.tool";
+ fileSystemSynchronizedGroups = (
+ 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */,
+ );
+ name = "Syntax Hightlight Shortcut Action";
+ packageProductDependencies = (
+ 83ABC9CB2D1BF64700CF8972 /* Yams */,
+ );
+ productName = ShortcutCommand;
+ productReference = 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */;
+ productType = "com.apple.product-type.extensionkit-extension";
};
/* End PBXNativeTarget section */
@@ -1453,10 +1699,13 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
- LastSwiftUpdateCheck = 1300;
- LastUpgradeCheck = 1520;
+ LastSwiftUpdateCheck = 1640;
+ LastUpgradeCheck = 2700;
ORGANIZATIONNAME = sbarex;
TargetAttributes = {
+ 832F7E552E054B8E0015DBBC = {
+ CreatedOnToolsVersion = 16.4;
+ };
83592344235599F6001506B6 = {
CreatedOnToolsVersion = 11.0;
};
@@ -1473,8 +1722,14 @@
CreatedOnToolsVersion = 11.2.1;
LastSwiftMigration = 1300;
};
- 83FD6ECF246B061600F5BDF3 = {
- CreatedOnToolsVersion = 11.4.1;
+ 83A25C6C2D1E06CC00C8B349 = {
+ CreatedOnToolsVersion = 16.2;
+ };
+ 83ABC9B92D1BF61900CF8972 = {
+ CreatedOnToolsVersion = 16.2;
+ };
+ 83FDB5322D10493D00D55608 = {
+ CreatedOnToolsVersion = 16.2;
};
};
};
@@ -1485,6 +1740,7 @@
knownRegions = (
en,
Base,
+ it,
);
mainGroup = 8359233C235599F6001506B6;
packageReferences = (
@@ -1513,8 +1769,11 @@
8359235B23559A2B001506B6 /* Syntax Highlight Quick Look Extension */,
8359237A23563BDF001506B6 /* Syntax Highlight XPC Service */,
838F4659238D813500268B4A /* Syntax Highlight XPC Render */,
- 83FD6ECF246B061600F5BDF3 /* relaunch */,
+ 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */,
+ 832F7E552E054B8E0015DBBC /* settings_chk */,
8373D5C22716161800B43140 /* syntax_highlight_cli */,
+ 83FDB5322D10493D00D55608 /* yaml checker */,
+ 83A25C6C2D1E06CC00C8B349 /* extra_resources */,
);
};
/* End PBXProject section */
@@ -1536,6 +1795,7 @@
836CD789283029C500F074CB /* settings.yaml in Resources */,
83408DDE23804A0700128B0C /* examples in Resources */,
837F088623802A8000D3893B /* SyntaxHighlight.help in Resources */,
+ 83A25C6A2D1E055600C8B349 /* touch_files.sh in Resources */,
83950D7D25FC9B01002CF526 /* ThemeEditorView.xib in Resources */,
8319450926383626002E5B86 /* dos2unix in Resources */,
8373D5DB2716B2BE00B43140 /* syntax_highlight_cli in Resources */,
@@ -1550,6 +1810,17 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 83ABC9B82D1BF61900CF8972 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83A25C5B2D1DDA7700C8B349 /* settings.yaml in Resources */,
+ 83A25C5A2D1DDA6500C8B349 /* dos2unix in Resources */,
+ 83A25C432D1DA9DD00C8B349 /* languages.json in Resources */,
+ 83A25C6B2D1E055600C8B349 /* touch_files.sh in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -1574,6 +1845,13 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 832F7E522E054B8E0015DBBC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
83592341235599F6001506B6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1712,11 +1990,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- 83FD6ECC246B061600F5BDF3 /* Sources */ = {
+ 83ABC9B62D1BF61900CF8972 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 83FD6ED3246B061600F5BDF3 /* main.swift in Sources */,
+ 83ABC9D32D1BFFB900CF8972 /* ColorizeArgument.swift in Sources */,
+ 83ABC9D62D1BFFD600CF8972 /* SCSHError.swift in Sources */,
+ 83ABC9D82D1BFFE700CF8972 /* MagicAttributes.swift in Sources */,
+ 83ABC9D52D1BFFCC00CF8972 /* TaskResult.swift in Sources */,
+ 83ABC9D12D1BFFA900CF8972 /* NotificationCenter+ext.swift in Sources */,
+ 83ABC9CF2D1BFE9200CF8972 /* Settings+Service.swift in Sources */,
+ 83ABC9DA2D1C002500CF8972 /* NSColor+ext.swift in Sources */,
+ 83ABC9D02D1BFF9D00CF8972 /* PlainSettings.swift in Sources */,
+ 83ABC9D72D1BFFDE00CF8972 /* String+GShell.swift in Sources */,
+ 83ABC9D92D1C001000CF8972 /* String+ext.swift in Sources */,
+ 83ABC9CE2D1BFE7800CF8972 /* Settings.swift in Sources */,
+ 83ABC9D42D1BFFC100CF8972 /* File+Ext.swift in Sources */,
+ 83ABC9D22D1BFFB300CF8972 /* UTI.swift in Sources */,
+ 83ABC9CD2D1BFE4500CF8972 /* SCSHBaseXPCService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1738,6 +2029,11 @@
name = dos2unix;
targetProxy = 8319450E26394445002E5B86 /* PBXContainerItemProxy */;
};
+ 832F7E602E05510C0015DBBC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 832F7E552E054B8E0015DBBC /* settings_chk */;
+ targetProxy = 832F7E5F2E05510C0015DBBC /* PBXContainerItemProxy */;
+ };
8359236923559A2B001506B6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8359235B23559A2B001506B6 /* Syntax Highlight Quick Look Extension */;
@@ -1763,6 +2059,31 @@
target = 838F4659238D813500268B4A /* Syntax Highlight XPC Render */;
targetProxy = 838F4663238D813500268B4A /* PBXContainerItemProxy */;
};
+ 83A25C712D1E08B000C8B349 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 83A25C6C2D1E06CC00C8B349 /* extra_resources */;
+ targetProxy = 83A25C702D1E08B000C8B349 /* PBXContainerItemProxy */;
+ };
+ 83A25C752D1E08D000C8B349 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 83A25C6C2D1E06CC00C8B349 /* extra_resources */;
+ targetProxy = 83A25C742D1E08D000C8B349 /* PBXContainerItemProxy */;
+ };
+ 83A25C772D1E08DF00C8B349 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "highlight-wrapper";
+ targetProxy = 83A25C762D1E08DF00C8B349 /* PBXContainerItemProxy */;
+ };
+ 83A25C792D1E08E900C8B349 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = dos2unix;
+ targetProxy = 83A25C782D1E08E900C8B349 /* PBXContainerItemProxy */;
+ };
+ 83ABC9C32D1BF61900CF8972 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */;
+ targetProxy = 83ABC9C22D1BF61900CF8972 /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -1777,11 +2098,73 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ 832F7E5B2E054B8E0015DBBC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ AUTOMATION_APPLE_EVENTS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
+ ENABLE_HARDENED_RUNTIME = YES;
+ ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO;
+ ENABLE_RESOURCE_ACCESS_CALENDARS = NO;
+ ENABLE_RESOURCE_ACCESS_CAMERA = NO;
+ ENABLE_RESOURCE_ACCESS_CONTACTS = NO;
+ ENABLE_RESOURCE_ACCESS_LOCATION = NO;
+ ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ INSTALL_PATH = "";
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.SourceCodeSyntaxHighlight.settings-check";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO;
+ RUNTIME_EXCEPTION_ALLOW_JIT = NO;
+ RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO;
+ RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO;
+ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO;
+ RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 832F7E5C2E054B8E0015DBBC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ AUTOMATION_APPLE_EVENTS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
+ ENABLE_HARDENED_RUNTIME = YES;
+ ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO;
+ ENABLE_RESOURCE_ACCESS_CALENDARS = NO;
+ ENABLE_RESOURCE_ACCESS_CAMERA = NO;
+ ENABLE_RESOURCE_ACCESS_CONTACTS = NO;
+ ENABLE_RESOURCE_ACCESS_LOCATION = NO;
+ ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ INSTALL_PATH = "";
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.SourceCodeSyntaxHighlight.settings-check";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO;
+ RUNTIME_EXCEPTION_ALLOW_JIT = NO;
+ RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO;
+ RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO;
+ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO;
+ RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
83592353235599F9001506B6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -1837,7 +2220,9 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "";
SDKROOT = macosx;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
@@ -1848,6 +2233,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -1895,7 +2281,9 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
};
@@ -1906,19 +2294,21 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Application/SCSHApp.entitlements;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
+ HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/highlight-wrapper\"";
INFOPLIST_FILE = Application/Info.plist;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
@@ -1928,10 +2318,12 @@
"$(inherited)",
"\"$(BUILT_PRODUCTS_DIR)/highlight\"",
);
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Application/SourceCodeSyntaxHighlight-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
@@ -1942,20 +2334,22 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Application/SCSHApp.entitlements;
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
+ HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/highlight-wrapper\"";
INFOPLIST_FILE = Application/Info.plist;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
@@ -1965,11 +2359,13 @@
"$(inherited)",
"\"$(BUILT_PRODUCTS_DIR)/highlight\"",
);
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Application/SourceCodeSyntaxHighlight-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
@@ -1979,11 +2375,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 69;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1995,10 +2391,12 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
- MARKETING_VERSION = 2.1.19;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
@@ -2008,12 +2406,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements;
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
- CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 69;
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2025,11 +2423,13 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
- MARKETING_VERSION = 2.1.19;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
@@ -2039,12 +2439,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = XPCService/XPCServiceRelease.entitlements;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = XPCService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -2052,10 +2452,12 @@
"$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)_$(_BOOL_$(SKIP_INSTALL)))",
);
LIBRARY_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/highlight\"";
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
@@ -2067,13 +2469,13 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = XPCService/XPCServiceRelease.entitlements;
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = XPCService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@@ -2081,11 +2483,13 @@
"$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)_$(_BOOL_$(SKIP_INSTALL)))",
);
LIBRARY_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/highlight\"";
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
@@ -2096,15 +2500,32 @@
8373D5C72716161800B43140 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ AUTOMATION_APPLE_EVENTS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = syntax_highlight_cli/syntax_highlight_cli.entitlements;
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15.4;
+ ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO;
+ ENABLE_RESOURCE_ACCESS_CALENDARS = NO;
+ ENABLE_RESOURCE_ACCESS_CAMERA = NO;
+ ENABLE_RESOURCE_ACCESS_CONTACTS = NO;
+ ENABLE_RESOURCE_ACCESS_LOCATION = NO;
+ ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO;
+ INSTALL_PATH = "\"$(BUILT_PRODUCTS_DIR)/Syntax Highlight.app/Contents/Resources\"";
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.cli;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO;
+ RUNTIME_EXCEPTION_ALLOW_JIT = NO;
+ RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO;
+ RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO;
+ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO;
+ RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES;
+ SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
@@ -2112,15 +2533,32 @@
8373D5C82716161800B43140 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ AUTOMATION_APPLE_EVENTS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = syntax_highlight_cli/syntax_highlight_cli.entitlements;
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15.4;
+ ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO;
+ ENABLE_RESOURCE_ACCESS_CALENDARS = NO;
+ ENABLE_RESOURCE_ACCESS_CAMERA = NO;
+ ENABLE_RESOURCE_ACCESS_CONTACTS = NO;
+ ENABLE_RESOURCE_ACCESS_LOCATION = NO;
+ ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO;
+ INSTALL_PATH = "\"$(BUILT_PRODUCTS_DIR)/Syntax Highlight.app/Contents/Resources\"";
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.cli;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO;
+ RUNTIME_EXCEPTION_ALLOW_JIT = NO;
+ RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO;
+ RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO;
+ RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO;
+ RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES;
+ SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
@@ -2130,12 +2568,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements";
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2146,10 +2584,12 @@
"$(inherited)",
"@loader_path/../../../../Frameworks",
);
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCRender;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -2162,13 +2602,13 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements";
- CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 70;
+ CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2179,50 +2619,164 @@
"$(inherited)",
"@loader_path/../../../../Frameworks",
);
- MARKETING_VERSION = 2.1.21;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ MARKETING_VERSION = 2.1.32;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCRender;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
name = Release;
};
- 83FD6ED4246B061600F5BDF3 /* Debug */ = {
+ 83A25C6E2D1E06CC00C8B349 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
- DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
- MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.relaunch;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUGGING_SYMBOLS = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
- PROVISIONING_PROFILE_SPECIFIER = "";
+ };
+ name = Debug;
+ };
+ 83A25C6F2D1E06CC00C8B349 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ 83ABC9C62D1BF61900CF8972 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = ShortcutCommand/ShortcutCommand.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 81;
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
+ ENABLE_HARDENED_RUNTIME = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = ShortcutCommand/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = ShortcutCommand;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Developed by SBAREX (2019-2024).";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 15.0;
+ MARKETING_VERSION = 2.1.32;
+ PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.ShortcutCommand;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ REGISTER_APP_GROUPS = YES;
+ SKIP_INSTALL = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
- 83FD6ED5246B061600F5BDF3 /* Release */ = {
+ 83ABC9C72D1BF61900CF8972 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
- DEAD_CODE_STRIPPING = YES;
- DEVELOPMENT_TEAM = "";
- MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.relaunch;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = ShortcutCommand/ShortcutCommand.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 81;
+ DEVELOPMENT_TEAM = D5VMCLD3ZK;
+ ENABLE_HARDENED_RUNTIME = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = ShortcutCommand/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = ShortcutCommand;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Developed by SBAREX (2019-2024).";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 15.0;
+ MARKETING_VERSION = 2.1.32;
+ PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.ShortcutCommand;
PRODUCT_NAME = "$(TARGET_NAME)";
- PROVISIONING_PROFILE_SPECIFIER = "";
+ REGISTER_APP_GROUPS = YES;
+ SKIP_INSTALL = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
+ 83FDB5342D10493D00D55608 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUGGING_SYMBOLS = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 83FDB5352D10493D00D55608 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 12.0;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 832F7E5A2E054B8E0015DBBC /* Build configuration list for PBXNativeTarget "settings_chk" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 832F7E5B2E054B8E0015DBBC /* Debug */,
+ 832F7E5C2E054B8E0015DBBC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
83592340235599F6001506B6 /* Build configuration list for PBXProject "SourceCodeSyntaxHighlight" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -2277,11 +2831,29 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- 83FD6EDA246B061600F5BDF3 /* Build configuration list for PBXNativeTarget "relaunch" */ = {
+ 83A25C6D2D1E06CC00C8B349 /* Build configuration list for PBXLegacyTarget "extra_resources" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 83A25C6E2D1E06CC00C8B349 /* Debug */,
+ 83A25C6F2D1E06CC00C8B349 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 83ABC9C92D1BF61900CF8972 /* Build configuration list for PBXNativeTarget "Syntax Hightlight Shortcut Action" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 83ABC9C62D1BF61900CF8972 /* Debug */,
+ 83ABC9C72D1BF61900CF8972 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 83FDB5332D10493D00D55608 /* Build configuration list for PBXLegacyTarget "yaml checker" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 83FD6ED4246B061600F5BDF3 /* Debug */,
- 83FD6ED5246B061600F5BDF3 /* Release */,
+ 83FDB5342D10493D00D55608 /* Debug */,
+ 83FDB5352D10493D00D55608 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
@@ -2293,8 +2865,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sparkle-project/Sparkle";
requirement = {
- branch = 2.x;
- kind = branch;
+ kind = upToNextMajorVersion;
+ minimumVersion = 2.9.0;
};
};
836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */ = {
@@ -2302,17 +2874,27 @@
repositoryURL = "https://github.com/jpsim/Yams";
requirement = {
kind = upToNextMajorVersion;
- minimumVersion = 5.0.0;
+ minimumVersion = 6.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
+ 832F7E5D2E054B9F0015DBBC /* Yams */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */;
+ productName = Yams;
+ };
8342C90D277EF4340018FCD8 /* Sparkle */ = {
isa = XCSwiftPackageProductDependency;
package = 8342C90C277EF4340018FCD8 /* XCRemoteSwiftPackageReference "Sparkle" */;
productName = Sparkle;
};
+ 83632E802F8E2BA5008B95DE /* Yams */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */;
+ productName = Yams;
+ };
836CD77F283024BF00F074CB /* Yams */ = {
isa = XCSwiftPackageProductDependency;
package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */;
@@ -2333,6 +2915,11 @@
package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */;
productName = Yams;
};
+ 83ABC9CB2D1BF64700CF8972 /* Yams */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */;
+ productName = Yams;
+ };
/* End XCSwiftPackageProductDependency section */
};
rootObject = 8359233D235599F6001506B6 /* Project object */;
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 9cdf5e17..6f2f7225 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -1,12 +1,13 @@
{
+ "originHash" : "15968c5bad8d4865dd1b180983f5457041ce820d0ebeb16cc3e861da762c4bfc",
"pins" : [
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
- "branch" : "2.x",
- "revision" : "f0ceaf5cc9f3f23daa0ccb6dcebd79fc96ccc7d9"
+ "revision" : "066e75a8b3e99962685d6a90cdd5293ebffd9261",
+ "version" : "2.9.1"
}
},
{
@@ -14,10 +15,10 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams",
"state" : {
- "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
- "version" : "5.0.6"
+ "revision" : "deaf82e867fa2cbd3cd865978b079bfcf384ac28",
+ "version" : "6.2.1"
}
}
],
- "version" : 2
+ "version" : 3
}
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme
index e48cac02..023810e4 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme
+++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme
@@ -1,6 +1,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme
index e436d930..dce4bf96 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme
+++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme
@@ -1,6 +1,6 @@
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme
index 46c07207..cffdd5b9 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme
+++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme
@@ -1,6 +1,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme
index de34774f..8c8b7f44 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme
+++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme
@@ -1,6 +1,6 @@
+ LastUpgradeVersion = "2700"
+ version = "1.7">
+ buildImplicitDependencies = "YES"
+ buildArchitectures = "Automatic">
@@ -26,9 +27,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES">
-
-
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ shouldAutocreateTestPlan = "YES">
+ allowLocationSimulation = "YES"
+ viewDebuggingEnabled = "No">
-
-
-
-
-
-
+
+
+
+
diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme
index 3fb81fe7..3c5b8c27 100644
--- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme
+++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme
@@ -1,6 +1,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SyntaxHighlightRenderXPC/ColorizeArgument.swift b/SyntaxHighlightRenderXPC/ColorizeArgument.swift
index 396d5729..0f8f72dc 100644
--- a/SyntaxHighlightRenderXPC/ColorizeArgument.swift
+++ b/SyntaxHighlightRenderXPC/ColorizeArgument.swift
@@ -7,6 +7,7 @@
//
import Foundation
+import AppKit
struct ColorizeArguments {
/// Path of the `highlight` executable.
@@ -70,6 +71,16 @@ struct ColorizeArguments {
}
}
+ if custom_settings.isAboutVisible {
+ env["SH_NAME"] = Settings.appName
+ env["SH_VERSION"] = Settings.appVersion
+ env["SH_COPYRIGHT"] = Settings.appCopyright
+ env["SH_URL"] = Settings.appLink
+
+ hlArguments.arguments.append("--plug-in=about")
+ try? "Highlight plugin: about.lua".appendLine(to: custom_settings.logFile)
+ }
+
if custom_settings.isVCS && !custom_settings.vcsDiff.isEmpty {
// Set the env used by the vcs plugin.
env["VCS_DIFF"] = custom_settings.vcsDiff.joined(separator: " ")
@@ -122,7 +133,8 @@ struct ColorizeArguments {
cssCode += "\n"
}
do {
- cssCode += try String(contentsOf: style)
+ var enc: String.Encoding = .utf8
+ cssCode += try String(contentsOf: style, usedEncoding: &enc)
try? "CSS: \(style.path)".appendLine(to: custom_settings.logFile)
} catch {
try? "ERROR: unable to read the CSS file `\(style.path)`".appendLine(to: custom_settings.logFile)
diff --git a/SyntaxHighlightRenderXPC/Info.plist b/SyntaxHighlightRenderXPC/Info.plist
index 760b1407..d1b5c064 100644
--- a/SyntaxHighlightRenderXPC/Info.plist
+++ b/SyntaxHighlightRenderXPC/Info.plist
@@ -21,7 +21,7 @@
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright
- Developed by SBAREX (2019-2024).
+ Developed by SBAREX (2019-2026).
XPCService
ServiceType
diff --git a/SyntaxHighlightRenderXPC/MagicAttributes.swift b/SyntaxHighlightRenderXPC/MagicAttributes.swift
index 0db48c88..c5ef9490 100644
--- a/SyntaxHighlightRenderXPC/MagicAttributes.swift
+++ b/SyntaxHighlightRenderXPC/MagicAttributes.swift
@@ -7,6 +7,7 @@
//
import Foundation
+import UniformTypeIdentifiers
// MARK: -
class MagicAttributes {
@@ -23,46 +24,82 @@ class MagicAttributes {
} else if components.first?.contains("text") ?? false {
return true
} else {
- if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() {
- return UTTypeConformsTo(UType, kUTTypeText)
+ if #available(macOS 11.0, *) {
+ return UTType(mimeType: mimeType)?.conforms(to: UTType.text) ?? false
} else {
- return false
+ if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() {
+ return UTTypeConformsTo(UType, kUTTypeText)
+ } else {
+ return false
+ }
}
}
}()
func checkMime(conformTo uttype: CFString) -> Bool {
- if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() {
- return UTTypeConformsTo(UType, uttype)
+ if #available(macOS 11.0, *) {
+ if let type = UTType(mimeType: mimeType), let t = UTType(uttype as String) {
+ return type.conforms(to: t)
+ } else {
+ return false
+ }
} else {
- return false
+ if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() {
+ return UTTypeConformsTo(UType, uttype)
+ } else {
+ return false
+ }
}
}
+ @available(macOS 11.0, *)
+ func checkMime(conformTo uttype: UTType) -> Bool {
+ if let type = UTType(mimeType: mimeType) {
+ return type.conforms(to: uttype)
+ }
+ return false
+ }
+
/// Return if the parsed file is an image.
lazy var isImage: Bool = {
- return checkMime(conformTo: kUTTypeImage)
+ if #available(macOS 11.0, *) {
+ return checkMime(conformTo: UTType.image)
+ } else {
+ return checkMime(conformTo: kUTTypeImage)
+ }
}()
/// Return if the parsed file is an image.
var isPDF: Bool {
if self.mimeType == "application/pdf" {
return true
} else {
- return checkMime(conformTo: kUTTypePDF)
+ if #available(macOS 11.0, *) {
+ return checkMime(conformTo: UTType.pdf)
+ } else {
+ return checkMime(conformTo: kUTTypePDF)
+ }
}
}
var isMovie: Bool {
if self.mimeType.hasPrefix("video/") {
return true
} else {
- return checkMime(conformTo: kUTTypeVideo)
+ if #available(macOS 11.0, *) {
+ return checkMime(conformTo: UTType.video)
+ } else {
+ return checkMime(conformTo: kUTTypeVideo)
+ }
}
}
var isAudio: Bool {
if self.mimeType.hasPrefix("audio/") {
return true
} else {
- return checkMime(conformTo: kUTTypeAudio)
+ if #available(macOS 11.0, *) {
+ return checkMime(conformTo: UTType.audio)
+ } else {
+ return checkMime(conformTo: kUTTypeAudio)
+ }
}
}
diff --git a/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift b/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift
index 202e7fdb..749ea376 100644
--- a/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift
+++ b/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift
@@ -23,6 +23,7 @@
import Foundation
import Cocoa
import OSLog
+import UniformTypeIdentifiers
@objc
class SCSHBaseXPCService: NSObject {
@@ -189,6 +190,8 @@ class SCSHBaseXPCService: NSObject {
defer {
if let logFile = custom_settings.logFile {
var log = "";
+ log += "OS Appearance: \(custom_settings.isOSThemeLight() ? "light" : "dark")"
+
// Log the custom theme.
if let theme = colorize.inlineTheme, !theme.isEmpty {
log += "\n\n#######\n# Custom Theme:\n\(theme)\n\n#######"
@@ -353,9 +356,17 @@ class SCSHBaseXPCService: NSObject {
uti = plain!.UTI
}
- if uti=="auto" || uti == nil, let attributes = attributes, let utiType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, attributes.mimeType as CFString, nil)?.takeRetainedValue() {
- // Set the uti from the recognized mime.
- uti = utiType as String
+ if uti=="auto" || uti == nil, let attributes = attributes {
+ if #available(macOS 11.0, *) {
+ if let u = UTType(mimeType: attributes.mimeType) {
+ uti = u.identifier
+ }
+ } else {
+ if let utiType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, attributes.mimeType as CFString, nil)?.takeRetainedValue() {
+ // Set the uti from the recognized mime.
+ uti = utiType as String
+ }
+ }
}
var syntax = "auto"
if plain == nil || plain?.syntax == "auto", let u = uti {
@@ -655,7 +666,7 @@ img {
}
do {
try? "Getting the git status…".appendLine(to: logFile)
- try? "\(git) diff -U0 -0 \(url.path)".appendLine(to: logFile)
+ try? "\(git) diff -U0 \(url.path)".appendLine(to: logFile)
let result = try ShellTask.runTask(command: git, arguments: ["diff", "-U0", "-0", url.path], cwd: url.deletingLastPathComponent().path)
diff --git a/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements b/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements
index d0fdb1d3..a25de355 100644
--- a/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements
+++ b/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements
@@ -2,6 +2,10 @@
+ com.apple.security.application-groups
+
+ group.org.sbarex.syntaxhighlight
+
com.apple.security.get-task-allow
com.apple.security.temporary-exception.files.home-relative-path.read-write
diff --git a/SyntaxHighlightRenderXPC/XPCLightRenderService.swift b/SyntaxHighlightRenderXPC/XPCLightRenderService.swift
index 091fbb90..3e38ca67 100644
--- a/SyntaxHighlightRenderXPC/XPCLightRenderService.swift
+++ b/SyntaxHighlightRenderXPC/XPCLightRenderService.swift
@@ -29,10 +29,15 @@ import AppKit
class XPCLightRenderService: SCSHBaseXPCService, XPCLightRenderServiceProtocol {
lazy var highlightLanguages: [String: [String]] = {
guard let file = Bundle.main.url(forResource: "languages", withExtension: "json") else {
- print("missing file")
+ os_log(.error, log: self.log, "Missing languages.json file on the main Bundle!")
+ return [:]
+ }
+ do {
+ return try type(of: self).parseHighlightLanguages(file: file)
+ } catch {
+ os_log(.error, log: self.log, "Unable to parse %{public}@: %{public}@", file.path, error.localizedDescription)
return [:]
}
- return (try? type(of: self).parseHighlightLanguages(file: file)) ?? [:]
}()
func reloadSettings() {
diff --git a/SyntaxHighlightRenderXPC/languages.json b/SyntaxHighlightRenderXPC/languages.json
index 3470ece5..13f543f9 100644
--- a/SyntaxHighlightRenderXPC/languages.json
+++ b/SyntaxHighlightRenderXPC/languages.json
@@ -35,6 +35,7 @@
"Backus-Naur Form": ["bnf"],
"Boo": ["boo"],
"C and C++": ["c", "c++", "cc", "cpp", "cu", "cxx", "h", "hh", "hpp", "hxx"],
+ "Carbon": ["carbon"],
"Ceylon": ["ceylon"],
"Charmm": ["charmm", "inp"],
"CHILL": ["chill", "chl"],
@@ -49,12 +50,16 @@
"Coffeescript": ["coffeescript"],
"ColdFusion MX": ["coldfusion", "cfc", "cfm"],
"Generic config files": ["conf", "anacrontab"],
+ "Cpp2": ["cpp2"],
+ "CriticMarkup": ["critic"],
"Crack": ["crk"],
"Crystal": ["crystal", "cr"],
"Coffeescript Block Regex": ["cs_block_regex"],
"CriticMarkup": ["critic"],
"C#": ["csharp", "cs"],
+ "C# Unity": ["csharp_unity"],
"CSS": ["css"],
+ "CUE": ["cue"],
"D": ["d"],
"Dart": ["dart"],
"delphi": ["delphi", "dpr pas"],
@@ -66,6 +71,7 @@
"EBNF2": ["ebnf2"],
"Eiffel": ["eiffel", "e", "se"],
"Elixir": ["elixir", "ex", "exs"],
+ "Elm": ["elm"],
"E-Mail treated as Markup": ["email"],
"ERB Templates": ["erb"],
"Erlang": ["erlang", "erl", "hrl"],
@@ -73,8 +79,10 @@
"EXAPUNKS": ["exapunks", "exa", "exapunks"],
"Excel Formulas": ["excel"],
"Express": ["express", "exp"],
+ "Factor": ["factor"],
"FAME": ["fame", "fame"],
"fasm": ["fasm", "inc"],
+ "OpenType Feature File": ["fea"],
"Felix": ["felix", "flx"],
"Fish": ["fish"],
"Fortran 77": ["fortran77", "f", "for", "ftn"],
@@ -86,6 +94,7 @@
"Gambas": ["gambas", "class"],
"gdb": ["gdb"],
"GDScript": ["gdscript", "gd"],
+ "Gleam": ["gleam"],
"Go": ["go"],
"Graphviz": ["graphviz", "dot"],
"Haml (HTML Abstraction Markup Language)": ["haml"],
@@ -100,11 +109,13 @@
"IDL": ["idl"],
"Interactive Data Language": ["idlang"],
"Lua (for LuaTeX)": ["inc_luatex"],
+ "Svelte template block (nested in svelte.lang)": ["inc_svelteblock"],
"Informix": ["informix", "4gl"],
"INI": ["ini", "desktop", "doxyfile", "kdev3"],
"Inno Setup": ["innosetup", "iss"],
"INTERLIS": ["interlis", "ili"],
"IO": ["io"],
+ "Jam": ["jam", "ham", "jam"],
"Jasmin": ["jasmin", "j"],
"Java": ["java", "gradle", "groovy", "grv", "jenkinsfile"],
"Javascript": ["javascript"],
@@ -113,6 +124,7 @@
"JavaServer Pages": ["jsp"],
"JSX": ["jsx"],
"Julia": ["julia", "jl"],
+ "KDL": ["kdl"],
"Kotlin": ["kotlin", "kt"],
"LDAP": ["ldif"],
"LESS": ["less"],
@@ -120,7 +132,7 @@
"Lilypond": ["lilypond", "ly"],
"Limbo": ["limbo", "b"],
"Linden Script": ["lindenscript", "lsl"],
- "Lisp": ["lisp", "cl", "clisp", "el", "fas", "lsp", "sbcl", "scm", "scom"],
+ "Lisp": ["lisp", "cl", "clisp", "el", "fas", "lsp", "sbcl", "scm", "scom", "ss", "sls", "sps", "sld", "sch","rkt"],
"Logtalk": ["logtalk", "lgt"],
"Lotos": ["lotos"],
"Lotus": ["lotus", "ls"],
@@ -133,16 +145,18 @@
"Maya": ["maya", "mel"],
"Mercury": ["mercury"],
"Meson": ["meson"],
+ "MiniScript": ["ms"],
"Miranda": ["miranda"],
"Modula2": ["mod2", "def", "mod"],
"Modula3": ["mod3", "i3", "m3"],
"Modelica": ["modelica", "mo"],
+ "Mojo": ["mojo"],
"MoonScript": ["moon"],
"MaxScript": ["ms"],
"mIRC Scripting": ["msl", "nbs"],
"MSSQL": ["mssql"],
"Magic eXtensible Markup": ["mxml"],
- "N-Triples, Turtle, SPARQL": ["nt", "ttl"],
+ "Notation3 (N3), N-Triples, Turtle, SPARQL": ["n3", "nt", "ttl"],
"Nasal": ["nasal", "nas"],
"NeXT Byte Codes": ["nbc"],
"Nemerle": ["nemerle", "n"],
@@ -165,7 +179,7 @@
"Pascal": ["pas"],
"Portable Document Format": ["pdf"],
"Perl": ["perl", "cgi", "perl", "pl", "plex", "plx", "pm"],
- "PHP": ["php", "php3", "php4", "php5", "php6"],
+ "PHP": ["php", "php3", "php4", "php5", "php6", "php7", "phps", "phpt"],
"Pike": ["pike", "pmod"],
"PL/1": ["pl1", "bdy", "ff", "fp", "fpp", "rpp", "sf", "sp", "spb", "spe", "spp", "sps", "wf", "wp", "wpb", "wpp", "wps"],
"PL/Perl": ["plperl"],
@@ -178,13 +192,13 @@
"Microsoft PowerShell": ["powershell"],
"Prolog": ["pro", "pro"],
"Progress": ["progress", "p", "w"],
- "purescript": ["purs", "pureScript"],
"PostScript": ["ps"],
"PATROL": ["psl"],
"Pure": ["pure"],
"PureBASIC": ["purebasic", "pb", "pbf", "pbi"],
+ "PureScript": ["purs", "pureScript"],
"Pyrex": ["pyrex", "pyx"],
- "Python": ["python", "py"],
+ "Python": ["python", "cpy", "gyp", "gypi", "pxd", "pxi", "py", "py3", "pyi", "pyw", "rpy", "sconstruct", "snakefile", "wscript"],
"Qore": ["q"],
"QMake Project": ["qmake"],
"QML": ["qml"],
@@ -197,8 +211,8 @@
"RPG": ["rpg"],
"RPL Programming Language": ["rpl"],
"reStructured Text": ["rst"],
- "Ruby": ["ruby", "gemfile", "pp", "rakefile", "rb", "rjs", "ruby"],
- "Rust": ["rust"],
+ "Ruby": ["appfile", "appraisals", "berksfile", "brewfile", "capfile", "cheffile", "config.ru", "deliverfile", "fastfile", "fcgi", "gemfile", "gemspec", "guardfile", "irbrc", "jbuilder", "podfile", "podspec", "pp", "prawn", "rabl", "rake", "rakefile", "rantfile", "rb", "rbx", "rjs", "ruby", "scanfile", "simplecov", "snapfile", "thor", "thorfile", "vagrantfile"],
+ "Rust": ["rust", "rs"],
"PowerPC Assembler": ["s"],
"Sequence Alignment Map (use with sam_seq.lua plug-in)": ["sam"],
"SAS": ["sas"],
@@ -206,7 +220,7 @@
"Scala": ["scala"],
"Scilab": ["scilab", "sce", "sci"],
"SASS/SCSS": ["scss"],
- "Bash": ["shellscript"],
+ "Bash": ["shellscript", "bash", "ebuild", "eclass", "sh", "zsh"],
"Slim (experimental)": ["slim"],
"SMALL": ["small", "sma"],
"Smalltalk": ["smalltalk", "gst", "sq", "st"],
@@ -219,6 +233,7 @@
"PL/SQL": ["sql"],
"Squirrel": ["squirrel", "nut"],
"Stylus": ["styl"],
+ "Svelte": ["svelte"],
"SVG": ["svg"],
"Swift": ["swift"],
"Sybase SQL": ["sybase"],
@@ -231,8 +246,9 @@
"TSX (TypeScript with React)": ["tsx"],
"TTCN3": ["ttcn3"],
"Plain text": ["txt", "text"],
- "TypeScript": ["typescript"],
+ "TypeScript": ["typescript", "ts"],
"UPC (and C, technically)": ["upc"],
+ "V": ["v"],
"Vala": ["vala"],
"Visual Basic": ["vb", "bas", "basic", "bi", "vbs"],
"Verilog": ["verilog", "v"],
@@ -245,8 +261,8 @@
"XML": ["xml", "csproj", "dtd", "ecf", "ent", "glade", "hdr", "hub", "jnlp", "nrm", "resx", "sgm", "sgml", "tld", "vxml", "wml", "xsd", "xsl"],
"SuperX++": ["xpp"],
"Yaiff": ["yaiff"],
- "Ansible YAML": ["yaml", "yml"],
- "Jam": ["jam", "ham"],
+ "Generic YAML": ["yaml", "yml"],
+ "Ansible YAML": ["yaml_ansible"],
"Yang": ["yang"],
"Zig": ["zig"],
"Zonnon": ["znn"]
diff --git a/TODO.md b/TODO.md
index a0ef76df..20fe9121 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,6 +1,37 @@
-# TODO
+# TODO
- [ ] When compiling `highlight` avoid the creation of the static library `.a` before the CLI otherwise it will be linked in the executable instead of the dynamic one taking up space.
-- [ ] Sometime when compiling the app the custom lua plugins are not embedded.
+- [x] Sometime when compiling the app the custom lua plugins are not embedded.
- [ ] Update the application help.
- [ ] Consider whether to incorporate both light and dark styles in the html in order to automatically adapt to the system's style. For RTF [see this link](https://eclecticlight.co/2018/12/10/rendering-rich-text-in-dark-mode/).
+
+
+# SPUNTI
+
+Nuovo qlsyntax
+
+- Usare app firmata e sandbox. Questo comporta la riscrittura delle preferenze
+- Creare un groupcontainer condiviso tra app ed estensione in cui copiare le risorse di highlight
+- Evitare l’uso di colorize.sh e usare tutto da codice nativo a meno che non venga richiesto un pre processore
+- Gestire internamente alcuni preprocessori (come le plist binarie)
+- Valutare di gestire git da codice nativo senza tool esterni. Eventualmente rimuovere supporto di hg
+- Usare più appex con codice condiviso specializzati per determinate estensioni (ad esempio app, eseguibili o per i file senza estensioni) rendendo l’uso più modulare
+
+- usare una funzione che riceva uti ed estensione e restituisca la sintassi da usare per l'evidenziazione.
+- Consentire di scegliere se l'output della quick look sia html o rtf (ottenuto dalla conversione dall'html) spiegando che rtf torna utile in certe modalità di anteprima (gallery? file info?) E valutare se il passaggio da html -> rtf sia molto peggiorativo della generazione diretta di codcie rtf
+
+Avere una vista dei file per estensione, per ogni estensione gli uti associati:
+```swift
+import UniformTypeIdentifiers
+
+let fileExtension = "jpg"
+
+let types = UTType.types(tag: fileExtension,
+ tagClass: .filenameExtension,
+ conformingTo: nil)
+
+for type in types {
+ print(type.identifier)
+}
+
+```
diff --git a/Tests/PlainSettingsTests/main.swift b/Tests/PlainSettingsTests/main.swift
new file mode 100644
index 00000000..66c66a4f
--- /dev/null
+++ b/Tests/PlainSettingsTests/main.swift
@@ -0,0 +1,35 @@
+import Foundation
+
+private func expect(_ condition: @autoclosure () -> Bool, _ message: String) {
+ guard condition() else {
+ FileHandle.standardError.write(Data("FAIL: \(message)\n".utf8))
+ exit(1)
+ }
+}
+
+let shellScriptRule = PlainSettings(
+ patternFile: ".*",
+ patternMime: "^text/x-shellscript$",
+ isRegExp: true,
+ isCaseInsensitive: true,
+ UTI: "public.shell-script",
+ syntax: "shellscript"
+)
+
+expect(
+ shellScriptRule.test(filename: "hproxy", mimeType: "text/x-shellscript"),
+ "MIME regex should use the complete MIME value for short filenames"
+)
+expect(
+ shellScriptRule.test(
+ filename: String(repeating: "extensionless-shell-script-", count: 4),
+ mimeType: "text/x-shellscript"
+ ),
+ "MIME regex should not use an out-of-bounds filename-derived range"
+)
+expect(
+ !shellScriptRule.test(filename: "script", mimeType: "text/x-python"),
+ "MIME regex should reject a different MIME type"
+)
+
+print("PlainSettingsTests passed")
diff --git a/Tests/PlainSettingsTests/run.sh b/Tests/PlainSettingsTests/run.sh
new file mode 100755
index 00000000..2d98bdc5
--- /dev/null
+++ b/Tests/PlainSettingsTests/run.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -eu
+
+script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+repo_root=$(dirname "$(dirname "$script_dir")")
+test_binary=$(mktemp "${TMPDIR:-/tmp}/PlainSettingsTests.XXXXXX")
+trap 'rm -f "$test_binary"' EXIT
+
+xcrun swiftc \
+ "$repo_root/XPCService/PlainSettings.swift" \
+ "$script_dir/main.swift" \
+ -o "$test_binary"
+"$test_binary"
diff --git a/XPCService/Info.plist b/XPCService/Info.plist
index 3d2b9616..0fbcd2ad 100644
--- a/XPCService/Info.plist
+++ b/XPCService/Info.plist
@@ -19,7 +19,7 @@
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright
- Developed by SBAREX (2019-2024).
+ Developed by SBAREX (2019-2026).
XPCService
ServiceType
diff --git a/XPCService/PlainSettings.swift b/XPCService/PlainSettings.swift
index 03619846..1021a98e 100644
--- a/XPCService/PlainSettings.swift
+++ b/XPCService/PlainSettings.swift
@@ -85,7 +85,7 @@ struct PlainSettings {
guard let regex = self.mimeRegExp else {
return false
}
- guard regex.firstMatch(in: mimeType, options: [], range: NSRange(filename.startIndex..., in: filename)) != nil else {
+ guard regex.firstMatch(in: mimeType, options: [], range: NSRange(mimeType.startIndex..., in: mimeType)) != nil else {
return false
}
valid = true
diff --git a/XPCService/SCSHTheme.swift b/XPCService/SCSHTheme.swift
index 30577d87..4af62938 100644
--- a/XPCService/SCSHTheme.swift
+++ b/XPCService/SCSHTheme.swift
@@ -96,6 +96,8 @@ public class SCSHTheme: NSObject, Sequence {
case lspRegexp
case lspOperator
+ case indentGuide
+
case keyword(index: Int)
public static var allCases: [PropertyName] {
@@ -130,6 +132,8 @@ public class SCSHTheme: NSObject, Sequence {
.lspNumber,
.lspRegexp,
.lspOperator,
+
+ .indentGuide,
.keyword(index: 0),
.keyword(index: 1),
@@ -185,6 +189,8 @@ public class SCSHTheme: NSObject, Sequence {
case .lineNum: return "Line number"
case .operator: return "Operator"
case .interpolation: return "Interpolation"
+
+ case .indentGuide: return "IndentGuide"
case .keyword(let index): return "Keyword \(index+1)"
@@ -226,6 +232,8 @@ public class SCSHTheme: NSObject, Sequence {
case .lspError: return "Error"
case .lspErrorMessage: return "ErrorMessage"
+ case .indentGuide: return "IndentGuide"
+
case .keyword(let index): return "Keyword \(index+1)"
case .lspType: return "type"
@@ -262,6 +270,9 @@ public class SCSHTheme: NSObject, Sequence {
case .interpolation:
return ["hl", "ipl"]
+ case .indentGuide:
+ return ["hl", "gui"]
+
case .keyword(let index):
return ["hl", "kw" + String(UnicodeScalar(UInt8(97 + index)))]
@@ -311,6 +322,9 @@ public class SCSHTheme: NSObject, Sequence {
case "ipl":
self = .interpolation
+ case "gui":
+ self = .indentGuide
+
case "sta":
self = .lspType
case "stb":
@@ -889,6 +903,9 @@ public class SCSHTheme: NSObject, Sequence {
return self.operatorProp
case .interpolation:
return self.interpolation
+
+ case .indentGuide:
+ return self.indentGuide
case .lspHover:
return self.lspHover
@@ -945,6 +962,8 @@ public class SCSHTheme: NSObject, Sequence {
let operatorProp: Property
let interpolation: Property
+ let indentGuide: CanvasProperty?
+
let lspHover: Property
let lspError: Property
let lspErrorMessage: Property
@@ -983,7 +1002,7 @@ public class SCSHTheme: NSObject, Sequence {
}
}
- public init(name: String, desc: String, categories: Set, plain: Property, canvas: CanvasProperty, number: Property, string: Property, escape: Property, preProcessor: Property, stringPreProc: Property, blockComment: Property, lineComment: Property, lineNum: Property, operatorProp: Property, interpolation: Property, hover: Property, error: Property, errorMessage: Property, lspType: Property, lspClass: Property, lspStruct: Property, lspInterface: Property, lspParameter: Property, lspVariable: Property, lspEnumMember: Property, lspFunction: Property, lspMethod: Property, lspKeyword: Property, lspNumber: Property, lspRegexp: Property, lspOperator: Property, keywords: [Property]) {
+ public init(name: String, desc: String, categories: Set, plain: Property, canvas: CanvasProperty, number: Property, string: Property, escape: Property, preProcessor: Property, stringPreProc: Property, blockComment: Property, lineComment: Property, lineNum: Property, operatorProp: Property, interpolation: Property, hover: Property, error: Property, errorMessage: Property, lspType: Property, lspClass: Property, lspStruct: Property, lspInterface: Property, lspParameter: Property, lspVariable: Property, lspEnumMember: Property, lspFunction: Property, lspMethod: Property, lspKeyword: Property, lspNumber: Property, lspRegexp: Property, lspOperator: Property, keywords: [Property], indentGuide: CanvasProperty? = nil) {
self.name = name
self.desc = desc
self.categories = categories
@@ -1001,6 +1020,8 @@ public class SCSHTheme: NSObject, Sequence {
self.operatorProp = operatorProp
self.interpolation = interpolation
+ self.indentGuide = indentGuide
+
self.lspHover = hover
self.lspError = error
self.lspErrorMessage = errorMessage
@@ -1036,6 +1057,8 @@ public class SCSHTheme: NSObject, Sequence {
self.operatorProp.theme = self
self.interpolation.theme = self
+ self.indentGuide?.theme = self
+
self.lspHover.theme = self
self.lspError.theme = self
self.lspErrorMessage.theme = self
@@ -1059,7 +1082,7 @@ public class SCSHTheme: NSObject, Sequence {
}
convenience public init(name: String) {
- self.init(name: name, desc: "", categories: ["light"], plain: Property(color: "#000000"), canvas: CanvasProperty(color: "#ffffff"), number: Property(), string: Property(), escape: Property(), preProcessor: Property(), stringPreProc: Property(), blockComment: Property(), lineComment: Property(), lineNum: Property(), operatorProp: Property(), interpolation: Property(), hover: Property(), error: Property(), errorMessage: Property(), lspType: Property(), lspClass: Property(), lspStruct: Property(), lspInterface: Property(), lspParameter: Property(), lspVariable: Property(), lspEnumMember: Property(), lspFunction: Property(), lspMethod: Property(), lspKeyword: Property(), lspNumber: Property(), lspRegexp: Property(), lspOperator: Property(), keywords: [])
+ self.init(name: name, desc: "", categories: ["light"], plain: Property(color: "#000000"), canvas: CanvasProperty(color: "#ffffff"), number: Property(), string: Property(), escape: Property(), preProcessor: Property(), stringPreProc: Property(), blockComment: Property(), lineComment: Property(), lineNum: Property(), operatorProp: Property(), interpolation: Property(), hover: Property(), error: Property(), errorMessage: Property(), lspType: Property(), lspClass: Property(), lspStruct: Property(), lspInterface: Property(), lspParameter: Property(), lspVariable: Property(), lspEnumMember: Property(), lspFunction: Property(), lspMethod: Property(), lspKeyword: Property(), lspNumber: Property(), lspRegexp: Property(), lspOperator: Property(), keywords: [], indentGuide: nil)
}
convenience public init?(dict dictionary: [String: Any]?) {
@@ -1107,6 +1130,8 @@ public class SCSHTheme: NSObject, Sequence {
return nil
}
+ let indentGuide = CanvasProperty(dict: dict[PropertyName.indentGuide.name] as? [String: Any])
+
guard let lspHover = Property(dict: dict[PropertyName.lspHover.name] as? [String: Any]) else {
return nil
}
@@ -1166,7 +1191,7 @@ public class SCSHTheme: NSObject, Sequence {
}
}
- self.init(name: name, desc: desc, categories: categories, plain: plain, canvas: canvas, number: number, string: string, escape: escape, preProcessor: preProcessor, stringPreProc: stringPreProc, blockComment: blockComment, lineComment: lineComment, lineNum: lineNum, operatorProp: operatorProp, interpolation: interpolation, hover: lspHover, error: lspError, errorMessage: lspErrorMessage, lspType: lspType, lspClass: lspClass, lspStruct: lspStruct, lspInterface: lspInterface, lspParameter: lspParameter, lspVariable: lspVariable, lspEnumMember: lspEnumMember, lspFunction: lspFunction, lspMethod: lspMethod, lspKeyword: lspKeyword, lspNumber: lspNumber, lspRegexp: lspRegexp, lspOperator: lspOperator, keywords: keywords)
+ self.init(name: name, desc: desc, categories: categories, plain: plain, canvas: canvas, number: number, string: string, escape: escape, preProcessor: preProcessor, stringPreProc: stringPreProc, blockComment: blockComment, lineComment: lineComment, lineNum: lineNum, operatorProp: operatorProp, interpolation: interpolation, hover: lspHover, error: lspError, errorMessage: lspErrorMessage, lspType: lspType, lspClass: lspClass, lspStruct: lspStruct, lspInterface: lspInterface, lspParameter: lspParameter, lspVariable: lspVariable, lspEnumMember: lspEnumMember, lspFunction: lspFunction, lspMethod: lspMethod, lspKeyword: lspKeyword, lspNumber: lspNumber, lspRegexp: lspRegexp, lspOperator: lspOperator, keywords: keywords, indentGuide: indentGuide)
self.path = dict["path"] as? String ?? ""
self.isDirty = false
@@ -1176,7 +1201,7 @@ public class SCSHTheme: NSObject, Sequence {
}
public func toDictionary() -> [String: AnyHashable] {
- let dict: [String: AnyHashable] = [
+ var dict: [String: AnyHashable] = [
"name": name,
"desc": desc,
"categories": categories,
@@ -1217,6 +1242,10 @@ public class SCSHTheme: NSObject, Sequence {
"standalone": isStandalone,
]
+ if let indentGuide {
+ dict[PropertyName.indentGuide.name] = indentGuide.toDictionary()
+ }
+
return dict
}
@@ -1269,6 +1298,10 @@ public class SCSHTheme: NSObject, Sequence {
s += PropertyName.operator.luaName + " = " + operatorProp.output() + "\n"
s += PropertyName.interpolation.luaName + " = " + interpolation.output() + "\n"
+ if let indentGuide {
+ s += PropertyName.indentGuide.luaName + " = " + indentGuide.output() + "\n"
+ }
+
s += PropertyName.lspHover.luaName + " = " + lspHover.output() + "\n"
s += PropertyName.lspError.luaName + " = " + lspError.output() + "\n"
s += PropertyName.lspErrorMessage.luaName + " = " + lspErrorMessage.output() + "\n"
@@ -1320,6 +1353,10 @@ public class SCSHTheme: NSObject, Sequence {
css += formatPropertyCss(.operator, self.operatorProp)
css += formatPropertyCss(.interpolation, self.interpolation)
+ if let indentGuide {
+ css += formatPropertyCss(.indentGuide, indentGuide)
+ }
+
for (i, keyword) in self.keywords.enumerated() {
css += formatPropertyCss(.keyword(index: i), keyword)
}
diff --git a/XPCService/Settings+Service.swift b/XPCService/Settings+Service.swift
index 6ae64208..dce1dafc 100644
--- a/XPCService/Settings+Service.swift
+++ b/XPCService/Settings+Service.swift
@@ -93,36 +93,64 @@ extension Settings: SettingsCSS {
self.isAllSpecialSettingsPopulated = true
// Process files on bundle the application support folder.
- if let p = serviceBundle.url(forResource: "settings", withExtension: "yaml"), let data = try? String(contentsOf: p) {
+ var enc: String.Encoding = .utf8
+ if let p = serviceBundle.url(forResource: "settings", withExtension: "yaml"), let data = try? String(contentsOf: p, usedEncoding: &enc) {
do {
- if let d = try Yams.load(yaml: data) as? [String: [String: [String: String]]] {
- self.specialSettings = d
+ if let raw_d = try Yams.load(yaml: data) {
+ if let d = raw_d as? [String: [String: [String: String]]] {
+ self.specialSettings = d
+ } else {
+ if #available(macOS 13.0, *) {
+ os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path(percentEncoded: false))
+ } else {
+ os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path)
+ }
+ }
}
} catch {
+ if #available(macOS 13.0, *) {
+ os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path(percentEncoded: false))
+ } else {
+ os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path)
+ }
print(error)
}
}
// Process files on support folder.
- if let p = supportFolder?.appendingPathComponent("settings.yaml"), let data = try? String(contentsOf: p) {
+ enc = .utf8
+ if let p = supportFolder?.appendingPathComponent("settings.yaml"), let data = try? String(contentsOf: p, usedEncoding: &enc) {
do {
- if let d = try Yams.load(yaml: data) as? [String: [String: [String: String]]] {
- for group in d {
- if self.specialSettings[group.key] == nil {
- self.specialSettings[group.key] = [:]
- }
- for item in group.value {
- if self.specialSettings[group.key]![item.key] == nil {
- self.specialSettings[group.key]![item.key] = item.value
- } else {
- self.specialSettings[group.key]![item.key] = self.specialSettings[group.key]![item.key]?.merging(item.value, uniquingKeysWith: { _, new in
- return new
- })
+ if let raw_d = try Yams.load(yaml: data) {
+ if let d = raw_d as? [String: [String: [String: String]]] {
+ for group in d {
+ if self.specialSettings[group.key] == nil {
+ self.specialSettings[group.key] = [:]
}
+ for item in group.value {
+ if self.specialSettings[group.key]![item.key] == nil {
+ self.specialSettings[group.key]![item.key] = item.value
+ } else {
+ self.specialSettings[group.key]![item.key] = self.specialSettings[group.key]![item.key]?.merging(item.value, uniquingKeysWith: { _, new in
+ return new
+ })
+ }
+ }
+ }
+ } else {
+ if #available(macOS 13.0, *) {
+ os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path(percentEncoded: false))
+ } else {
+ os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path)
}
}
}
} catch {
+ if #available(macOS 13.0, *) {
+ os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path(percentEncoded: false))
+ } else {
+ os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path)
+ }
print(error)
}
}
@@ -222,6 +250,8 @@ extension Settings: SettingsCSS {
updateDomains(SettingsBase.Key.tabSpaces, tabSpaces)
+ updateDomains(SettingsBase.Key.indentGuides, indentGuides)
+
updateDomains(SettingsBase.Key.extraArguments, arguments)
updateDomains(SettingsBase.Key.fontFamily, fontName)
@@ -231,6 +261,7 @@ extension Settings: SettingsCSS {
updateDomains(SettingsBase.Key.interactive, allowInteractiveActions)
updateDomains(SettingsBase.Key.convertEOL, convertEOL)
updateDomains(SettingsBase.Key.debug, isDebug)
+ updateDomains(SettingsBase.Key.about, isAboutVisible)
updateDomains(SettingsBase.Key.dumpPlain, isDumpPlainData)
updateDomains(SettingsBase.Key.vcs, isVCS)
diff --git a/XPCService/Settings.swift b/XPCService/Settings.swift
index 185988a9..e770f5c9 100644
--- a/XPCService/Settings.swift
+++ b/XPCService/Settings.swift
@@ -47,6 +47,8 @@ class SettingsBase: NSObject {
static let tabSpaces = "tab-spaces"
+ static let indentGuides = "indent-guides"
+
static let extraArguments = "extra"
static let fontFamily = "font-family"
@@ -59,6 +61,7 @@ class SettingsBase: NSObject {
static let convertEOL = "convert-EOL"
static let version = "version"
+ static let about = "about"
static let debug = "debug"
static let dumpPlain = "dump"
@@ -239,6 +242,21 @@ class SettingsBase: NSObject {
}
}
+ // MARK: Indentation guides
+
+ dynamic var isIndentGuidesDefined: Bool {
+ didSet {
+ requestRefreshOnChanged(oldValue: oldValue, newValue: isIndentGuidesDefined)
+ }
+ }
+
+ /// Show the indentation guides.
+ dynamic var indentGuides: Bool {
+ didSet {
+ requestRefreshOnChanged(oldValue: oldValue, newValue: indentGuides)
+ }
+ }
+
// MARK: CSS
dynamic var isCSSDefined: Bool {
@@ -366,7 +384,7 @@ class SettingsBase: NSObject {
var isCustomized: Bool {
get {
- let state = isFormatDefined || isLightThemeNameDefined || isDarkThemeNameDefined || isLineNumbersDefined || isWordWrapDefined || isLineLengthDefined || isTabSpacesDefined || isArgumentsDefined || isCSSDefined || isFontSizeDefined || isVCSDefined
+ let state = isFormatDefined || isLightThemeNameDefined || isDarkThemeNameDefined || isLineNumbersDefined || isWordWrapDefined || isLineLengthDefined || isTabSpacesDefined || isIndentGuidesDefined || isArgumentsDefined || isCSSDefined || isFontSizeDefined || isVCSDefined
guard !state else {
return true
@@ -419,6 +437,9 @@ class SettingsBase: NSObject {
self.tabSpaces = 4
self.isTabSpacesDefined = false
+ self.indentGuides = false
+ self.isIndentGuidesDefined = false
+
self.css = ""
self.isCSSDefined = false
@@ -518,6 +539,11 @@ class SettingsBase: NSObject {
self.isTabSpacesDefined = true
}
+ if let s = settings[Settings.Key.indentGuides] as? Bool {
+ self.indentGuides = s
+ self.isIndentGuidesDefined = true
+ }
+
if let css = settings[SettingsBase.Key.customCSS] as? String {
self.css = css
self.isCSSDefined = !css.isEmpty
@@ -612,6 +638,9 @@ class SettingsBase: NSObject {
if isTabSpacesDefined {
r[SettingsBase.Key.tabSpaces] = tabSpaces
}
+ if isIndentGuidesDefined {
+ r[Settings.Key.indentGuides] = indentGuides
+ }
if isArgumentsDefined {
r[SettingsBase.Key.extraArguments] = arguments
@@ -650,11 +679,13 @@ class SettingsBase: NSObject {
}
func isOSThemeLight() -> Bool {
- if #available(macOS 11.0, *) {
+ /*if #available(macOS 11.0, *) {
+ // Fixme: nell'estensione non sempre restituisce il valore aggiornato.
return NSAppearance.currentDrawing().bestMatch(from: [.aqua, .darkAqua]) ?? .aqua == .aqua
} else {
return (UserDefaults.standard.string(forKey: "AppleInterfaceStyle") ?? "Light") == "Light"
- }
+ }*/
+ return (UserDefaults.standard.string(forKey: "AppleInterfaceStyle") ?? "Light") == "Light"
}
func getTheme() -> ThemeBaseColor {
@@ -987,6 +1018,38 @@ class Settings: SettingsBase {
internal var plainSettings: [PlainSettings] = []
+ static let appName: String = {
+ if let info = Bundle.main.infoDictionary, let name = info["CFBundleExecutable"] as? String {
+ return name
+ } else {
+ return "Syntax Highlight"
+ }
+ }()
+
+ static let appVersion: String = {
+ if let info = Bundle.main.infoDictionary, let version = info["CFBundleShortVersionString"] as? String, let build = info["CFBundleVersion"] as? String {
+ return "\(version) [\(build)]"
+ } else {
+ return ""
+ }
+ }()
+
+ static let appCopyright: String = {
+ if let info = Bundle.main.infoDictionary, let copy = info["NSHumanReadableCopyright"] as? String {
+ return copy.trimmingCharacters(in: CharacterSet(charactersIn: ". "))
+ } else {
+ return "Developed by Sbarex"
+ }
+ }()
+
+ static let appLink = "https://github.com/sbarex/SourceCodeSyntaxHighlight"
+
+ dynamic var isAboutVisible: Bool = true {
+ didSet {
+ requestRefreshOnChanged(oldValue: oldValue, newValue: isAboutVisible)
+ }
+ }
+
dynamic var isDebug: Bool = false {
didSet {
requestRefreshOnChanged(oldValue: oldValue, newValue: isDebug)
@@ -1074,6 +1137,7 @@ class Settings: SettingsBase {
required internal init(settings: [String: AnyHashable]) {
self.version = settings[SettingsBase.Key.version] as? Float ?? Settings.version
+ self.isAboutVisible = true
self.isDebug = false
self.isVCS = false
@@ -1121,6 +1185,9 @@ class Settings: SettingsBase {
super.override(fromDictionary: dict)
+ if let v = settings[SettingsBase.Key.about] as? Bool {
+ self.isAboutVisible = v
+ }
if let v = settings[SettingsBase.Key.debug] as? Bool {
self.isDebug = v
}
@@ -1168,6 +1235,7 @@ class Settings: SettingsBase {
self.isLineLengthDefined = true
self.isLineNumbersDefined = true
self.isTabSpacesDefined = true
+ self.isIndentGuidesDefined = true
self.isArgumentsDefined = true
self.isCSSDefined = true
self.isVCSDefined = true
@@ -1189,6 +1257,7 @@ class Settings: SettingsBase {
/// Output the settings to a dictionary.
override func toDictionary(forSaving: Bool = false) -> [String: AnyHashable] {
var r = super.toDictionary(forSaving: forSaving)
+ r[SettingsBase.Key.about] = self.isAboutVisible
r[SettingsBase.Key.debug] = self.isDebug
@@ -1527,6 +1596,10 @@ class Settings: SettingsBase {
extraHLFlags.append("--replace-tabs=\(self.tabSpaces)")
}
+ if self.isIndentGuidesDefined && self.indentGuides {
+ extraHLFlags.append("--indent-guide")
+ }
+
// Font family.
if self.isFontNameDefined {
if self.fontName.isEmpty || self.fontName == "-" {
diff --git a/XPCService/TaskResult.swift b/XPCService/TaskResult.swift
index 793d6a86..5ee65206 100644
--- a/XPCService/TaskResult.swift
+++ b/XPCService/TaskResult.swift
@@ -91,7 +91,7 @@ class ShellTask {
}
let data = file.readDataToEndOfFile()
- let dataErr = file.readDataToEndOfFile()
+ let dataErr = fileErr.readDataToEndOfFile()
task.waitUntilExit()
diff --git a/XPCService/XPCServiceRelease.entitlements b/XPCService/XPCServiceRelease.entitlements
index d0fdb1d3..a25de355 100644
--- a/XPCService/XPCServiceRelease.entitlements
+++ b/XPCService/XPCServiceRelease.entitlements
@@ -2,6 +2,10 @@
+ com.apple.security.application-groups
+
+ group.org.sbarex.syntaxhighlight
+
com.apple.security.get-task-allow
com.apple.security.temporary-exception.files.home-relative-path.read-write
diff --git a/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild b/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild
new file mode 100644
index 00000000..ab527811
Binary files /dev/null and b/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild differ
diff --git a/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache b/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache
new file mode 100644
index 00000000..c5aa1cd2
Binary files /dev/null and b/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache differ
diff --git a/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64 b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64
new file mode 100755
index 00000000..d307651f
Binary files /dev/null and b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64 differ
diff --git a/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64 b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64
new file mode 100755
index 00000000..4eccd3dc
Binary files /dev/null and b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64 differ
diff --git a/dos2unix/Makefile b/dos2unix/Makefile
index 52733eec..c1c50821 100644
--- a/dos2unix/Makefile
+++ b/dos2unix/Makefile
@@ -6,10 +6,11 @@ CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR))
ifeq ($(BUILT_PRODUCTS_DIR),)
- BUILD_DIR :="${CURRENT_DIR}/build"
+ BUILD_DIR :=${CURRENT_DIR}/build
else
BUILD_DIR :=${BUILT_PRODUCTS_DIR}
endif
+BUILD_DIR_ESCAPED := $(subst $(SPACE),\ ,$(BUILD_DIR))
ifeq ($(ONLY_ACTIVE_ARCH),)
ONLY_ACTIVE_ARCH=NO
@@ -42,18 +43,18 @@ VALID_ARCHS:=x86_64 arm64
dos2unix_cli :=
ifeq ($(NATIVE_ARCH),x86_64)
- dos2unix_cli += ${BUILD_DIR}/dos2unix-x86_64
+ dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-x86_64
else
- dos2unix_cli += ${BUILD_DIR}/dos2unix-arm64
+ dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-arm64
endif
ifeq ($(ONLY_ACTIVE_ARCH),NO)
ifeq ($(NATIVE_ARCH),x86_64)
# build arm code
- dos2unix_cli += ${BUILD_DIR}/dos2unix-arm64
+ dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-arm64
else
# build intel code
- dos2unix_cli += ${BUILD_DIR}/dos2unix-x86_64
+ dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-x86_64
endif
endif
@@ -69,52 +70,60 @@ else
endif
@echo ""
-#dos2unix_arm: ${BUILD_DIR}/arm/dos2unix
-#dos2unix_intel: ${BUILD_DIR}/intel/dos2unix
-cli: ${BUILD_DIR}/dos2unix
+#dos2unix_arm: ${BUILD_DIR_ESCAPED}/arm/dos2unix
+#dos2unix_intel: ${BUILD_DIR_ESCAPED}/intel/dos2unix
+cli: ${BUILD_DIR_ESCAPED}/dos2unix
-install: ${BUILD_DIR}/dos2unix
+install: ${BUILD_DIR_ESCAPED}/dos2unix
clean_dos2unix:
@echo "${bold}Cleaning dos2unix...${normal}"
${MAKE} -e "Makefile" clean
@echo ""
-${BUILD_DIR}/dos2unix-arm64: | $(BUILD_DIR)
- @echo "${bold}Building dos2unix for arm64 platform...${normal}"
+$(BUILD_DIR_ESCAPED)/dos2unix-arm64: | $(BUILD_DIR_ESCAPED)
+ @echo "${bold}Building dos2unix for arm64 platform...${normal} to \"$@\""
@#${MAKE} -e "Makefile" clean
${MAKE} BUILD_DIR="build-arm-$(CONFIGURATION)" ENABLE_NLS= CC="gcc -std=gnu99 -target arm64-apple-macos11" CFLAGS="$(CFLAGS_arm64)" LDFLAGS="$(LDFLAGS_arm64)" -f "$(CURRENT_DIR)/build.makefile"
- cp "build-arm-$(CONFIGURATION)/dos2unix" $@
+ cp "build-arm-$(CONFIGURATION)/dos2unix" "$@"
@echo "${bold}... OK${normal}"
@echo ""
-${BUILD_DIR}/dos2unix-x86_64: | $(BUILD_DIR)
- @echo "${bold}Building dos2unix for intel platform...${normal}"
+${BUILD_DIR_ESCAPED}/dos2unix-x86_64: | $(BUILD_DIR_ESCAPED)
+ @echo "${bold}Building dos2unix for intel platform...${normal} to \"$@\""
@#${MAKE} -e "Makefile" clean
${MAKE} BUILD_DIR="build-intel-$(CONFIGURATION)" ENABLE_NLS= CFLAGS="$(CFLAGS_x86_64)" LDFLAGS="$(LDFLAGS_x86_64)" -f "$(CURRENT_DIR)/build.makefile"
- cp "build-intel-$(CONFIGURATION)/dos2unix" $@
+ cp "build-intel-$(CONFIGURATION)/dos2unix" "$@"
@echo "${bold}... OK${normal}"
@echo ""
-${BUILD_DIR}/dos2unix: $(BUILD_DIR) ${dos2unix_cli}
+${BUILD_DIR_ESCAPED}/dos2unix: ${dos2unix_cli} | $(BUILD_DIR_ESCAPED)
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @#echo $(dos2unix_cli)
+ @#echo "$(dos2unix_cli)"
@echo "${bold}Creating universal dos2unix...${normal}"
- lipo -create -output $@ "${BUILD_DIR}/dos2unix-x86_64" "${BUILD_DIR}/dos2unix-arm64"
+ lipo -create -output "$@" ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 ${BUILD_DIR_ESCAPED}/dos2unix-arm64
else
@echo "${bold}Creating dos2unix for ${NATIVE_ARCH}...${normal}"
@rm -f $@ > /dev/null
ifeq ($(NATIVE_ARCH),x86_64)
- ln -f "${BUILD_DIR}/dos2unix-x86_64" $@
+ ln -f ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 "$@"
else
- ln -f "${BUILD_DIR}/dos2unix-arm64" $@
+ ln -f ${BUILD_DIR_ESCAPED}/dos2unix-arm64 "$@"
endif
endif
@echo "${bold}... OK${normal}"
+ @echo "Code signing the dos2unix app"
+ /usr/bin/codesign --force --deep --sign "$(CODE_SIGN_IDENTITY)" \
+ --options runtime \
+ --entitlements $(CURRENT_DIR)/entitlements.entitlements \
+ ${OTHER_CODE_SIGN_FLAGS} \
+ "$@"
+ @echo ""
-$(BUILD_DIR):
- @echo "Current dir: $(CURRENT_DIR)."
+$(BUILD_DIR_ESCAPED):
+ @echo "Current dir: $(CURRENT_DIR)"
+ @echo "Build dir: $(BUILD_DIR_ESCAPED)"
- @echo "Creating build dir $(BUILD_DIR) ..."
- mkdir -p $(BUILD_DIR)
+ @echo "Creating build dir \"$(BUILD_DIR)\" ..."
+ mkdir -p "$(BUILD_DIR)"
@echo ""
diff --git a/dos2unix/dos2unix.xcodeproj/project.pbxproj b/dos2unix/dos2unix.xcodeproj/project.pbxproj
index 403491e1..caeeaac5 100644
--- a/dos2unix/dos2unix.xcodeproj/project.pbxproj
+++ b/dos2unix/dos2unix.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 50;
+ objectVersion = 54;
objects = {
/* Begin PBXFileReference section */
@@ -83,7 +83,7 @@
/* Begin PBXLegacyTarget section */
83257FD82638126E00A8888F /* dos2unix */ = {
isa = PBXLegacyTarget;
- buildArgumentsString = "$(ACTION)";
+ buildArgumentsString = "";
buildConfigurationList = 83257FF82638126E00A8888F /* Build configuration list for PBXLegacyTarget "dos2unix" */;
buildPhases = (
);
@@ -101,7 +101,8 @@
83257FD42638126E00A8888F /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1250;
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 2700;
};
buildConfigurationList = 83257FD72638126E00A8888F /* Build configuration list for PBXProject "dos2unix" */;
compatibilityVersion = "Xcode 9.3";
@@ -143,8 +144,10 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -153,6 +156,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
};
name = Debug;
};
@@ -178,7 +182,9 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -186,6 +192,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
};
name = Release;
};
@@ -194,6 +201,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@@ -209,6 +217,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
diff --git a/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme b/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme
index 65eda9b7..eff09828 100644
--- a/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme
+++ b/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme
@@ -1,6 +1,6 @@
+
+
+
+ com.apple.security.app-sandbox
+
+
+
diff --git a/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild b/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild
new file mode 100644
index 00000000..ab527811
Binary files /dev/null and b/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild differ
diff --git a/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache b/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache
new file mode 100644
index 00000000..c5aa1cd2
Binary files /dev/null and b/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache differ
diff --git a/highlight-wrapper/Makefile b/highlight-wrapper/Makefile
index 01b780b3..4b1a578f 100644
--- a/highlight-wrapper/Makefile
+++ b/highlight-wrapper/Makefile
@@ -17,24 +17,28 @@ ifeq ($(ONLY_ACTIVE_ARCH),)
endif
BUILD_DIR := $(BUILD_DIR)/highlight
+BUILD_DIR_ESCAPED := $(subst $(SPACE),\ ,$(BUILD_DIR))
+CURRENT_DIR_ESCAPED := $(subst $(SPACE),\ ,$(CURRENT_DIR))
CXX=clang++
-CFLAGS=-Wall -std=c++11 -D_FILE_OFFSET_BITS=64 \
- -I "${CURRENT_DIR}/${HIGHLIGHT_DIR}/src/include" \
- -I "${CURRENT_DIR}/${LUA_DIR}/src" \
- -I "${CURRENT_DIR}" \
- -I "${BUILD_DIR}"
-LDFLAGS="-L${BUILD_DIR}"
-
-CFLAGS_x86_64=-target x86_64-apple-macos10.15
-CFLAGS_arm64=-target arm64-apple-macos11
+CFLAGS= \
+ -I ${CURRENT_DIR_ESCAPED}/${HIGHLIGHT_DIR}/src/include \
+ -I ${CURRENT_DIR_ESCAPED}/${LUA_DIR}/src \
+ -I ${CURRENT_DIR_ESCAPED} \
+ -I ${BUILD_DIR_ESCAPED} \
+ -Wno-deprecated-declarations -Wno-unknown-pragmas
+CXXFLAGS += -std=c++17
+LDFLAGS=-L${BUILD_DIR_ESCAPED}
+
+CFLAGS_x86_64=-target x86_64-apple-macos12.0
+CFLAGS_arm64=-target arm64-apple-macos12.0
# ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/.*),)
# CFLAGS_x86_64+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
# endif
-LDFLAGS_x86_64=-target x86_64-apple-macos10.15
-LDFLAGS_arm64=-target arm64-apple-macos11
+LDFLAGS_x86_64=-target x86_64-apple-macos12.0
+LDFLAGS_arm64=-target arm64-apple-macos12.0
ifeq ($(CONFIGURATION),Debug)
CFLAGS_x86_64+= -g
@@ -63,46 +67,46 @@ wrapper_lib_static =
lua_libraries =
ifeq ($(NATIVE_ARCH),x86_64)
- lua_libraries += ${BUILD_DIR}/liblua-x86_64.a
+ lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-x86_64.a
- highlight_lib_static += ${BUILD_DIR}/libhighlight-x86_64.a
- highlight_lib_shared += ${BUILD_DIR}/libhighlight-x86_64.dylib
- highlight_cli += ${BUILD_DIR}/highlight-x86_64
+ highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a
+ highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib
+ highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-x86_64
- wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib
- wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-x86_64.a
+ wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib
+ wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.a
else
- lua_libraries += ${BUILD_DIR}/liblua-arm64.a
+ lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-arm64.a
- highlight_lib_static += ${BUILD_DIR}/libhighlight-arm64.a
- highlight_lib_shared += ${BUILD_DIR}/libhighlight-arm64.dylib
- highlight_cli += ${BUILD_DIR}/highlight-arm64
+ highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a
+ highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib
+ highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-arm64
- wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-arm64.dylib
- wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-arm64.a
+ wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib
+ wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.a
endif
ifeq ($(ONLY_ACTIVE_ARCH),NO)
ifeq ($(NATIVE_ARCH),x86_64)
# build arm code
- lua_libraries += ${BUILD_DIR}/liblua-arm64.a
+ lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-arm64.a
- highlight_lib_static += ${BUILD_DIR}/libhighlight-arm64.a
- highlight_lib_shared += ${BUILD_DIR}/libhighlight-arm64.dylib
- highlight_cli += ${BUILD_DIR}/highlight-arm64
+ highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a
+ highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib
+ highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-arm64
- wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-arm64.dylib
- wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-arm64.a
+ wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib
+ wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.a
else
# build intel code
- lua_libraries += ${BUILD_DIR}/liblua-x86_64.a
+ lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-x86_64.a
- highlight_lib_static += ${BUILD_DIR}/libhighlight-x86_64.a
- highlight_lib_shared += ${BUILD_DIR}/libhighlight-x86_64.dylib
- highlight_cli += ${BUILD_DIR}/highlight-x86_64
+ highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a
+ highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib
+ highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-x86_64
- wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib
- wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-x86_64.a
+ wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib
+ wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.a
endif
endif
@@ -112,53 +116,54 @@ ifeq ($(filter $(NATIVE_ARCH),$(VALID_ARCHS)),)
$(error "Current arch ${NATIVE_ARCH} is not supported! Valid archs are: ${VALID_ARCHS}.")
endif
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Building universal binary...${normal}"
+ @echo "\n${bold}** BUILDING UNIVERSAL BINARY... ** ${normal}"
else
- @echo "${bold}Building $(NATIVE_ARCH) architecture...${normal}"
+ @echo "\n${bold}** BUILDING $(NATIVE_ARCH) ARCHITECTURE... ** ${normal}"
endif
- @echo "Build dir: $(BUILD_DIR)"
+ @echo "Build dir: $(BUILD_DIR_ESCAPED)"
@echo ""
build_dir:
$(shell mkdir build 2> /dev/null)
+
# ################################
# LUA library
# ################################
-lua_arm: ${BUILD_DIR}/liblua-arm64.a
-lua_intel: ${BUILD_DIR}/liblua-x86_64.a
-lua: ${BUILD_DIR}/liblua.a
+lua_arm: ${BUILD_DIR_ESCAPED}/liblua-arm64.a
+lua_intel: ${BUILD_DIR_ESCAPED}/liblua-x86_64.a
+lua: ${BUILD_DIR_ESCAPED}/liblua.a
clean_lua:
- @echo "${bold}Cleaning lua...${normal}"
- ${MAKE} -C ${LUA_DIR} clean
+ @echo "\n${bold}🗑️ CLEANING lua...${normal}"
+ ${MAKE} -C "${LUA_DIR}" clean
@echo ""
-${BUILD_DIR}/liblua-arm64.a: | $(BUILD_DIR)
- @echo "${bold}Building lua for arm64 platform…${normal}"
+${BUILD_DIR_ESCAPED}/liblua-arm64.a: | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING lua FOR arm64 PLATFORM...${normal}"
${MAKE} -C "${LUA_DIR}" clean
- ${MAKE} CC="gcc -std=gnu99 -target arm64-apple-macos11" MYCFLAGS="$(CFLAGS_arm64)" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${LUA_DIR}"
+ ${MAKE} CC="gcc -std=gnu99 -target arm64-apple-macos12.0" MYCFLAGS="$(CFLAGS_arm64)" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${LUA_DIR}"
@mkdir -p "${BUILD_DIR}"
- mv "${LUA_DIR}/src/liblua.a" "${BUILD_DIR}/liblua-arm64.a"
+ mv "${LUA_DIR}/src/liblua.a" "$@"
@echo ""
-${BUILD_DIR}/liblua-x86_64.a: | $(BUILD_DIR)
- @echo "${bold}Building lua for x86_64 platform…${normal}"
+${BUILD_DIR_ESCAPED}/liblua-x86_64.a: | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING lua FOR x86_64 PLATFORM...${normal}"
${MAKE} -C "${LUA_DIR}" clean
${MAKE} MYCFLAGS="$(CFLAGS_x86_64)" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${LUA_DIR}"
@mkdir -p "${BUILD_DIR}"
- mv "${LUA_DIR}/src/liblua.a" "${BUILD_DIR}/liblua-x86_64.a"
+ mv "${LUA_DIR}/src/liblua.a" "$@"
@echo ""
-${BUILD_DIR}/liblua.a: $(BUILD_DIR) ${lua_libraries}
+${BUILD_DIR_ESCAPED}/liblua.a: $(BUILD_DIR_ESCAPED) ${lua_libraries}
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Creating lua universal library...${normal}"
- lipo -create -output "${BUILD_DIR}/liblua.a" "${BUILD_DIR}/liblua-x86_64.a" "${BUILD_DIR}/liblua-arm64.a"
+ @echo "\n${bold}CREATING lua UNIVERSAL LIBRARY...${normal}"
+ lipo -create -output "$@" ${BUILD_DIR_ESCAPED}/liblua-x86_64.a ${BUILD_DIR_ESCAPED}/liblua-arm64.a
else
- @echo "${bold}Creating lua library for ${NATIVE_ARCH}...${normal}"
- @rm -f "${BUILD_DIR}/liblua.a" > /dev/null
- ln "${BUILD_DIR}/liblua-${NATIVE_ARCH}.a" "${BUILD_DIR}/liblua.a"
+ @echo "\n${bold}CREATING lua LIBRARY FOR ${NATIVE_ARCH} PLATFORM...${normal}"
+ @rm -f "$@" > /dev/null
+ ln "${BUILD_DIR}/liblua-${NATIVE_ARCH}.a" "$@"
endif
@echo ""
@@ -168,110 +173,232 @@ endif
# Highlight library
# ################################
-highlight_static: ${BUILD_DIR}/libhighlight.a
-highlight_shared: ${BUILD_DIR}/libhighlight.dylib
-highlight_cli: ${BUILD_DIR}/highlight ${BUILD_DIR}/share
+highlight_static: ${BUILD_DIR_ESCAPED}/libhighlight.a
+highlight_shared: ${BUILD_DIR_ESCAPED}/libhighlight.dylib
+highlight_cli: highlight_shared ${BUILD_DIR_ESCAPED}/highlight ${BUILD_DIR_ESCAPED}/share
-${BUILD_DIR}/libhighlight-arm64.a: | $(BUILD_DIR) lua
- @echo "${bold}Building static highlight lib for arm64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/libhighlight-arm64.a: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight STATIC LIB FOR arm64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I$(CURRENT_DIR)/" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-static
- cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/libhighlight.a" "${BUILD_DIR}/libhighlight-arm64.a"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR=${BUILD_DIR_ESCAPED}/build_arm64-$(CONFIGURATION) \
+ LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ lib-static install-lib-static
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/libhighlight-arm64.dylib: | $(BUILD_DIR) lua
- @echo "${bold}Building shared highlight lib for arm64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight SHARED LIB FOR arm64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-shared
- cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/libhighlight.dylib" "${BUILD_DIR}/libhighlight-arm64.dylib"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR="$(BUILD_DIR)/build_arm64-$(CONFIGURATION)" \
+ LUA_CFLAGS="-I$(CURRENT_DIR_ESCAPED)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \
+ -C "${HIGHLIGHT_DIR}" \
+ -f makefile2.makefile \
+ lib-shared install-lib-shared
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/highlight-arm64: | $(BUILD_DIR) lua
- @echo "${bold}Building highlight for arm64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/highlight-arm64: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight FOR arm64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" LUA_LIBS="-L$(BUILD_DIR) -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I$(CURRENT_DIR)/" MYLDFLAGS="$(LDFLAGS_arm64)" -C ${HIGHLIGHT_DIR} -f makefile2.makefile cli
- cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/highlight" "${BUILD_DIR}/highlight-arm64"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR=${BUILD_DIR_ESCAPED}/build_arm64-$(CONFIGURATION) \
+ LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ cli install
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/libhighlight-x86_64.a: | $(BUILD_DIR) lua
- @echo "${bold}Building static highlight lib for x86_64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight STATIC LIB FOR X86_64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-static
- cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/libhighlight.a" "${BUILD_DIR}/libhighlight-x86_64.a"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \
+ LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ lib-static install-lib-static
+
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/libhighlight-x86_64.dylib: | $(BUILD_DIR) lua
- @echo "${bold}Building shared highlight lib for x86_64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight SHARED LIB FOR x86_64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-shared
- cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/libhighlight.dylib" "${BUILD_DIR}/libhighlight-x86_64.dylib"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \
+ LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ lib-shared install-lib-shared
+
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/highlight-x86_64: | $(BUILD_DIR) lua
- @echo "${bold}Building highlight for x86_64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/highlight-x86_64: lua | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight FOR x86_64 PLATFORM...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
- ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile cli
- ${MAKE} PREFIX=build-$(CONFIGURATION) BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile install
- cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/highlight" "${BUILD_DIR}/highlight-x86_64"
+
+ @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \
+ if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \
+ echo "Clean…"; \
+ ${MAKE} \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ clean; \
+ fi; \
+ fi
+
+ ${MAKE} \
+ BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \
+ LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \
+ LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \
+ CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \
+ LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \
+ -C ${HIGHLIGHT_DIR} \
+ -f makefile2.makefile \
+ cli install
+
@rm highlight/makefile2.makefile
@rm highlight/src/makefile2.makefile
@echo ""
-${BUILD_DIR}/libhighlight.a: $(BUILD_DIR) ${highlight_lib_static} | lua
+${BUILD_DIR_ESCAPED}/libhighlight.a: ${highlight_lib_static} lua | $(BUILD_DIR_ESCAPED)
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Creating universal static highlight lib...${normal}"
- lipo -create -output "${BUILD_DIR}/libhighlight.a" "${BUILD_DIR}/libhighlight-x86_64.a" "${BUILD_DIR}/libhighlight-arm64.a"
+ @echo "\n${bold}CREATING UNIVERSAL STATIC highlight LIB...${normal}"
+ lipo -create -output "$@" \
+ "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/lib/libhighlight.a" \
+ "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/lib/libhighlight.a"
else
- @echo "${bold}Creating ${NATIVE_ARCH} static highlight lib...${normal}"
- @rm -f "${BUILD_DIR}/libhighlight.a" > /dev/null
- ln "${BUILD_DIR}/libhighlight-${NATIVE_ARCH}.a" "${BUILD_DIR}/libhighlight.a"
+ @echo "\n${bold}CREATING ${NATIVE_ARCH} STATIC highlight LIB...${normal}"
+ @rm -f "$@" > /dev/null
+ ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/lib/libhighlight.a" "$@"
endif
@echo ""
-${BUILD_DIR}/libhighlight.dylib: $(BUILD_DIR) ${highlight_lib_shared} | lua
+${BUILD_DIR_ESCAPED}/libhighlight.dylib: ${highlight_lib_shared} lua | $(BUILD_DIR_ESCAPED)
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Creating universal shared highlight lib...${normal}"
- lipo -create -output "${BUILD_DIR}/libhighlight.dylib" "${BUILD_DIR}/libhighlight-x86_64.dylib" "${BUILD_DIR}/libhighlight-arm64.dylib"
+ @echo "\n${bold}CREATING UNIVERSAL SHARED highlight LIB...${normal}"
+ lipo -create -output "$@" \
+ "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/lib/libhighlight.dylib" \
+ "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/lib/libhighlight.dylib"
else
- @echo "${bold}Creating ${NATIVE_ARCH} shared highlight lib...${normal}"
- @rm -f "${BUILD_DIR}/libhighlight.dylib" > /dev/null
- ln "${BUILD_DIR}/libhighlight-${NATIVE_ARCH}.dylib" "${BUILD_DIR}/libhighlight.dylib"
+ @echo "\n${bold}CREATING ${NATIVE_ARCH} SHARED highlight LIB...${normal}"
+ @rm -f "$@" > /dev/null
+ ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/lib/libhighlight.dylib" "$@"
endif
@echo ""
-${BUILD_DIR}/highlight: $(BUILD_DIR) $(highlight_cli) | lua
+${BUILD_DIR_ESCAPED}/highlight: $(highlight_cli) lua | $(BUILD_DIR_ESCAPED)
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Creating universal highlight...${normal}"
- lipo -create -output "${BUILD_DIR}/highlight" "${BUILD_DIR}/highlight-x86_64" "${BUILD_DIR}/highlight-arm64"
+ @echo "\n${bold}CREATING UNIVERSAL highlight...${normal}"
+ lipo -create -output "$@" \
+ "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/bin/highlight" \
+ "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/bin/highlight"
else
- @echo "${bold}Creating ${NATIVE_ARCH} highlight...${normal}"
- @rm -f "${BUILD_DIR}/highlight" > /dev/null
- ln "${BUILD_DIR}/highlight-${NATIVE_ARCH}" "${BUILD_DIR}/highlight"
+ @echo "\n${bold}CREATING ${NATIVE_ARCH} highlight...${normal}"
+ @rm -f "$@" > /dev/null
+ ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/bin/highlight" "$@"
endif
+ @echo "🖋️ CODE SIGNING THE HIGHLIGHT APP"
+ /usr/bin/codesign --force --deep --sign "$(CODE_SIGN_IDENTITY)" \
+ --options runtime \
+ --entitlements $(CURRENT_DIR)/entitlements.entitlements \
+ ${OTHER_CODE_SIGN_FLAGS} \
+ "$@"
@echo ""
-${BUILD_DIR}/share: $(BUILD_DIR) ${BUILD_DIR}/highlight
- cp -R "${HIGHLIGHT_DIR}/build-$(CONFIGURATION)/share/highlight/" "${BUILD_DIR}/share/"
- cp "${HIGHLIGHT_DIR}/build-$(CONFIGURATION)/etc/highlight/filetypes.conf" "${BUILD_DIR}/share/filetypes.conf"
+${BUILD_DIR_ESCAPED}/share: ${BUILD_DIR_ESCAPED}/highlight | $(BUILD_DIR_ESCAPED)
+ cp -R "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/share/highlight/" "${BUILD_DIR}/share/"
+ cp "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/etc/highlight/filetypes.conf" "${BUILD_DIR}/share/filetypes.conf"
clean_highlight:
- @echo "${bold}Cleaning highlight…${normal}"
+ @echo "\n${bold}🗑️ CLEANING highlight...${normal}"
@cp highlight_custom/makefile2.makefile highlight/makefile2.makefile
@cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile
@${MAKE} -C "${HIGHLIGHT_DIR}" -f makefile2.makefile clean
@@ -284,64 +411,64 @@ clean_highlight:
# Highlight wrapper
# ################################
-highlight-wrapper_intel: ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib
-highlight-wrapper_arm: ${BUILD_DIR}/libwrapper_highlight-arm64.dylib
-highlight-wrapper: ${BUILD_DIR}/libwrapper_highlight.dylib
+highlight-wrapper_intel: ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib
+highlight-wrapper_arm: ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib
+highlight-wrapper: ${BUILD_DIR_ESCAPED}/libwrapper_highlight.dylib
clean_highlight-wrapper:
- @echo "${bold}Cleaning highlight wrapper…${normal}"
+ @echo "\n${bold}🗑️ CLEANING highlight wrapper...${normal}"
@rm -f "${BUILD_DIR}/wrapper_highlight-x86_64.o"
@rm -f "${BUILD_DIR}/wrapper_highlight-arm64.o"
@echo ""
-${BUILD_DIR}/libwrapper_highlight-x86_64.dylib: $(BUILD_DIR) ${BUILD_DIR}/liblua.a ${BUILD_DIR}/libhighlight-x86_64.a wrapper_highlight.cpp
- @echo "${bold}Compiling highlight wrapper for x86_64 platform...${normal}"
+${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib: ${BUILD_DIR_ESCAPED}/liblua.a ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight WRAPPER FOR x86_64 PLATFORM...${normal}"
@echo "current dir: ${CURRENT_DIR}"
- ${CXX} ${CFLAGS} ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \
--static \
--c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-x86_64.o"
+ ${CXX} ${CFLAGS} -Wall -O2 -std=c++17 -D_FILE_OFFSET_BITS=64 -MMD -MP ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \
+ -static \
+ -c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-x86_64.o"
@echo ""
- @echo "${bold}Creating highlight wrapper shared library for x86_64 platform...${normal}"
+ @echo "\n${bold}CREATING highlight wrapper SHARED LIBRARY FOR x86_64 PLATFORM...${normal}"
${CXX} ${CFLAGS} ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \
--ldl -lhighlight -llua \
--dynamiclib \
--install_name @rpath/libwrapper_highlight.dylib \
--o "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/wrapper_highlight-x86_64.o"
+ -ldl -lhighlight -llua \
+ -dynamiclib \
+ -install_name @rpath/libwrapper_highlight.dylib \
+ -o "$@" "${BUILD_DIR}/wrapper_highlight-x86_64.o"
@echo ""
-${BUILD_DIR}/libwrapper_highlight-arm64.dylib: $(BUILD_DIR) ${BUILD_DIR}/liblua.a ${BUILD_DIR}/libhighlight-arm64.a wrapper_highlight.cpp
- @echo "${bold}Compiling highlight wrapper for arm64 platform...${normal}"
- ${CXX} ${CFLAGS} ${CFLAGS_arm64} \
--static \
--c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-arm64.o"
+${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib: ${BUILD_DIR_ESCAPED}/liblua.a ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED)
+ @echo "\n${bold}🔨 BUILDING highlight wrapper FOR arm64 PLATFORM...${normal}"
+ ${CXX} ${CFLAGS} -Wall -O2 -std=c++17 -D_FILE_OFFSET_BITS=64 -MMD -MP ${CFLAGS_arm64} \
+ -static \
+ -c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-arm64.o"
@echo ""
- @echo "${bold}Creating highlight wrapper shared library for arm64 platform...${normal}"
+ @echo "\n${bold}CREATING highlight wrapper SHARED LIBRARY FOR arm64 PLATFORM...${normal}"
${CXX} ${CFLAGS} ${CFLAGS_arm64} ${LDFLAGS} ${LDFLAGS_arm64} \
--ldl -lhighlight -llua -framework CoreFoundation \
--dynamiclib \
--install_name @rpath/libwrapper_highlight.dylib \
--o "${BUILD_DIR}/libwrapper_highlight-arm64.dylib" "${BUILD_DIR}/wrapper_highlight-arm64.o"
+ -ldl -lhighlight -llua -framework CoreFoundation \
+ -dynamiclib \
+ -install_name @rpath/libwrapper_highlight.dylib \
+ -o "$@" "${BUILD_DIR}/wrapper_highlight-arm64.o"
@echo ""
-${BUILD_DIR}/libwrapper_highlight.dylib: $(BUILD_DIR) ${wrapper_lib_shared} wrapper_highlight.cpp
+${BUILD_DIR_ESCAPED}/libwrapper_highlight.dylib: ${wrapper_lib_shared} wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED)
ifeq ($(ONLY_ACTIVE_ARCH),NO)
- @echo "${bold}Creating highlight wrapper universal shared library...${normal}"
- lipo -create -output "${BUILD_DIR}/libwrapper_highlight.dylib" "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/libwrapper_highlight-arm64.dylib"
+ @echo "\n${bold}CREATING highlight wrapper UNIVERSAL SHARED LIBRARY...${normal}"
+ lipo -create -output "$@" "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/libwrapper_highlight-arm64.dylib"
@echo ""
else
- @echo "${bold}Creating highlight wrapper library for ${NATIVE_ARCH}...${normal}"
- cp "${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib" "${BUILD_DIR}/libwrapper_highlight.dylib"
+ @echo "\n${bold}CREATING highlight wrapper LIBRARY FOR ${NATIVE_ARCH} PLATFORM...${normal}"
+ cp "${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib" "$@"
endif
-$(BUILD_DIR): FORCE
- @echo "Creating build dir $(BUILD_DIR)..."
+$(BUILD_DIR_ESCAPED): FORCE
+ @echo "CREATING BUILD DIR $(BUILD_DIR_ESCAPED)..."
mkdir -p "$(BUILD_DIR)"
-all: $(BUILD_DIR) check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper
+all: check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper | $(BUILD_DIR_ESCAPED)
-install: $(BUILD_DIR) check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper
+install: check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper | $(BUILD_DIR_ESCAPED)
clean_intermediate: clean_lua clean_highlight clean_highlight-wrapper
diff --git a/highlight-wrapper/boost/array.hpp b/highlight-wrapper/boost/array.hpp
index f047063d..02bd76db 100644
--- a/highlight-wrapper/boost/array.hpp
+++ b/highlight-wrapper/boost/array.hpp
@@ -33,18 +33,18 @@
#include
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-# pragma warning(push)
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(push)
# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
-# pragma warning(disable:4510) // boost::array' : default constructor could not be generated
-# pragma warning(disable:4610) // warning C4610: class 'boost::array' can never be instantiated - user defined constructor required
+# pragma warning(disable:4510) // boost::array' : default constructor could not be generated
+# pragma warning(disable:4610) // warning C4610: class 'boost::array' can never be instantiated - user defined constructor required
#endif
#include
#include
#include
#include
-#include
+#include
#include
#include
@@ -75,7 +75,7 @@ namespace boost {
iterator begin() { return elems; }
const_iterator begin() const { return elems; }
const_iterator cbegin() const { return elems; }
-
+
iterator end() { return elems+N; }
const_iterator end() const { return elems+N; }
const_iterator cend() const { return elems+N; }
@@ -84,9 +84,9 @@ namespace boost {
#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::reverse_iterator reverse_iterator;
typedef std::reverse_iterator const_reverse_iterator;
-#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
- typedef std::reverse_iterator reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator reverse_iterator;
typedef std::reverse_iterator const_reverse_iterator;
#else
@@ -112,39 +112,39 @@ namespace boost {
}
// operator[]
- reference operator[](size_type i)
- {
- return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
+ reference operator[](size_type i)
+ {
+ return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
}
-
- /*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const
- {
- return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
+
+ /*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const
+ {
+ return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
}
// at() with range check
reference at(size_type i) { return rangecheck(i), elems[i]; }
/*BOOST_CONSTEXPR*/ const_reference at(size_type i) const { return rangecheck(i), elems[i]; }
-
+
// front() and back()
- reference front()
- {
- return elems[0];
+ reference front()
+ {
+ return elems[0];
}
-
- BOOST_CONSTEXPR const_reference front() const
+
+ BOOST_CONSTEXPR const_reference front() const
{
return elems[0];
}
-
- reference back()
- {
- return elems[N-1];
+
+ reference back()
+ {
+ return elems[N-1];
}
-
- BOOST_CONSTEXPR const_reference back() const
- {
- return elems[N-1];
+
+ BOOST_CONSTEXPR const_reference back() const
+ {
+ return elems[N-1];
}
// size is constant
@@ -156,7 +156,7 @@ namespace boost {
// swap (note: linear complexity)
void swap (array& y) {
for (size_type i = 0; i < N; ++i)
- boost::swap(elems[i],y.elems[i]);
+ boost::core::invoke_swap(elems[i],y.elems[i]);
}
// direct access to data (read-only)
@@ -213,9 +213,9 @@ namespace boost {
#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::reverse_iterator reverse_iterator;
typedef std::reverse_iterator const_reverse_iterator;
-#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
- typedef std::reverse_iterator reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator reverse_iterator;
typedef std::reverse_iterator const_reverse_iterator;
#else
@@ -301,7 +301,7 @@ namespace boost {
// assign one value to all elements
void assign (const T& value) { fill ( value ); }
void fill (const T& ) {}
-
+
// check range (may be private because it is static)
static reference failed_rangecheck () {
std::out_of_range e("attempt to access element of an empty array");
@@ -353,16 +353,16 @@ namespace boost {
#if defined(__SUNPRO_CC)
// Trac ticket #4757; the Sun Solaris compiler can't handle
// syntax like 'T(&get_c_array(boost::array& arg))[N]'
-//
-// We can't just use this for all compilers, because the
-// borland compilers can't handle this form.
+//
+// We can't just use this for all compilers, because the
+// borland compilers can't handle this form.
namespace detail {
template struct c_array
{
typedef T type[N];
};
}
-
+
// Specific for boost::array: simply returns its elems data member.
template
typename detail::c_array::type& get_c_array(boost::array& arg)
@@ -383,7 +383,7 @@ namespace boost {
{
return arg.elems;
}
-
+
// Const version.
template
const T(&get_c_array(const boost::array& arg))[N]
@@ -391,7 +391,7 @@ namespace boost {
return arg.elems;
}
#endif
-
+
#if 0
// Overload for std::array, assuming that std::array will have
// explicit conversion functions as discussed at the WG21 meeting
@@ -401,7 +401,7 @@ namespace boost {
{
return static_cast(arg);
}
-
+
// Const version.
template
const T(&get_c_array(const std::array& arg))[N]
@@ -423,7 +423,7 @@ namespace boost {
BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" );
return arr[Idx];
}
-
+
template
const T &get(const boost::array &arr) BOOST_NOEXCEPT {
BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(const boost::array &) index out of range" );
@@ -440,7 +440,7 @@ namespace std {
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" );
return arr[Idx];
}
-
+
template
const T &get(const boost::array &arr) BOOST_NOEXCEPT {
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" );
@@ -449,8 +449,8 @@ namespace std {
}
#endif
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-# pragma warning(pop)
-#endif
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
#endif /*BOOST_ARRAY_HPP*/
diff --git a/highlight-wrapper/boost/assert/source_location.hpp b/highlight-wrapper/boost/assert/source_location.hpp
index 09770f7d..c4d5f1b1 100644
--- a/highlight-wrapper/boost/assert/source_location.hpp
+++ b/highlight-wrapper/boost/assert/source_location.hpp
@@ -7,9 +7,7 @@
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
-#include
#include
-#include
#include
#include
#include
@@ -146,6 +144,10 @@ template std::basic_ostream & operator<<( std::basic_ost
# define BOOST_CURRENT_LOCATION ::boost::source_location()
+#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1935
+
+# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCSIG(), __builtin_COLUMN())
+
#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926
// std::source_location::current() is available in -std:c++20, but fails with consteval errors before 19.31, and doesn't produce
diff --git a/highlight-wrapper/boost/bind/apply.hpp b/highlight-wrapper/boost/bind/apply.hpp
index 0520fd0a..a7eecace 100644
--- a/highlight-wrapper/boost/bind/apply.hpp
+++ b/highlight-wrapper/boost/bind/apply.hpp
@@ -2,18 +2,15 @@
#define BOOST_BIND_APPLY_HPP_INCLUDED
//
-// apply.hpp
+// apply.hpp
//
-// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
+// Copyright 2002, 2003, 2024 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
-#include
-#include
-
namespace boost
{
@@ -21,66 +18,10 @@ template struct apply
{
typedef R result_type;
-#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-
template result_type operator()( F&& f, A&&... a ) const
{
return static_cast( f )( static_cast( a )... );
}
-
-#else
-
- template result_type operator()(F & f) const
- {
- return f();
- }
-
- template result_type operator()(F & f, A1 & a1) const
- {
- return f(a1);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2) const
- {
- return f(a1, a2);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const
- {
- return f(a1, a2, a3);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
- {
- return f(a1, a2, a3, a4);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
- {
- return f(a1, a2, a3, a4, a5);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
- {
- return f(a1, a2, a3, a4, a5, a6);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
- {
- return f(a1, a2, a3, a4, a5, a6, a7);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
- {
- return f(a1, a2, a3, a4, a5, a6, a7, a8);
- }
-
- template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
- {
- return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
- }
-
-#endif
};
} // namespace boost
diff --git a/highlight-wrapper/boost/bind/bind.hpp b/highlight-wrapper/boost/bind/bind.hpp
index fd0ee144..5ec79230 100644
--- a/highlight-wrapper/boost/bind/bind.hpp
+++ b/highlight-wrapper/boost/bind/bind.hpp
@@ -8,46 +8,33 @@
#endif
//
-// bind.hpp - binds function objects to arguments
+// bind.hpp - binds function objects to arguments
//
-// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
-// Copyright (c) 2001 David Abrahams
-// Copyright (c) 2005 Peter Dimov
+// Copyright 2001-2005, 2024 Peter Dimov
+// Copyright 2001 David Abrahams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
-// See http://www.boost.org/libs/bind/bind.html for documentation.
+// See http://www.boost.org/libs/bind for documentation.
//
-#include
-#include
#include
-#include
-#include
#include
-#include
#include
-#include
+#include
+#include
+#include
#include
+#include
+#include
#include
-#include
-#include
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-#include // std::forward
-#endif
-
-// Borland-specific bug, visit_each() silently fails to produce code
-
-#if defined(BOOST_BORLANDC)
-# define BOOST_BIND_VISIT_EACH boost::visit_each
-#else
-# define BOOST_BIND_VISIT_EACH visit_each
-#endif
-
-#include
+#include
+#include
+#include
+#include
+#include
#ifdef BOOST_MSVC
# pragma warning(push)
@@ -64,22 +51,22 @@ namespace _bi // implementation details
// ref_compare
-template bool ref_compare( T const & a, T const & b, long )
+template bool ref_compare( T const & a, T const & b )
{
return a == b;
}
-template bool ref_compare( arg const &, arg const &, int )
+template bool ref_compare( arg const &, arg const & )
{
return true;
}
-template bool ref_compare( arg (*) (), arg (*) (), int )
+template bool ref_compare( arg (*) (), arg (*) () )
{
return true;
}
-template bool ref_compare( reference_wrapper const & a, reference_wrapper const & b, int )
+template bool ref_compare( reference_wrapper const & a, reference_wrapper const & b )
{
return a.get_pointer() == b.get_pointer();
}
@@ -88,7 +75,7 @@ template bool ref_compare( reference_wrapper const & a, reference_wr
template class bind_t;
-template bool ref_compare( bind_t const & a, bind_t const & b, int )
+template bool ref_compare( bind_t const & a, bind_t const & b )
{
return a.compare( b );
}
@@ -116,7 +103,7 @@ template class value
// ref_compare for weak_ptr
-template bool ref_compare( value< weak_ptr > const & a, value< weak_ptr > const & b, int )
+template bool ref_compare( value< weak_ptr > const & a, value< weak_ptr > const & b )
{
return !(a.get() < b.get()) && !(b.get() < a.get());
}
@@ -145,1409 +132,235 @@ template struct unwrapper
}
};
-// listN
+// list
-class list0
+template struct accept_lambda
{
-public:
-
- list0() {}
-
- template T & operator[] (_bi::value & v) const { return v.get(); }
-
- template T const & operator[] (_bi::value const & v) const { return v.get(); }
-
- template T & operator[] (reference_wrapper const & v) const { return v.get(); }
-
- template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); }
-
- template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); }
-
- template R operator()(type, F & f, A &, long)
- {
- return unwrapper::unwrap(f, 0)();
- }
-
- template R operator()(type, F const & f, A &, long) const
- {
- return unwrapper::unwrap(f, 0)();
- }
-
- template void operator()(type, F & f, A &, int)
- {
- unwrapper::unwrap(f, 0)();
- }
-
- template void operator()(type, F const & f, A &, int) const
- {
- unwrapper::unwrap(f, 0)();
- }
+ V& v_;
- template void accept(V &) const
- {
- }
+ explicit accept_lambda( V& v ): v_( v ) {}
- bool operator==(list0 const &) const
+ template void operator()( A& a ) const
{
- return true;
+ visit_each( v_, a, 0 );
}
};
-#ifdef BOOST_MSVC
-// MSVC is bright enough to realise that the parameter rhs
-// in operator==may be unused for some template argument types:
-#pragma warning(push)
-#pragma warning(disable:4100)
-#endif
-
-template< class A1 > class list1: private storage1< A1 >
+struct equal_lambda
{
-private:
-
- typedef storage1< A1 > base_type;
-
-public:
-
- explicit list1( A1 a1 ): base_type( a1 ) {}
-
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
-
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
-
- template T & operator[] ( _bi::value & v ) const { return v.get(); }
-
- template T const & operator[] ( _bi::value const & v ) const { return v.get(); }
-
- template T & operator[] (reference_wrapper const & v) const { return v.get(); }
-
- template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); }
-
- template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); }
-
- template R operator()(type, F & f, A & a, long)
- {
- return unwrapper::unwrap(f, 0)(a[base_type::a1_]);
- }
-
- template R operator()(type, F const & f, A & a, long) const
- {
- return unwrapper::unwrap(f, 0)(a[base_type::a1_]);
- }
-
- template void operator()(type, F & f, A & a, int)
- {
- unwrapper::unwrap(f, 0)(a[base_type::a1_]);
- }
+ bool result;
- template void operator()(type, F const & f, A & a, int) const
- {
- unwrapper::unwrap(f, 0)(a[base_type::a1_]);
- }
-
- template void accept(V & v) const
- {
- base_type::accept(v);
- }
+ equal_lambda(): result( true ) {}
- bool operator==(list1 const & rhs) const
+ template void operator()( A1& a1, A2& a2 )
{
- return ref_compare(base_type::a1_, rhs.a1_, 0);
+ result = result && ref_compare( a1, a2 );
}
};
struct logical_and;
struct logical_or;
-template< class A1, class A2 > class list2: private storage2< A1, A2 >
-{
-private:
-
- typedef storage2< A1, A2 > base_type;
-
-public:
-
- list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
-
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
-
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
-
- template T & operator[] (_bi::value & v) const { return v.get(); }
-
- template T const & operator[] (_bi::value const & v) const { return v.get(); }
-
- template T & operator[] (reference_wrapper const & v) const { return v.get(); }
-
- template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); }
-
- template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); }
-
- template R operator()(type, F & f, A & a, long)
- {
- return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
-
- template R operator()(type, F const & f, A & a, long) const
- {
- return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
-
- template void operator()(type