Skip to content

Commit

Permalink
Rename project to Workbench
Browse files Browse the repository at this point in the history
  • Loading branch information
hisaac committed Nov 29, 2024
1 parent 465646c commit c8b7f12
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 14 deletions.
12 changes: 11 additions & 1 deletion Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ let swiftVersionFileContents = try! String(contentsOfFile: swiftVersionFile.path
let swiftVersionFileContentsTrimmed = swiftVersionFileContents.trimmingCharacters(in: .whitespacesAndNewlines)

let project = Project(
name: "SysInfoKit",
name: "Workbench",
settings: .settings(
base: SettingsDictionary().swiftVersion(swiftVersionFileContentsTrimmed)
),
targets: [
.target(
name: "WorkbenchCLI",
destinations: .macOS,
product: .commandLineTool,
bundleId: "co.othr.WorkbenchCLI",
sources: ["src/WorkbenchCLI/Sources/**"],
dependencies: [
.target(name: "SysInfoKit"),
]
),
.target(
name: "SysInfoKit",
destinations: .macOS,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# workbench
# Workbench

This repository is a place for me to experiment with new tools and little projects. Consider anything here a work in progress, and if I consider it ready for use, I'll move it to a more permanent home.

Expand Down
4 changes: 3 additions & 1 deletion Tuist/Config.swift → Tuist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ let config: Config = {
let swiftVersionFileContentsTrimmed = swiftVersionFileContents.trimmingCharacters(in: .whitespacesAndNewlines)
let swiftVersion = Version(stringLiteral: swiftVersionFileContentsTrimmed)

return Config(
let project = TuistProject.tuist(
compatibleXcodeVersions: .exact(xcodeVersion),
swiftVersion: swiftVersion,
generationOptions: .options(
disablePackageVersionLocking: true,
staticSideEffectsWarningTargets: .all
)
)

return Config(project: project)
}()
18 changes: 9 additions & 9 deletions Tuist/Package.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// swift-tools-version: 6.0

@preconcurrency import PackageDescription

#if TUIST
import ProjectDescription
import ProjectDescription

let packageSettings = PackageSettings(
targetSettings: [
"PluginCore": ["SWIFT_VERSION": "5"]
]
)
let packageSettings = PackageSettings(
targetSettings: [
"PluginCore": .settings(base: SettingsDictionary().swiftVersion("5")),
]
)

#endif

import PackageDescription

let package = Package(
name: "SysInfoKit",
name: "Workbench",
dependencies: [
.package(url: "https://github.com/SwiftyLab/MetaCodable", from: "1.4.0"),
.package(url: "https://github.com/tuist/Command", from: "0.9.32"),
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ src_dir := project_root / "src"
default: open

open *target: up (generate target)
xcrun xed "{{ project_root }}/SysInfoKit.xcworkspace"
xcrun xed "{{ project_root }}/Workbench.xcworkspace"

op *target: up (generate target)
"/Applications/Xcode-15.4.0.app/Contents/MacOS/Xcode" "{{ project_root }}/SysInfoKit.xcworkspace"
"/Applications/Xcode-15.4.0.app/Contents/MacOS/Xcode" "{{ project_root }}/Workbench.xcworkspace"

generate *target: up
tuist install
Expand Down
27 changes: 27 additions & 0 deletions src/WorkbenchCLI/Sources/cli.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Foundation

@main
struct WorkbenchCLI {
static func main() {
let kCFPreferencesGlobal = ".GlobalPreferences" as CFString

// Now try to get all keys
if let keyList = CFPreferencesCopyKeyList(
kCFPreferencesGlobal,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost
) as? [String] {
print("\nFound \(keyList.count) keys:")

dump(keyList)

// for key in keyList {
// if let value = CFPreferencesCopyAppValue(key as CFString, ".GlobalPreferences" as CFString) {
// print("\(key): \(value)")
// }
// }
} else {
print("No keys found or error accessing preferences")
}
}
}

0 comments on commit c8b7f12

Please sign in to comment.