Skip to content

Commit

Permalink
Merge pull request #8 from cats-oss/static_stdlib
Browse files Browse the repository at this point in the history
Use static stdlib
  • Loading branch information
ra1028 authored Jul 10, 2019
2 parents ce2952e + 7754bd0 commit 3a7fba3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ Carthage/

## Tests
!/Tests/AcknowledgementsPlistTests/Dummy/pcProject/Carthage

## Builds
portable_acknowledgementsplist.zip
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@ TEMP_ZIP_DIR=./tmp/portable_zip
SWIFT_BIN_DIR=$(shell swift build -c release --show-bin-path)
BIN_NAME=acknowledgementsplist

# refer: https://github.com/realm/SwiftLint/pull/2682
SWIFT_BUILD_FLAGS=-c release
UNAME=$(shell uname)
ifeq ($(UNAME), Darwin)
USE_SWIFT_STATIC_STDLIB:=$(shell test -d $$(dirname $$(xcrun --find swift))/../lib/swift_static/macosx && echo yes)
ifeq ($(USE_SWIFT_STATIC_STDLIB), yes)
SWIFT_BUILD_FLAGS+= -Xswiftc -static-stdlib
endif
endif

TEMP_ZIP_DIR=./tmp/portable_zip
SWIFT_BIN_DIR=$(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)
BIN_NAME=acknowledgementsplist

.PHONY: project release_build portable_zip

project:
swift package generate-xcodeproj

release_build:
swift build -c release
swift build $(SWIFT_BUILD_FLAGS)

portable_zip: release_build
mkdir -p $(TEMP_ZIP_DIR)
cp -f $(SWIFT_BIN_DIR)/$(BIN_NAME) $(TEMP_ZIP_DIR)
cp -f LICENSE $(TEMP_ZIP_DIR)
(cd $(TEMP_ZIP_DIR); zip -yr - $(BIN_NAME) LICENSE) > ./portable_acknowledgementsplist.zip
rm -rf $(TEMP_ZIP_DIR)
rm -rf $(TEMP_ZIP_DIR)
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:4.2

import PackageDescription

Expand Down

0 comments on commit 3a7fba3

Please sign in to comment.