-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(generation): increased compatibility and robustness for font loca…
…tion (#144)
- Loading branch information
Showing
10 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
brew "upx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
MODULE_NAME = MacFonts | ||
ARCH = x86_64 | ||
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
TARGET_DIR = $(ROOT_DIR)/.build/release | ||
OUTPUT_DIR = $(ROOT_DIR)/bin | ||
SRC_DIR = $(ROOT_DIR)/src | ||
|
||
SWIFT_FILES = $(wildcard $(SRC_DIR)/*.swift) | ||
|
||
SWIFT_VERSION_CHECK := $(strip $(shell TOOLCHAINS=swift swift --version | grep -c 4.2)) | ||
|
||
all: clean build test | ||
|
||
build: | ||
if [ $(SWIFT_VERSION_CHECK) != 1 ]; then echo Invalid Swift compiler version; exit 1; fi | ||
brew bundle | ||
mkdir -p $(OUTPUT_DIR) | ||
swiftc $(SWIFT_FILES) -o $(OUTPUT_DIR)/$(MODULE_NAME) | ||
TOOLCHAINS=swift swift build --static-swift-stdlib -c release -Xswiftc -Osize | ||
cp $(TARGET_DIR)/$(MODULE_NAME) $(OUTPUT_DIR)/$(MODULE_NAME) | ||
upx $(OUTPUT_DIR)/$(MODULE_NAME) | ||
|
||
clean: | ||
rm -r $(OUTPUT_DIR) | ||
rm -rf $(OUTPUT_DIR) | ||
rm -rf $(TARGET_DIR) | ||
|
||
test: | ||
make | ||
$(OUTPUT_DIR)/$(MODULE_NAME) Helvetica |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// swift-tools-version:4.2 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "MacFonts", | ||
dependencies: [], | ||
targets: [ | ||
.target( | ||
name: "MacFonts", | ||
dependencies: []), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# MacFonts | ||
|
||
A macOS-only utility for locating fonts installed on the user's local system. | ||
|
||
## Requirements | ||
|
||
- [Homebrew](https://brew.sh) | ||
- [Swift 4.2](https://swift.org/download/) |
File renamed without changes.
Binary file not shown.