-
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.
Merge pull request #173 from tokudai0000/170-fix-env
[170] Modify environment settings
- Loading branch information
Showing
9 changed files
with
263 additions
and
25 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,20 @@ | ||
# githooks | ||
このディレクトリは本来であれば、.git/hooks/ に配置するディレクトリです。 | ||
|
||
.git は、リポジトリの設定を管理するディレクトリであり、バージョン管理対象外です。 | ||
|
||
そのため、.githooks/の内容を.git/hooks/へコピーすることで、リポジトリのGit操作に適用しています。 | ||
|
||
以下のコマンドは、mint setupの一部として実行されます。 | ||
|
||
|
||
```zsh | ||
$ cp -r .githooks .git/hooks | ||
|
||
$ chmod -R +x .git/hooks | ||
``` | ||
|
||
# 参考 | ||
https://git-scm.com/docs/githooks | ||
|
||
https://www.farend.co.jp/blog/2020/04/git-hook/ |
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 @@ | ||
#!/bin/sh | ||
|
||
git fetch | ||
make setup |
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 @@ | ||
#!/bin/sh | ||
|
||
# コミットメッセージは .git/COMMIT_EDITMSG に保存されてる | ||
COMMIT_MSG_FILE_PATH="$1" | ||
|
||
# コミットメッセージ読み込み | ||
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE_PATH") | ||
|
||
# [Int値] の正規表現 | ||
PATTERN="^\[\d+\]" | ||
|
||
# コミットメッセージの検証 | ||
if ! echo "$COMMIT_MSG" | grep -qE "$PATTERN"; then | ||
# \033[31m は赤文字にするANSIエスケープシーケンス | ||
echo "\033[31mERROR: コミットメッセージは '[Issue番号]' で始めてください。" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
source "https://rubygems.org" | ||
|
||
gem 'cocoapods' | ||
gem 'cocoapods' , '1.15.2' |
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,114 @@ | ||
# 参考: https://github.com/uhooi/UhooiPicBook/blob/develop/Makefile | ||
# Variables {{{ | ||
|
||
# Project | ||
product_name := univIP | ||
workspace_name := $(product_name).xcworkspace | ||
package_name := $(product_name)Package | ||
|
||
# Production | ||
production_project_name := Production | ||
production_log_name := $(product_name)_$(production_project_name)_Build.log | ||
|
||
# Develop | ||
develop_project_name := Develop | ||
develop_log_name := $(product_name)_$(develop_project_name)_Build.log | ||
|
||
# Test | ||
TEST_SDK := iphonesimulator | ||
TEST_CONFIGURATION := Debug | ||
TEST_PLATFORM := iOS Simulator | ||
TEST_DESTINATION := 'generic/platform=$(TEST_PLATFORM)' | ||
|
||
# Commands | ||
MINT := mint | ||
SWIFTLINT := $(MINT) run realm/SwiftLint swiftlint | ||
|
||
# Mint | ||
MINT_ROOT := ./.mint | ||
export MINT_PATH := $(MINT_ROOT)/lib | ||
export MINT_LINK_PATH := $(MINT_ROOT)/bin | ||
|
||
# }}} | ||
|
||
# Targets {{{ | ||
|
||
.PHONY: setup | ||
setup: | ||
$(MAKE) setup-githooks | ||
$(MAKE) cocoapods-version-setup | ||
$(MAKE) pod-install | ||
$(MAKE) install-mint-dependencies | ||
$(MAKE) open | ||
|
||
.PHONY: setup-githooks | ||
setup-githooks: | ||
cp -r .githooks/* .git/hooks | ||
chmod -R +x .git/hooks | ||
|
||
.PHONY: cocoapods-version-setup | ||
cocoapods-version-setup: | ||
bundle install --path vendor/bundle | ||
|
||
.PHONY: install-mint-dependencies | ||
install-mint-dependencies: | ||
$(MINT) bootstrap --overwrite y | ||
|
||
.PHONY: pod-install | ||
pod-install: | ||
pod install | ||
|
||
.PHONY: open | ||
open: | ||
open ./$(workspace_name) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ./$(package_name)/.build/ | ||
|
||
.PHONY: distclean | ||
distclean: | ||
rm -rf $(MINT_ROOT) | ||
rm -rf ./$(production_log_name) | ||
rm -rf ./$(develop_log_name) | ||
rm -rf ~/Library/Developer/Xcode/DerivedData | ||
rm -rf ./$(package_name)/.swiftpm/ | ||
$(MAKE) clean | ||
|
||
$(develop_log_name): | ||
$(MAKE) build-debug-develop | ||
|
||
.PHONY: build-debug-production | ||
build-debug-production: | ||
$(MAKE) build-debug PROJECT_NAME=$(production_project_name) | ||
|
||
.PHONY: build-debug-develop | ||
build-debug-develop: | ||
$(MAKE) build-debug PROJECT_NAME=$(develop_project_name) | ||
|
||
.PHONY: build-debug | ||
build-debug: | ||
set -o pipefail \ | ||
&& xcodebuild \ | ||
-sdk $(TEST_SDK) \ | ||
-configuration $(TEST_CONFIGURATION) \ | ||
-workspace $(workspace_name) \ | ||
-scheme '$(PROJECT_NAME)' \ | ||
-destination $(TEST_DESTINATION) \ | ||
-skipPackagePluginValidation \ | ||
clean build \ | ||
| tee $(product_name)_$(PROJECT_NAME)_Build.log | ||
|
||
.PHONY: lint | ||
lint: | ||
$(SWIFTLINT) | ||
|
||
.PHONY: fix | ||
fix: | ||
$(SWIFTLINT) --fix --format | ||
|
||
.PHONY: analyze | ||
analyze: $(develop_log_name) | ||
$(SWIFTLINT) analyze --fix --compiler-log-path $(develop_log_name) | ||
|
||
# }}} |
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] | ||
IBDecodable/[email protected] | ||
fromkk/[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