-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Mintfile * Update Makefile * Use old swiftlint and swiftformat versions * Lint * Update SwiftLint and SwiftFormat Versions + Lint * Re-add documented make rules * Update sourcery to 2.2.5 * Update SwiftLint and Lint
- Loading branch information
Showing
27 changed files
with
177 additions
and
176 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,11 @@ | ||
# file options | ||
--exclude Sources/**/*.generated.swift | ||
--exclude Sources/FirebladeECS/Entity+Component.swift # problems with self.get { } | ||
--exclude Tests/**/*.swift | ||
|
||
# format options | ||
--extensionacl on-declarations | ||
--stripunusedargs closure-only | ||
--commas inline | ||
--self remove | ||
--selfrequired get |
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 |
---|---|---|
@@ -1,79 +1,61 @@ | ||
# Version 1.0.0 | ||
UNAME_S := $(shell uname -s) | ||
|
||
# Lint | ||
lint: | ||
swiftlint autocorrect --format | ||
swiftlint lint --quiet | ||
|
||
lintErrorOnly: | ||
@swiftlint autocorrect --format --quiet | ||
@swiftlint lint --quiet | grep error | ||
|
||
# Git | ||
precommit: generateCode generateTestsCode lint genLinuxTests | ||
|
||
submodule: | ||
git submodule init | ||
git submodule update --recursive | ||
|
||
# Tests | ||
genLinuxTests: | ||
swift test --generate-linuxmain | ||
swiftlint autocorrect --format --path Tests/ | ||
|
||
test: genLinuxTests | ||
swift test | ||
|
||
# Package | ||
latest: | ||
swift package update | ||
|
||
resolve: | ||
swift package resolve | ||
|
||
# Xcode | ||
genXcode: | ||
swift package generate-xcodeproj --enable-code-coverage --skip-extra-files | ||
|
||
genXcodeOpen: genXcode | ||
open *.xcodeproj | ||
|
||
# Clean | ||
clean: | ||
swift package reset | ||
-rm -rdf .swiftpm/xcode | ||
-rm -rdf .build/ | ||
-rm Package.resolved | ||
-rm .DS_Store | ||
|
||
cleanArtifacts: | ||
swift package clean | ||
SWIFT_PACKAGE_VERSION := $(shell swift package tools-version) | ||
|
||
# Lint fix and format code. | ||
.PHONY: lint-fix | ||
swiftlint: | ||
mint run swiftlint lint --fix --config .swiftlint.yml --format --quiet | ||
swiftformat: | ||
mint run swiftformat . --swiftversion ${SWIFT_PACKAGE_VERSION} | ||
lint-fix: swiftlint swiftformat | ||
|
||
# Generate code | ||
.PHONY: generate-code | ||
generate-code: | ||
mint run sourcery --quiet --config ./.sourcery.yml | ||
mint run sourcery --quiet --config ./.sourceryTests.yml | ||
|
||
# Run pre-push tasks | ||
.PHONY: pre-push | ||
pre-push: generate-code lint-fix | ||
|
||
.PHONY: precommit | ||
precommit: pre-push | ||
|
||
.PHONY: setup-brew | ||
setup-brew: | ||
@which -s brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
@brew update | ||
|
||
.PHONY: install-dependencies-macOS | ||
install-dependencies-macOS: setup-brew | ||
brew install mint | ||
mint bootstrap | ||
|
||
.PHONY: setupEnvironment | ||
setupEnvironment: install-dependencies-macOS | ||
|
||
# Build debug version | ||
.PHONY: build-debug | ||
build-debug: | ||
swift build -c debug | ||
|
||
# Build release version | ||
.PHONY: build-release | ||
build-release: | ||
swift build -c release --skip-update | ||
|
||
# Test links in README | ||
# requires <https://github.com/tcort/markdown-link-check> | ||
.PHONY: testReadme | ||
testReadme: | ||
markdown-link-check -p -v ./README.md | ||
|
||
generateCode: | ||
sourcery --config ./.sourcery.yml --verbose | ||
generateTestsCode: | ||
sourcery --config ./.sourceryTests.yml --verbose | ||
|
||
brewInstallDeps: brewUpdate | ||
brew install swiftenv | ||
brew install swiftlint | ||
brew install sourcery | ||
|
||
brewSetup: | ||
which -s brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
|
||
brewUpdate: brewSetup | ||
brew update | ||
|
||
setupEnvironment: brewInstallDeps | ||
open Package.swift | ||
# Delete package build artifacts. | ||
.PHONY: clean | ||
clean: clean-sourcery | ||
swift package clean | ||
|
||
# lines of code | ||
loc: clean | ||
find . -name "*.swift" -print0 | xargs -0 wc -l | ||
# Clean sourcery cache | ||
.PHONY: clean-sourcery | ||
clean-sourcery: | ||
rm -rdf ${HOME}/Library/Caches/Sourcery |
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,3 @@ | ||
realm/[email protected] | ||
nicklockwood/[email protected] | ||
krzysztofzablocki/[email protected] |
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
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
Oops, something went wrong.