Compare commits

...

1 Commits

Author SHA1 Message Date
Ivan Smolin c64434026c update template project 2021-07-21 14:29:04 +03:00
13 changed files with 66 additions and 89 deletions

View File

@ -8,7 +8,7 @@ function generate {
RESULT_PATH=$3 RESULT_PATH=$3
echo $PARAMS > data.yml echo $PARAMS > data.yml
mustache data.yml $TEMPLATE_PATH > $RESULT_PATH bundle exec mustache data.yml $TEMPLATE_PATH > $RESULT_PATH
rm data.yml rm data.yml
} }
@ -17,7 +17,7 @@ readonly PROJECTS_PATH=$1
readonly PROJECT_NAME=$2 readonly PROJECT_NAME=$2
readonly PROJECT_NAME_WITH_PREFIX=$2-ios readonly PROJECT_NAME_WITH_PREFIX=$2-ios
readonly COMMON_REPO_NAME=${3:-$2-common} readonly COMMON_REPO_NAME=${3:-$2-common}
readonly DEPLOYMENT_TARGET="12.0" readonly DEPLOYMENT_TARGET="13.0"
readonly CURRENT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) readonly CURRENT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
readonly TEMPLATES=$CURRENT_DIR/templates readonly TEMPLATES=$CURRENT_DIR/templates
readonly MATCH_PASSWORD=`pwgen 8 1` readonly MATCH_PASSWORD=`pwgen 8 1`
@ -60,7 +60,6 @@ done
# install required gems & brews # install required gems & brews
cp $CURRENT_DIR/sources/Gemfile Gemfile cp $CURRENT_DIR/sources/Gemfile Gemfile
cp $CURRENT_DIR/sources/Gemfile.lock Gemfile.lock
cp $CURRENT_DIR/sources/Brewfile Brewfile cp $CURRENT_DIR/sources/Brewfile Brewfile
gem install bundler gem install bundler
@ -138,7 +137,7 @@ generate "{project_name: $PROJECT_NAME}" $TEMPLATES/README.mustache README.md
git submodule add git@github.com:TouchInstinct/$COMMON_REPO_NAME.git common git submodule add git@github.com:TouchInstinct/$COMMON_REPO_NAME.git common
git submodule add git@github.com:TouchInstinct/BuildScripts.git build-scripts git submodule add git@github.com:TouchInstinct/BuildScripts.git build-scripts
git submodule update --init git submodule update --init --recursive --remote
# final clean up # final clean up
rm project.yml rm project.yml
@ -147,12 +146,6 @@ rm project.yml
cp $CURRENT_DIR/additional/Brewfile Brewfile cp $CURRENT_DIR/additional/Brewfile Brewfile
brew bundle brew bundle
#copy package for firebase
cp $CURRENT_DIR/sources/package.json package.json
#yarn
yarn install
# copy setup, install and update commands # copy setup, install and update commands
cp $CURRENT_DIR/sources/setup.command setup.command cp $CURRENT_DIR/sources/setup.command setup.command
cp $CURRENT_DIR/sources/install_dependencies.command install_dependencies.command cp $CURRENT_DIR/sources/install_dependencies.command install_dependencies.command

View File

@ -2,7 +2,7 @@ Analytics
Cells Cells
Controllers Controllers
Extensions Extensions
Generated ../Generated
Networking Networking
Protocols Protocols
Resources/Localization Resources/Localization

View File

@ -1,3 +1,4 @@
tap "yonaskolb/XcodeGen", "https://github.com/yonaskolb/XcodeGen.git" brew "imagemagick"
brew "pmd"
brew "XcodeGen" brew "xcodegen"
brew "gettext"

View File

@ -4,6 +4,7 @@ git_source(:github) { |repo| "https://github.com/strongself/Generamba.git" }
gem "cocoapods" gem "cocoapods"
gem "fastlane" gem "fastlane"
gem 'generamba', github: 'strongself/develop' gem 'generamba', github: 'strongself/develop'
gem "mustache"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path) eval_gemfile(plugins_path) if File.exist?(plugins_path)

View File

