-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Makefile. Update Logger. Add excluded paths
- Loading branch information
Showing
5 changed files
with
110 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
PRODUCT_NAME = LocalizedGenStrings | ||
VERSION = $(version) | ||
|
||
PREFIX ?= /usr/local | ||
|
||
CD = cd | ||
CP = $(shell whereis cp) -Rf | ||
GIT = $(shell which git) | ||
HUB = $(shell which hub) | ||
MKDIR = $(shell which mkdir) -p | ||
RM = $(shell whereis rm) -rf | ||
SED = /usr/bin/sed | ||
SWIFT = $(shell which swift) | ||
TAR = $(shell whereis tar) cJf | ||
|
||
TARGET_PLATFORM = x86_64-apple-macosx | ||
TARBALL = "LocalizedGetStrings-$(VERSION).mojave.tar.xz" | ||
|
||
BINARY_DIRECTORY = $(PREFIX)/bin | ||
BUILD_DIRECTORY = $(shell pwd)/.build/$(TARGET_PLATFORM)/release | ||
OUTPUT_EXECUTABLE = $(BUILD_DIRECTORY)/$(PRODUCT_NAME) | ||
INSTALL_EXECUTABLE_PATH = $(BINARY_DIRECTORY)/$(PRODUCT_NAME) | ||
|
||
SWIFT_BUILD_FLAGS = --configuration release --disable-sandbox | ||
|
||
.PHONY: all | ||
all: build | ||
|
||
.PHONY: test | ||
test: clean | ||
$(SWIFT) test | ||
|
||
.PHONY: build | ||
build: | ||
$(SWIFT) build $(SWIFT_BUILD_FLAGS) | ||
|
||
.PHONY: install | ||
install: build | ||
$(MKDIR) $(BINARY_DIRECTORY) | ||
$(CP) "$(OUTPUT_EXECUTABLE)" "$(BINARY_DIRECTORY)" | ||
|
||
.PHONY: package | ||
package: build | ||
$(CD) "$(BUILD_DIRECTORY)" && $(TAR) $(TARBALL) "$(PRODUCT_NAME)" | ||
$(CP) "$(BUILD_DIRECTORY)/$(TARBALL)" $(TARBALL) | ||
|
||
.PHONY: release | ||
release: clean package | ||
$(GIT) --git-dir=../homebrew-tap/.git pull origin master | ||
$(SED) -i '' '4s/.*/ version "$(VERSION)"/' ../homebrew-tap/swiftbrew.rb | ||
$(SED) -i '' '6s/.*/ sha256 "$(shell shasum -a 256 "$(TARBALL)" | cut -f 1 -d " ")"/' ../homebrew-tap/swiftbrew.rb | ||
$(HUB) release create --message $(VERSION) --attach $(TARBALL) $(VERSION) | ||
$(CD) ../homebrew-tap && \ | ||
$(GIT) commit swiftbrew.rb -m "Release version $(VERSION)" | ||
$(GIT) --git-dir=../homebrew-tap/.git push origin master | ||
|
||
.PHONY: xcode | ||
xcode: | ||
$(SWIFT) package generate-xcodeproj | ||
|
||
.PHONY: uninstall | ||
uninstall: | ||
$(RM) "$(BINARY_DIRECTORY)/$(PRODUCT_NAME)" | ||
|
||
.PHONY: clean | ||
clean: | ||
$(SWIFT) package clean |
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
19 changes: 19 additions & 0 deletions
19
Sources/LocalizedGenStringsCore/Tools/Extensions/SequenceExtension.swift
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,19 @@ | ||
// | ||
// SequenceExtension.swift | ||
// LocalizedGenStringsCore | ||
// | ||
// Created by Timur Shafigullin on 12/08/2019. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Sequence where Iterator.Element: Hashable { | ||
|
||
// MARK: - Instance Methods | ||
|
||
func intersects<S: Sequence>(with sequence: S) -> Bool where S.Iterator.Element == Iterator.Element { | ||
let sequenceSet = Set(sequence) | ||
|
||
return self.contains(where: sequenceSet.contains) | ||
} | ||
} |
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