Skip to content

Commit e166bf2

Browse files
committed
Updated to use SPM and latest Files version
Made repository a Swift Package, allowing dependency management and execution without Marathon. Updated function calls to latest Files API. Updated README.md to describe installation using SPM instead of Marathon.
1 parent f5378dd commit e166bf2

File tree

4 files changed

+37
-17
lines changed

4 files changed

+37
-17
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/
6+
/.swiftpm
7+
Package.resolved

Package.swift

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// swift-tools-version:5.1
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "XcodeTheme",
7+
dependencies: [
8+
.package(url: "https://github.com/JohnSundell/Files.git", from: "4.0.0"),
9+
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0")
10+
],
11+
targets: [
12+
.target(name: "XcodeTheme", dependencies: ["Files", "ShellOut"])
13+
]
14+
)

README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ This repository contains the Xcode theme that I use. Feel free to use it or modi
44

55
![](Preview.png)
66

7-
## Installing using Marathon
7+
## Installing using Swift Package Manager
88

9-
The easiest way to install this Xcode theme is using **[Marathon](https://github.com/johnsundell/marathon):**
9+
The easiest way to install this Xcode theme is to clone this repo and execute `swift run`:
1010

11-
1. Install the latest version of Marathon if you haven't already:
1211
```
13-
$ git clone https://github.com/JohnSundell/Marathon.git
14-
$ cd Marathon
15-
$ make
12+
$ git clone https://github.com/johnsundell/xcodetheme.git
13+
$ cd XcodeTheme
14+
$ swift run
1615
```
1716

18-
2. Run the install script which will install [Adobe's Source Code Pro](https://github.com/adobe-fonts/source-code-pro) font & this Xcode theme for you:
17+
This will install [Adobe's Source Code Pro](https://github.com/adobe-fonts/source-code-pro) font and this Xcode theme for you. Afterward, you can remove the downloaded folder:
18+
1919
```
20-
$ marathon run johnsundell/xcodetheme
20+
$ cd ..
21+
$ rm -rf XcodeTheme
2122
```
2223

2324
## Installing manually

Install.swift Sources/XcodeTheme/main.swift

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Foundation
2-
import Files // marathon:https://github.com/JohnSundell/Files.git
3-
import ShellOut // marathon:https://github.com/JohnSundell/ShellOut.git
2+
import Files
3+
import ShellOut
44

5-
let fontsFolder = try Folder.home.subfolder(atPath: "Library/Fonts")
5+
let fontsFolder = try Folder.home.subfolder(at: "Library/Fonts")
66

77
if !fontsFolder.containsFile(named: "SourceCodePro-Regular.ttf") {
88
print("🅰️ Downloading Source Code Pro font...")
@@ -23,19 +23,17 @@ if !fontsFolder.containsFile(named: "SourceCodePro-Regular.ttf") {
2323
try fontZipFile.delete()
2424
}
2525

26-
print("🎨 Downloading Xcode theme...")
26+
print("🎨 Installing Xcode theme...")
2727

28-
let themeURL = URL(string: "https://raw.githubusercontent.com/JohnSundell/XcodeTheme/master/SundellsColors.xccolortheme")!
28+
let themeURL = URL(fileURLWithPath: #file.replacingOccurrences(of: "Sources/XcodeTheme/main.swift", with: "SundellsColors.xccolortheme"))
2929
let themeData = try Data(contentsOf: themeURL)
3030

31-
print("🎨 Installing Xcode theme...")
32-
33-
let xcodeFolder = try Folder.home.subfolder(atPath: "Library/Developer/Xcode")
31+
let xcodeFolder = try Folder.home.subfolder(at: "Library/Developer/Xcode")
3432
let userDataFolder = try xcodeFolder.createSubfolderIfNeeded(withName: "UserData")
3533
let themeFolder = try userDataFolder.createSubfolderIfNeeded(withName: "FontAndColorThemes")
3634

3735
let themeFile = try themeFolder.createFile(named: "SundellsColors.xccolortheme")
38-
try themeFile.write(data: themeData)
36+
try themeFile.write(themeData)
3937

4038
print("")
4139
print("🎉 Sundell's Colors successfully installed")

0 commit comments

Comments
 (0)