Skip to content

Commit

Permalink
Merge pull request #173 from tokudai0000/170-fix-env
Browse files Browse the repository at this point in the history
[170] Modify environment settings
  • Loading branch information
akidon0000 authored Mar 5, 2024
2 parents 5f1ff14 + fdba5a3 commit 26bfefc
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 25 deletions.
20 changes: 20 additions & 0 deletions .githooks/README.md
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/
4 changes: 4 additions & 0 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

git fetch
make setup
19 changes: 19 additions & 0 deletions .githooks/prepare-commit-msg
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
76 changes: 71 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
UserInterfaceState.xcuserstate
vendor/
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore


R.generated.swift
GoogleService-Info.plist


# Mintfile
.mint

# Gemfile
vendor/
.bundle


# Xcode Patch
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
Expand All @@ -29,15 +41,69 @@ DerivedData/
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#

Pods/
#

# Add this line if you want to avoid checking in source code from the Xcode workspace
*.xcworkspace
*.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

source "https://rubygems.org"

gem 'cocoapods'
gem 'cocoapods' , '1.15.2'
48 changes: 30 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (6.1.7.4)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.4)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
bigdecimal (3.1.6)
claide (1.1.0)
cocoapods (1.12.1)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.12.1)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
Expand All @@ -33,8 +41,8 @@ GEM
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.12.1)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -45,7 +53,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand All @@ -54,44 +62,48 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.1)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.19.0)
json (2.7.1)
minitest (5.22.2)
molinillo (0.8.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.22.0)
xcodeproj (1.24.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.10)

PLATFORMS
x86_64-darwin-22
x86_64-darwin-23

DEPENDENCIES
cocoapods
cocoapods (= 1.15.2)

BUNDLED WITH
2.4.4
114 changes: 114 additions & 0 deletions Makefile
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)

# }}}
3 changes: 3 additions & 0 deletions Mintfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
realm/[email protected]
IBDecodable/[email protected]
fromkk/[email protected]
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 310558f561793f179059aed0fc9ec538b65a0d98

COCOAPODS: 1.14.2
COCOAPODS: 1.14.3

0 comments on commit 26bfefc

Please sign in to comment.