@ -0,0 +1,13 @@
# When you run Git from the command line, it runs in the environment as set up by your Shell.
# GUI OS X apps, however, have no knowledge about your shell - and the PATH environment can be changed in many different places.
# Export our profile with path by ourselves
function source_home_file {
file="$HOME/$1"
[[ -f "${file}" ]] && source "${file}"
}
# Use specific exec due to Xcode has custom value of $PATH
if [ -z "$(which pmd)" ]; then
source_home_file ".bash_profile" || source_home_file ".zshrc" || true
fi

View File

@ -4,3 +4,4 @@
gem 'fastlane-plugin-firebase_app_distribution' gem 'fastlane-plugin-firebase_app_distribution'
gem 'fastlane-plugin-badge' gem 'fastlane-plugin-badge'
gem 'fastlane-plugin-xcodegen'

View File

@ -1,5 +0,0 @@
{
"dependencies": {
"firebase-tools": "^7.12.1"
}
}

View File

@ -1,4 +1,5 @@
import UIKit import UIKit
import Firebase
@UIApplicationMain @UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate { final class AppDelegate: UIResponder, UIApplicationDelegate {
@ -26,7 +27,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseConfigurator.configure() FirebaseApp.configure()
return true return true
} }
} }

View File

@ -1,31 +0,0 @@
import Firebase
enum FirebaseConfigurator {
private static var resourceName: String {
#if APPSTORE
return "AppStore-GoogleService-Info"
#elseif ENTERPRISE
return "Enterprise-GoogleService-Info"
#elseif STANDARD
return "Standard-GoogleService-Info"
#else
assertionFailure("There is no right plist file")
return .empty
#endif
}
static func configure() {
guard let filePath = Bundle.main.path(forResource: resourceName, ofType: .fileExtension),
let options = FirebaseOptions(contentsOfFile: filePath) else {
return
}
FirebaseApp.configure(options: options)
}
}
// MARK: - Constants
private extension String {
static let fileExtension = "plist"
}

View File

@ -1,7 +0,0 @@
import UIKit
enum NavigationService {
static var appWindow: UIWindow {
return AppDelegate.shared.appWindow
}
}

View File

@ -1,5 +1,5 @@
source 'https://cdn.cocoapods.org/' source 'https://cdn.cocoapods.org/'
source 'git@github.com:TouchInstinct/Podspecs' source 'https://github.com/TouchInstinct/Podspecs.git'
platform :ios, '{{deployment_target}}' platform :ios, '{{deployment_target}}'
@ -21,22 +21,9 @@ target '{{project_name}}' do
pod 'Firebase/Performance' pod 'Firebase/Performance'
pod 'Firebase/Analytics' # for Firebase/Performance pod 'Firebase/Analytics' # for Firebase/Performance
# Rx
pod 'RxKeyboard', '1.0.0'
# Security
pod 'KeychainAccess'
# Utils # Utils
pod 'LeadKit'
pod 'DeviceKit' pod 'DeviceKit'
# Layout
pod 'SnapKit'
# UI
pod 'TableKit'
end end
# fixes Xcode 12 warnings: # fixes Xcode 12 warnings:

View File

@ -92,9 +92,9 @@ iOSInjectionProject/
# homebrew-bundle # homebrew-bundle
Brewfile.lock.json Brewfile.lock.json
# Node.js # Ruby gems
# Dependency directories # Dependency directories
node_modules/ *.gem
# Touch Instinct custom # Touch Instinct custom
Downloads/ Downloads/

View File

