From 8aa3a20eab643523d4b4bbbfac092809d81ca500 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Fri, 25 Oct 2024 10:27:58 +0300 Subject: [PATCH 1/9] Remove SwiftGen dependency --- CHANGELOG.md | 4 ++++ hooks/post_gen_project.sh | 6 ------ {{ cookiecutter.name }}/Makefile | 13 ------------- {{ cookiecutter.name }}/Podfile | 1 - {{ cookiecutter.name }}/project.yml | 8 -------- {{ cookiecutter.name }}/swiftgen.yml | 7 ------- .../Resources/Fonts/.gitkeep | 0 7 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 {{ cookiecutter.name }}/swiftgen.yml delete mode 100644 {{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Fonts/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index ea94456..957ae8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [3.0] - TBA +### Removed +- Полностью удалена зависимость от SwiftGen + ## [2.5.0] - 2024-10-16 ### Added - Добавлен `.git-branches.toml` файл для настройки работы проекта с [git-town](https://github.com/git-town/git-town). diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index 2b30256..a599b1b 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -2,12 +2,6 @@ # Generate xcodeproj file make project -# -# Generate SwiftGen xcfilelist -make xcfilelist - -# Generate SwiftGen files -make swiftgen # Download .gitignore file curl -L 'https://www.gitignore.io/api/swift,macos,fastlane' > .gitignore diff --git a/{{ cookiecutter.name }}/Makefile b/{{ cookiecutter.name }}/Makefile index 7ed30ba..333fb13 100644 --- a/{{ cookiecutter.name }}/Makefile +++ b/{{ cookiecutter.name }}/Makefile @@ -1,4 +1,3 @@ -SWIFTGEN = Pods/SwiftGen/bin/swiftgen SWIFTFORMAT = Pods/SwiftFormat/CommandLineTool/swiftformat .PHONY: all @@ -29,18 +28,6 @@ fmt: lint: $(SWIFTFORMAT) {{ cookiecutter.name }} {{ cookiecutter.name }}Tests --lint -.PHONY: xcfilelist -## xcfilelist: Regenerate xcfilelist files -xcfilelist: - $(SWIFTGEN) config generate-xcfilelists \ - --inputs swiftgen-input-files.xcfilelist \ - --outputs swiftgen-output-files.xcfilelist - -.PHONY: swiftgen -## swiftgen: Trigger code generation from assets with swiftgen tool -swiftgen: - $(SWIFTGEN) - GIT_HOOKS_SCRIPTS := $(wildcard hooks/*) .PHONY: hooks diff --git a/{{ cookiecutter.name }}/Podfile b/{{ cookiecutter.name }}/Podfile index 05e1e10..40118b2 100644 --- a/{{ cookiecutter.name }}/Podfile +++ b/{{ cookiecutter.name }}/Podfile @@ -3,7 +3,6 @@ platform :ios, '{{ cookiecutter.deployment_target }}' inhibit_all_warnings! target '{{ cookiecutter.name | lower }}' do - pod 'SwiftGen', '~> 6.6.3' pod 'SwiftFormat/CLI', '~> 0.54' target '{{ cookiecutter.name | lower }}Tests' do diff --git a/{{ cookiecutter.name }}/project.yml b/{{ cookiecutter.name }}/project.yml index 9def8c7..8958fbc 100644 --- a/{{ cookiecutter.name }}/project.yml +++ b/{{ cookiecutter.name }}/project.yml @@ -40,14 +40,6 @@ targets: scheme: testTargets: - {{ cookiecutter.name | lower }}Tests - prebuildScripts: - - script: | - "${PODS_ROOT}/SwiftGen/bin/swiftgen" - name: SwiftGen - inputFileLists: - - $(SRCROOT)/swiftgen-input-files.xcfilelist - outputFileLists: - - $(SRCROOT)/swiftgen-output-files.xcfilelist attributes: ProvisioningStyle: Automatic DevelopmentTeam: {{ cookiecutter.development_team_id }} diff --git a/{{ cookiecutter.name }}/swiftgen.yml b/{{ cookiecutter.name }}/swiftgen.yml deleted file mode 100644 index 924bc1e..0000000 --- a/{{ cookiecutter.name }}/swiftgen.yml +++ /dev/null @@ -1,7 +0,0 @@ -input_dir: {{ cookiecutter.name }}/Resources/ -output_dir: {{ cookiecutter.name }}/Classes/Generated -fonts: - inputs: Fonts - outputs: - templateName: swift5 - output: Fonts.swift diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Fonts/.gitkeep b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Fonts/.gitkeep deleted file mode 100644 index e69de29..0000000 From b07f28cf176b2f2dd47ab49da8d88cab719d693f Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Mon, 28 Oct 2024 16:21:30 +0300 Subject: [PATCH 2/9] Update swift version to 6.0 --- CHANGELOG.md | 3 +++ {{ cookiecutter.name }}/README.md | 2 +- {{ cookiecutter.name }}/project.yml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 957ae8d..73f116a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [3.0] - TBA +### Changed +- Обновлена версия Swift до 6.0 + ### Removed - Полностью удалена зависимость от SwiftGen diff --git a/{{ cookiecutter.name }}/README.md b/{{ cookiecutter.name }}/README.md index a357edd..2f5f6ca 100644 --- a/{{ cookiecutter.name }}/README.md +++ b/{{ cookiecutter.name }}/README.md @@ -22,4 +22,4 @@ Before launching the project, it's important to confirm that each team member ha --- -This project was created using [the project template](https://github.com/alphatroya/swift-project-template) version 2.5.0. +This project was created using [the project template](https://github.com/alphatroya/swift-project-template) version 3.0.0. diff --git a/{{ cookiecutter.name }}/project.yml b/{{ cookiecutter.name }}/project.yml index 8958fbc..cd637df 100644 --- a/{{ cookiecutter.name }}/project.yml +++ b/{{ cookiecutter.name }}/project.yml @@ -19,7 +19,7 @@ settings: VERSIONING_SYSTEM: apple-generic CURRENT_PROJECT_VERSION: 1 MARKETING_VERSION: 1.0 - SWIFT_VERSION: 5.0 + SWIFT_VERSION: 6.0 DEVELOPMENT_TEAM: {{ cookiecutter.development_team_id }} GENERATE_INFOPLIST_FILE: YES INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad: "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight" From 0c1ba99cecd7b5baf7033eb040ff2e5ccecea2c9 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Thu, 7 Nov 2024 12:20:28 +0300 Subject: [PATCH 3/9] Remove .git-branches.toml --- CHANGELOG.md | 2 ++ {{ cookiecutter.name }}/.git-branches.toml | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 {{ cookiecutter.name }}/.git-branches.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f116a..5be989a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [3.0] - TBA ### Changed - Обновлена версия Swift до 6.0 +### Removed +- Удален .git-branches.toml ### Removed - Полностью удалена зависимость от SwiftGen diff --git a/{{ cookiecutter.name }}/.git-branches.toml b/{{ cookiecutter.name }}/.git-branches.toml deleted file mode 100644 index 9a7b97a..0000000 --- a/{{ cookiecutter.name }}/.git-branches.toml +++ /dev/null @@ -1,12 +0,0 @@ -push-new-branches = false -ship-delete-tracking-branch = true -sync-upstream = false - -[branches] -main = "develop" -perennials = ["main"] -perennial-regex = "" - -[sync-strategy] -feature-branches = "merge" -perennial-branches = "rebase" From b894bea4a832673e1b6431e86a8cf06cdacfaefb Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Thu, 7 Nov 2024 12:28:19 +0300 Subject: [PATCH 4/9] Add .mise.toml --- hooks/post_gen_project.sh | 2 +- {{ cookiecutter.name }}/.mise.toml | 7 +++++++ {{ cookiecutter.name }}/hooks/post-checkout | 3 --- {{ cookiecutter.name }}/hooks/pre-commit | 3 --- 4 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 {{ cookiecutter.name }}/.mise.toml delete mode 100755 {{ cookiecutter.name }}/hooks/post-checkout delete mode 100755 {{ cookiecutter.name }}/hooks/pre-commit diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index a599b1b..3480ede 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -23,4 +23,4 @@ git init git add . git commit -m "Initial commit" -make hooks +mise generate pre-commit diff --git a/{{ cookiecutter.name }}/.mise.toml b/{{ cookiecutter.name }}/.mise.toml new file mode 100644 index 0000000..efd139c --- /dev/null +++ b/{{ cookiecutter.name }}/.mise.toml @@ -0,0 +1,7 @@ +[tasks] +lint = "swiftformat GrowFood --lint" +fmt = "swiftformat GrowFood" + +[tools] +xcodes = "1.5.0" +"spm:nicklockwood/SwiftFormat" = "0.54.6" diff --git a/{{ cookiecutter.name }}/hooks/post-checkout b/{{ cookiecutter.name }}/hooks/post-checkout deleted file mode 100755 index e3ef77e..0000000 --- a/{{ cookiecutter.name }}/hooks/post-checkout +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -make project diff --git a/{{ cookiecutter.name }}/hooks/pre-commit b/{{ cookiecutter.name }}/hooks/pre-commit deleted file mode 100755 index aeb4b9c..0000000 --- a/{{ cookiecutter.name }}/hooks/pre-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -make lint From b585f4f085b23a461c8a17f370454e90d57db992 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Thu, 7 Nov 2024 12:43:57 +0300 Subject: [PATCH 5/9] Remove Podfile --- CHANGELOG.md | 1 + {{ cookiecutter.name }}/Makefile | 12 +----------- {{ cookiecutter.name }}/Podfile | 11 ----------- 3 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 {{ cookiecutter.name }}/Podfile diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be989a..f7bc5c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Обновлена версия Swift до 6.0 ### Removed - Удален .git-branches.toml +- Удален Podfile ### Removed - Полностью удалена зависимость от SwiftGen diff --git a/{{ cookiecutter.name }}/Makefile b/{{ cookiecutter.name }}/Makefile index 333fb13..b280630 100644 --- a/{{ cookiecutter.name }}/Makefile +++ b/{{ cookiecutter.name }}/Makefile @@ -3,21 +3,11 @@ SWIFTFORMAT = Pods/SwiftFormat/CommandLineTool/swiftformat .PHONY: all all: test -.PHONY: pods -## pods: Download project packages -pods: gems - bundle exec pod install - .PHONY: project ## project: Generate .xcodeproj file using XcodeGen utility -project: gems +project: mint run "yonaskolb/XcodeGen@2.38.0" -.PHONY: gems -## gems: Install ruby dependencies -gems: - bundle install - .PHONY: fmt ## fmt: Launch swift files code formatter fmt: diff --git a/{{ cookiecutter.name }}/Podfile b/{{ cookiecutter.name }}/Podfile deleted file mode 100644 index 40118b2..0000000 --- a/{{ cookiecutter.name }}/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -platform :ios, '{{ cookiecutter.deployment_target }}' - -inhibit_all_warnings! - -target '{{ cookiecutter.name | lower }}' do - pod 'SwiftFormat/CLI', '~> 0.54' - - target '{{ cookiecutter.name | lower }}Tests' do - inherit! :search_paths - end -end From 595512d7b2fdab010a9b6f179a3bdbfd6aeb7ef6 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Fri, 8 Nov 2024 09:28:07 +0300 Subject: [PATCH 6/9] Edit github actions --- .github/workflows/generate.yml | 12 +++++------- README.md | 4 ++-- hooks/post_gen_project.sh | 14 ++++++-------- {{ cookiecutter.name }}/.mise.toml | 7 ++++--- {{ cookiecutter.name }}/.ruby-version | 1 - {{ cookiecutter.name }}/Gemfile | 3 --- {{ cookiecutter.name }}/project.yml | 1 - .../Extensions/UIViewController+Keyboard.swift | 2 +- 8 files changed, 18 insertions(+), 26 deletions(-) delete mode 100644 {{ cookiecutter.name }}/.ruby-version delete mode 100644 {{ cookiecutter.name }}/Gemfile diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index cb9be4f..a2d92d5 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -4,19 +4,17 @@ on: [push] jobs: test: - runs-on: macos-14 - env: - MINT_PATH: "~/mint_cache" + runs-on: macos-15 steps: - uses: actions/checkout@v1 - name: Generate project and run tests run: | - export PATH=~/.rbenv/shims:"$PATH" - - brew install cookiecutter rbenv mint fastlane && - rbenv install 3.0.6 && + brew install cookiecutter mise fastlane && + mise settings set experimental true && + mise activate --shims && cookiecutter --no-input -f . && cd Project && + mise install && fastlane scan diff --git a/README.md b/README.md index 2133642..b62c6c8 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ Here are some of the key features of this project template: ### Prerequisites -Make sure that `cookiecutter` and `mint` tools are installed. Preferred way to make it is using homebrew. +Make sure that `cookiecutter` and `mise` tools are installed. Preferred way to make it is using homebrew. ```sh -brew install cookiecutter mint +brew install cookiecutter mise ``` ### Bootstrap a new project diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index 3480ede..79cac0a 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -1,20 +1,18 @@ #!/bin/sh +# Install all dependencies +mise install + # Generate xcodeproj file -make project +mise exec -- xcodegen # Download .gitignore file curl -L 'https://www.gitignore.io/api/swift,macos,fastlane' > .gitignore -echo '.cache' >> .gitignore {% if cookiecutter.ignore_xcproject == "Yes" %} echo '{{ cookiecutter.name }}.xcodeproj' >> .gitignore - echo '{{ cookiecutter.name }}.xcworkspace' >> .gitignore {% endif %} -echo 'Pods' >> .gitignore - -make fmt -make gems +mise run fmt # Stamp current version of xcode in .xcode-version file xcodebuild -version | sed 's/Xcode //' | head -n 1 > .xcode-version @@ -23,4 +21,4 @@ git init git add . git commit -m "Initial commit" -mise generate pre-commit +mise generate git-pre-commit --write diff --git a/{{ cookiecutter.name }}/.mise.toml b/{{ cookiecutter.name }}/.mise.toml index efd139c..96e008d 100644 --- a/{{ cookiecutter.name }}/.mise.toml +++ b/{{ cookiecutter.name }}/.mise.toml @@ -1,7 +1,8 @@ [tasks] -lint = "swiftformat GrowFood --lint" -fmt = "swiftformat GrowFood" +pre-commit = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests --lint" +fmt = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests" [tools] xcodes = "1.5.0" -"spm:nicklockwood/SwiftFormat" = "0.54.6" +swiftformat = "0.54.6" +xcodegen = "latest" diff --git a/{{ cookiecutter.name }}/.ruby-version b/{{ cookiecutter.name }}/.ruby-version deleted file mode 100644 index 818bd47..0000000 --- a/{{ cookiecutter.name }}/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.0.6 diff --git a/{{ cookiecutter.name }}/Gemfile b/{{ cookiecutter.name }}/Gemfile deleted file mode 100644 index d45950f..0000000 --- a/{{ cookiecutter.name }}/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'cocoapods', '~> 1.15.0' diff --git a/{{ cookiecutter.name }}/project.yml b/{{ cookiecutter.name }}/project.yml index cd637df..28f4b06 100644 --- a/{{ cookiecutter.name }}/project.yml +++ b/{{ cookiecutter.name }}/project.yml @@ -1,6 +1,5 @@ name: {{ cookiecutter.name }} options: - postGenCommand: "make pods" deploymentTarget: iOS: {{ cookiecutter.deployment_target }} developmentLanguage: ru diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Extensions/UIViewController+Keyboard.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Extensions/UIViewController+Keyboard.swift index 52795bb..f9994e7 100644 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Extensions/UIViewController+Keyboard.swift +++ b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Extensions/UIViewController+Keyboard.swift @@ -1,5 +1,6 @@ import UIKit +@MainActor private let kHideKeyboardDelegate = HideKeyboardDelegate() private class HideKeyboardDelegate: NSObject, UIGestureRecognizerDelegate { @@ -20,4 +21,3 @@ extension UIViewController { view.addGestureRecognizer(tapGesture) } } - From f99dd5e0d714bc2328697a8718f7378f2bc110c3 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Mon, 11 Nov 2024 14:44:20 +0300 Subject: [PATCH 7/9] Remove Makefile --- CHANGELOG.md | 1 + hooks/post_gen_project.sh | 2 +- {{ cookiecutter.name }}/.mise.toml | 3 ++- {{ cookiecutter.name }}/Makefile | 37 ------------------------------ 4 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 {{ cookiecutter.name }}/Makefile diff --git a/CHANGELOG.md b/CHANGELOG.md index f7bc5c0..b79ec09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Removed - Удален .git-branches.toml - Удален Podfile +- Удален Makefile, проект мигрирован на использование mise ### Removed - Полностью удалена зависимость от SwiftGen diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index 79cac0a..b5fa26f 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -4,7 +4,7 @@ mise install # Generate xcodeproj file -mise exec -- xcodegen +mise run project # Download .gitignore file curl -L 'https://www.gitignore.io/api/swift,macos,fastlane' > .gitignore diff --git a/{{ cookiecutter.name }}/.mise.toml b/{{ cookiecutter.name }}/.mise.toml index 96e008d..0170973 100644 --- a/{{ cookiecutter.name }}/.mise.toml +++ b/{{ cookiecutter.name }}/.mise.toml @@ -1,8 +1,9 @@ [tasks] pre-commit = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests --lint" fmt = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests" +project = "xcodegen" [tools] xcodes = "1.5.0" swiftformat = "0.54.6" -xcodegen = "latest" +xcodegen = "2.38.0" diff --git a/{{ cookiecutter.name }}/Makefile b/{{ cookiecutter.name }}/Makefile deleted file mode 100644 index b280630..0000000 --- a/{{ cookiecutter.name }}/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -SWIFTFORMAT = Pods/SwiftFormat/CommandLineTool/swiftformat - -.PHONY: all -all: test - -.PHONY: project -## project: Generate .xcodeproj file using XcodeGen utility -project: - mint run "yonaskolb/XcodeGen@2.38.0" - -.PHONY: fmt -## fmt: Launch swift files code formatter -fmt: - $(SWIFTFORMAT) {{ cookiecutter.name }} {{ cookiecutter.name }}Tests - -.PHONY: lint -## lint: Launch swift files linter check -lint: - $(SWIFTFORMAT) {{ cookiecutter.name }} {{ cookiecutter.name }}Tests --lint - -GIT_HOOKS_SCRIPTS := $(wildcard hooks/*) - -.PHONY: hooks -## hooks: Install git pre-commit hook -hooks: - $(foreach file,$(GIT_HOOKS_SCRIPTS),ln -sf ../../$(file) .git/$(file); chmod +x .git/$(file);) - -.PHONY: clean -## clean: Clean up project files -clean: - rm -fr .cache .build Pods - -.PHONY: help -## help: Prints help message -help: - @echo "Usage: \n" - @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' | sort From badb7b09a8c1b3b5d9f0abf8a9516932d4937fa5 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Mon, 11 Nov 2024 14:50:04 +0300 Subject: [PATCH 8/9] Remove Fonts generated file --- .../{{ cookiecutter.name }}/Classes/Generated/Fonts.swift | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 {{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Generated/Fonts.swift diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Generated/Fonts.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Generated/Fonts.swift deleted file mode 100644 index e69de29..0000000 From be8d1da7e18322181dda1ce0e63d57dde151cb74 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Mon, 11 Nov 2024 14:52:41 +0300 Subject: [PATCH 9/9] Update CHANGELOG.md --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b79ec09..848b820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,6 @@ - Удален .git-branches.toml - Удален Podfile - Удален Makefile, проект мигрирован на использование mise - -### Removed - Полностью удалена зависимость от SwiftGen ## [2.5.0] - 2024-10-16