Compare commits

..

No commits in common. "feature/update_template_project" and "master" have entirely different histories.

13 changed files with 89 additions and 66 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -1,13 +0,0 @@
# 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,4 +4,3 @@
gem 'fastlane-plugin-firebase_app_distribution'
gem 'fastlane-plugin-badge'
gem 'fastlane-plugin-xcodegen'

5
sources/package.json Normal file
View File

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

View File

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

View File

@ -0,0 +1,31 @@
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

@ -0,0 +1,7 @@
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://github.com/TouchInstinct/Podspecs.git'
source 'git@github.com:TouchInstinct/Podspecs'
platform :ios, '{{deployment_target}}'
@ -21,9 +21,22 @@ target '{{project_name}}' do
pod 'Firebase/Performance'
pod 'Firebase/Analytics' # for Firebase/Performance
# Rx
pod 'RxKeyboard', '1.0.0'
# Security
pod 'KeychainAccess'
# Utils
pod 'LeadKit'
pod 'DeviceKit'
# Layout
pod 'SnapKit'
# UI
pod 'TableKit'
end
# fixes Xcode 12 warnings:

View File

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

View File

@ -2,7 +2,7 @@ name: {{project_name}}
options:
createIntermediateGroups: true
xcodeVersion: 12.2
xcodeVersion: 11.0
usesTabs: false
indentWidth: 4
deploymentTarget:
@ -13,32 +13,8 @@ configs:
Release: release
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:
{{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:
base:
SWIFT_VERSION: 5.0
@ -56,6 +32,10 @@ targets:
GOOGLE_SERVICE_INFO_PLIST_PATH: $(SRCROOT)/$(TARGET_NAME)/Resources/AppStore-GoogleService-Info.plist
type: application
platform: iOS
postbuildScripts:
- script: "\"${PODS_ROOT}/FirebaseCrashlytics/run\" --google-service-plist ${GOOGLE_SERVICE_INFO_PLIST_PATH}"
name: Firebase
runOnlyWhenInstalling: true
sources:
- path: {{project_name}}
excludes:
@ -70,7 +50,7 @@ targets:
buildPhase: sources
- path: {{project_name}}/Extensions
buildPhase: sources
- path: Generated
- path: {{project_name}}/Generated
buildPhase: sources
- path: {{project_name}}/Networking
buildPhase: sources
@ -90,13 +70,13 @@ aggregateTargets:
buildScripts:
- name: Localization
script: |
readonly PRODUCT_NAME="{{project_name}}"
readonly PRODUCT_NAME={{project_name}}
. build-scripts/xcode/build_phases/localization.sh
inputFiles:
- $(SRCROOT)/common/strings/default_common_strings_ru.json
- 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
script: |
@ -110,10 +90,10 @@ aggregateTargets:
readonly PODS_ROOT="${SRCROOT}/Pods"
. ${SRCROOT}/build_phases/check_pods_manifest.sh
inputFiles:
- ${SRCROOT}/Podfile.lock
- ${PODS_ROOT}/Manifest.lock
- ${SRCROOT}/Podfile.lock
- ${PODS_ROOT}/Manifest.lock
outputFiles:
- $(DERIVED_FILE_DIR)/Pods-Ubrd-checkManifestLockResult.txt
- $(DERIVED_FILE_DIR)/Pods-Ubrd-checkManifestLockResult.txt
- name: Swiftlint
script: |
@ -121,14 +101,16 @@ aggregateTargets:
readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases"
. ${SCRIPT_DIR}/swiftlint.sh
inputFileLists:
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
basedOnDependencyAnalysis: false
- name: CopyPaste Detection
script: |
readonly SCRIPT_DIR="${SRCROOT}/build-scripts/xcode/build_phases"
. build-scripts/xcode/build_phases/copy_paste_detection.sh Localization Generated Pods
inputFileLists:
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
- $(SRCROOT)/build_phases/code_lint_folders.xcfilelist
basedOnDependencyAnalysis: false
UnusedDetection:
buildScripts:
@ -136,11 +118,6 @@ aggregateTargets:
script: . build-scripts/xcode/build_phases/unused.sh
schemes:
{{project_name}}:
build:
targets:
{{project_name}}: all
CodeGen:
build:
targets: