From 34dcae1d5cad13d8a0d587e87898e82f89c52714 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Mon, 16 Jan 2023 12:22:21 +0300 Subject: [PATCH 1/6] Common `Makefile` indentations converted to tabs --- xcode/bootstrap/Makefile | 80 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/xcode/bootstrap/Makefile b/xcode/bootstrap/Makefile index 31fa135..7894911 100644 --- a/xcode/bootstrap/Makefile +++ b/xcode/bootstrap/Makefile @@ -12,75 +12,75 @@ install_pods=(bundle exec pod install || bundle exec pod install --repo-update) TARGET_MAX_CHAR_NUM=20 ## Show help help: - @echo '' - @echo 'Использование:' - @echo ' ${YELLOW}make${RESET} ${GREEN}${RESET}' - @echo '' - @echo 'Команды:' - @awk '/^[a-zA-Z\-\_0-9]+:/ { \ - helpMessage = match(lastLine, /^## (.*)/); \ - if (helpMessage) { \ - helpCommand = substr($$1, 0, index($$1, ":")-1); \ - helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ - printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \ - } \ - } \ - { lastLine = $$0 }' $(MAKEFILE_LIST) + @echo '' + @echo 'Использование:' + @echo ' ${YELLOW}make${RESET} ${GREEN}${RESET}' + @echo '' + @echo 'Команды:' + @awk '/^[a-zA-Z\-\_0-9]+:/ { \ + helpMessage = match(lastLine, /^## (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ + printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) ## Инициализирует проект и устанавливает системные утилиты init: - brew bundle + brew bundle - eval "$(rbenv init -)" + eval "$(rbenv init -)" - rbenv install -s ${RUBY_VERSION} - rbenv global ${RUBY_VERSION} + rbenv install -s ${RUBY_VERSION} + rbenv global ${RUBY_VERSION} - if ! gem spec bundler > /dev/null 2>&1; then\ - echo "bundler gem is not installed!";\ - -sudo gem install bundler;\ - fi + if ! gem spec bundler > /dev/null 2>&1; then\ + echo "bundler gem is not installed!";\ + -sudo gem install bundler;\ + fi - bundle install + bundle install - xcodegen + xcodegen - $(call install_pods) + $(call install_pods) - bundle exec fastlane install_plugins + bundle exec fastlane install_plugins - $(call install_dev_certs) + $(call install_dev_certs) - $(call open_project) + $(call open_project) - git config --local core.hooksPath .githooks - + git config --local core.hooksPath .githooks + ## Устанавливает поды pod: - $(call install_pods) + $(call install_pods) ## Устанавливает сертификат и профили для запуска на девайсе dev_certs: - $(call install_dev_certs) + $(call install_dev_certs) ## Открывает папку для ручного редактирования сертификатов и профайлов update_certs: - bundle exec fastlane ManuallyUpdateCodeSigning + bundle exec fastlane ManuallyUpdateCodeSigning ## Поднимает версию приложения (параметр "X.Y.Z") bumpAppVersion: - ifeq ($(version),undefined) - @echo "Version parameter is missing (ex: x.y.z)" $(target) - else - bundle exec fastlane run increment_version_number version_number:$(version) - endif + ifeq ($(version),undefined) + @echo "Version parameter is missing (ex: x.y.z)" $(target) + else + bundle exec fastlane run increment_version_number version_number:$(version) + endif ## Позволяет быстро открыть workspace проекта start: - $(call open_project) + $(call open_project) ## Очищает содержимое папки DerivedData clean: - rm -rf ~/Library/Developer/Xcode/DerivedData/* + rm -rf ~/Library/Developer/Xcode/DerivedData/* From 4d7182fd675bc267c76a8eb24572f85305fb6a6f Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 14:33:55 +0000 Subject: [PATCH 2/6] issue-333 last commit date --- scripts/export_src.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 11a5290..86e8e9f 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -19,8 +19,12 @@ if [ -z "${GIT_BRANCH}" ]; then GIT_BRANCH="master" fi +if [ -z "${EXPORT_DATE}" ]; then + EXPORT_DATE=$(env -i git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d') +fi + PROJECT_NAME=$1 -SRC_FOLDER_NAME="${PROJECT_NAME}-src-$(date +%F)" +SRC_FOLDER_NAME="${PROJECT_NAME}-src-${EXPORT_DATE}" SRC_DIR="./${SRC_FOLDER_NAME}" COMMAND_LINE_ARGUMENTS=$@ From c5b794752600b22e23500d89f395ce8e954d6116 Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 14:52:02 +0000 Subject: [PATCH 3/6] issue-333 use git archive --- scripts/export_src.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 86e8e9f..f9b8c07 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -48,6 +48,6 @@ do done find . -name ".git*" -print0 | xargs -0 rm -rf -zip -r -q ${SRC_FOLDER_NAME}.zip . +git archive -o ${SRC_FOLDER_NAME}.zip HEAD open . From 84db8a0e092a54d49f2149fc5206c8a4da8444d5 Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 15:13:10 +0000 Subject: [PATCH 4/6] issue-333 fix --- scripts/export_src.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index f9b8c07..5ad69e8 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -47,7 +47,6 @@ do fi done -find . -name ".git*" -print0 | xargs -0 rm -rf git archive -o ${SRC_FOLDER_NAME}.zip HEAD open . From 216c2288982b022601acb16155768b17239507cd Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Tue, 7 Mar 2023 11:07:27 +0000 Subject: [PATCH 5/6] last commit date --- scripts/export_src.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 5ad69e8..f09b432 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -19,12 +19,9 @@ if [ -z "${GIT_BRANCH}" ]; then GIT_BRANCH="master" fi -if [ -z "${EXPORT_DATE}" ]; then - EXPORT_DATE=$(env -i git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d') -fi - +LAST_COMMIT_DATE="" PROJECT_NAME=$1 -SRC_FOLDER_NAME="${PROJECT_NAME}-src-${EXPORT_DATE}" +SRC_FOLDER_NAME="${PROJECT_NAME}-src" SRC_DIR="./${SRC_FOLDER_NAME}" COMMAND_LINE_ARGUMENTS=$@ @@ -32,8 +29,17 @@ COMMAND_LINE_ARGUMENTS=$@ clone_platform() { PROJECT_NAME=$1 PLATFORM=$2 - - git clone --recurse-submodules -j8 "git@github.com:TouchInstinct/${PROJECT_NAME}-${PLATFORM}.git" --branch "${GIT_BRANCH}" + + if git clone --recurse-submodules -j8 "git@gitlab.ti:touchinstinct/${PROJECT_NAME}-${PLATFORM}.git" --branch "${GIT_BRANCH}"; then + cd ${PROJECT_NAME}-${PLATFORM} + + COMMIT_DATE=`git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d'` + if [[ $LAST_COMMIT_DATE < $COMMIT_DATE ]]; then + LAST_COMMIT_DATE="${COMMIT_DATE}" + fi + + cd .. + fi } mkdir -p "${SRC_DIR}" @@ -47,6 +53,11 @@ do fi done -git archive -o ${SRC_FOLDER_NAME}.zip HEAD +if [ -z "${EXPORT_DATE}" ]; then + EXPORT_DATE="${LAST_COMMIT_DATE}" +fi + +find . -name ".git*" -print0 | xargs -0 rm -rf +zip -r -q "${SRC_FOLDER_NAME}-${EXPORT_DATE}".zip . open . From 0400dbe36db6f6f12118f09f54b2022e880ad7dd Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Tue, 7 Mar 2023 16:26:54 +0000 Subject: [PATCH 6/6] issue-333 break on git clone error --- scripts/export_src.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index f09b432..0267c66 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -39,6 +39,8 @@ clone_platform() { fi cd .. + else + exit 1 fi }