@ -2,7 +2,7 @@ name: {{project_name}}
options: options:
createIntermediateGroups: true createIntermediateGroups: true
xcodeVersion: 11.0 xcodeVersion: 12.2
usesTabs: false usesTabs: false
indentWidth: 4 indentWidth: 4
deploymentTarget: deploymentTarget:
@ -13,8 +13,32 @@ configs:
Release: release Release: release
Debug: debug Debug: debug
packages:
TICoordinatorKit:
url: https://github.com/TouchInstinct/TICoordinatorKit
version: 1.1.6
LeadKit:
url: https://github.com/TouchInstinct/LeadKit
version: 1.4.0
SnapKit:
url: https://github.com/SnapKit/SnapKit
version: 5.0.1
targets: targets:
{{project_name}}: {{project_name}}:
dependencies:
- package: LeadKit
product: TISwiftUtils
- package: LeadKit
product: TIFoundationUtils
- package: LeadKit
product: TIKeychainUtils
- package: LeadKit
product: TIUIKitCore
- package: LeadKit
product: TIUIElements
- package: LeadKit
product: TITableKitUtils
settings: settings:
base: base:
SWIFT_VERSION: 5.0 SWIFT_VERSION: 5.0
@ -32,10 +56,6 @@ targets:
GOOGLE_SERVICE_INFO_PLIST_PATH: $(SRCROOT)/$(TARGET_NAME)/Resources/AppStore-GoogleService-Info.plist GOOGLE_SERVICE_INFO_PLIST_PATH: $(SRCROOT)/$(TARGET_NAME)/Resources/AppStore-GoogleService-Info.plist
type: application type: application
platform: iOS platform: iOS
postbuildScripts:
- script: "\"${PODS_ROOT}/FirebaseCrashlytics/run\" --google-service-plist ${GOOGLE_SERVICE_INFO_PLIST_PATH}"
name: Firebase
runOnlyWhenInstalling: true
sources: sources:
- path: {{project_name}} - path: {{project_name}}
excludes: excludes:
@ -50,7 +70,7 @@ targets:
buildPhase: sources buildPhase: sources
- path: {{project_name}}/Extensions - path: {{project_name}}/Extensions
buildPhase: sources buildPhase: sources
- path: {{project_name}}/Generated - path: Generated
buildPhase: sources buildPhase: sources
- path: {{project_name}}/Networking - path: {{project_name}}/Networking
buildPhase: sources buildPhase: sources
@ -70,13 +90,13 @@ aggregateTargets:
buildScripts: buildScripts:
- name: Localization - name: Localization
script: | script: |
readonly PRODUCT_NAME={{project_name}} readonly PRODUCT_NAME="{{project_name}}"
. build-scripts/xcode/build_phases/localization.sh . build-scripts/xcode/build_phases/localization.sh
inputFiles: inputFiles:
- $(SRCROOT)/common/strings/default_common_strings_ru.json - $(SRCROOT)/common/strings/default_common_strings_ru.json
- name: API Generator - name: API Generator
script: . build-scripts/xcode/build_phases/api_generator.sh 1.4.0-alpha3 {{project_name}}/Generated script: #. build-scripts/xcode/build_phases/api_generator.sh 1.4.0-alpha3 {{project_name}}/Generated
- name: License List - name: License List
script: | script: |
@ -90,10 +110,10 @@ aggregateTargets:
readonly PODS_ROOT="${SRCROOT}/Pods" readonly PODS_ROOT="${SRCROOT}/Pods"
. ${SRCROOT}/build_phases/check_pods_manifest.sh . ${SRCROOT}/build_phases/check_pods_manifest.sh
inputFiles: inputFiles:
- ${SRCROOT}/Podfile.lock - ${SRCROOT}/Podfile.lock
- ${PODS_ROOT}/Manifest.lock - ${PODS_ROOT}/Manifest.lock
outputFiles: outputFiles:
- $(DERIVED_FILE_DIR)/Pods-Ubrd-checkManifestLockResult.txt - $(DERIVED_FILE_DIR)/Pods-Ubrd-checkManifestLockResult.txt
- name: Swiftlint - name: Swiftlint
script: | script: |
@ -101,16 +121,14 @@ aggregateTargets:
readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases" readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases"
. ${SCRIPT_DIR}/swiftlint.sh . ${SCRIPT_DIR}/swiftlint.sh
inputFileLists: inputFileLists:
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist - $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
basedOnDependencyAnalysis: false
- name: CopyPaste Detection - name: CopyPaste Detection
script: | script: |
readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases" readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases"
. build-scripts/xcode/build_phases/copy_paste_detection.sh Localization Generated Pods . build-scripts/xcode/build_phases/copy_paste_detection.sh Localization Generated Pods
inputFileLists: inputFileLists:
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist - $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
basedOnDependencyAnalysis: false
UnusedDetection: UnusedDetection:
buildScripts: buildScripts:
@ -118,6 +136,11 @@ aggregateTargets:
script: . build-scripts/xcode/build_phases/unused.sh script: . build-scripts/xcode/build_phases/unused.sh
schemes: schemes:
{{project_name}}:
build:
targets:
{{project_name}}: all
CodeGen: CodeGen:
build: build:
targets: targets: