From fa0837aeb6620a94bb0fdf874014585ba2e8a4c8 Mon Sep 17 00:00:00 2001 From: Igor Kislyuk Date: Wed, 28 Mar 2018 19:48:01 +0300 Subject: [PATCH] Update script for pods, submodules and groups creation --- bootstrap.sh | 19 +++++------ templates/Info.mustache | 2 +- .../{mvvm-swift/Podfile => Podfile.mustache} | 15 +++++---- templates/project.mustache | 32 +++++++++---------- 4 files changed, 33 insertions(+), 35 deletions(-) rename templates/{mvvm-swift/Podfile => Podfile.mustache} (63%) diff --git a/bootstrap.sh b/bootstrap.sh index 8a857e2..c9e4510 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,6 +13,7 @@ function generate { PROJECT_NAME=$1 PROJECTS_PATH=$2 COMMON_REPO_NAME=$3 +DEPLOYMENT_TARGET="10.0" CURRENT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) TEMPLATES=$CURRENT_DIR/templates @@ -39,9 +40,8 @@ mkdir $PROJECT_NAME # copy files cp -R $RESOURCES/. $PROJECT_NAME - -generate "{ name: $PROJECT_NAME }" $TEMPLATES/project.mustache project.yml -generate "{ name: $PROJECT_NAME }" $TEMPLATES/Info.mustache $PROJECT_NAME/Info.plist +generate "{ project_name: $PROJECT_NAME, deployment_target: $DEPLOYMENT_TARGET }" $TEMPLATES/project.mustache project.yml +generate "{ project_name: $PROJECT_NAME }" $TEMPLATES/Info.mustache $PROJECT_NAME/Info.plist # generate xcode project file echo "Generate xcodeproj file..." @@ -49,22 +49,19 @@ xcodegen # default to `project.yml` # install pods -pod init +generate "{ project_name: $PROJECT_NAME, deployment_target: $DEPLOYMENT_TARGET }" $TEMPLATES/Podfile.mustache Podfile pod install # configure submodules -# git submodule add --name common git@github.com:TouchInstinct/$COMMON_REPO_NAME.git -# git submodule add --name build-scripts git@github.com:TouchInstinct/BuildScripts.git -# -# git submodule update --init +git submodule add --name common git@github.com:TouchInstinct/$COMMON_REPO_NAME.git +git submodule add --name build-scripts git@github.com:TouchInstinct/BuildScripts.git -# do some stuff with provision profiles +git submodule update --init # enable shared scheme # final clean up -#### rm $PROJECT_CONFIG_FILENAME -#### rm $PROJECT_XCODEGEN_FILENAME +rm "project.yml" # commit state #### git commit -m "Setup project configuration" diff --git a/templates/Info.mustache b/templates/Info.mustache index 76e05cf..42c695e 100755 --- a/templates/Info.mustache +++ b/templates/Info.mustache @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - {{name}} + {{project_name}} CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/templates/mvvm-swift/Podfile b/templates/Podfile.mustache similarity index 63% rename from templates/mvvm-swift/Podfile rename to templates/Podfile.mustache index ab973c7..dac6335 100755 --- a/templates/mvvm-swift/Podfile +++ b/templates/Podfile.mustache @@ -1,23 +1,24 @@ source 'https://github.com/CocoaPods/Specs' source "https://github.com/TouchInstinct/Podspecs.git" -platform :ios, '<%= deployment_target %>' +platform :ios, '{{deployment_target}}' use_frameworks! inhibit_all_warnings! -project '<%= project_name %>', { +project '{{project_name}}', { 'StandardDebug' => :debug, 'EnterpriseDebug' => :debug, 'StandardRelease' => :release, 'EnterpriseRelease' => :release } -target '<%= project_name %>' do - pod 'LeadKit' - pod 'Fabric' - pod 'Crashlytics' - pod 'SwiftLint' +target '{{project_name}}' do + pod 'Device.swift' + # pod 'LeadKit' + # pod 'Fabric' + # pod 'Crashlytics' + # pod 'SwiftLint' end # If you have slow HDD diff --git a/templates/project.mustache b/templates/project.mustache index d40cc1d..dcbef01 100644 --- a/templates/project.mustache +++ b/templates/project.mustache @@ -1,42 +1,42 @@ -name: {{name}} +name: {{project_name}} options: createIntermediateGroups: true xcodeVersion: 9.2 deploymentTarget: - iOS: "10.0" + iOS: "{{deployment_target}}" configs: StandardDebug: debug StandardRelease: release EnterpriseDebug: debug EnterpriseRelease: release targets: - {{name}}: + {{project_name}}: type: application platform: iOS sources: - - path: {{name}} + - path: {{project_name}} buildPhase: sources - - path: {{name}}/Analytics + - path: {{project_name}}/Analytics buildPhase: sources - - path: {{name}}/Cells + - path: {{project_name}}/Cells buildPhase: sources - - path: {{name}}/Controllers + - path: {{project_name}}/Controllers buildPhase: sources - - path: {{name}}/Extensions + - path: {{project_name}}/Extensions buildPhase: sources - - path: {{name}}/Generated + - path: {{project_name}}/Generated buildPhase: sources - - path: {{name}}/Models + - path: {{project_name}}/Models buildPhase: sources - - path: {{name}}/Networking + - path: {{project_name}}/Networking buildPhase: sources - - path: {{name}}/Protocols + - path: {{project_name}}/Protocols buildPhase: sources - - path: {{name}}/Realm + - path: {{project_name}}/Realm buildPhase: sources - - path: {{name}}/Resources + - path: {{project_name}}/Resources buildPhase: sources - - path: {{name}}/Services + - path: {{project_name}}/Services buildPhase: sources - - path: {{name}}/Views + - path: {{project_name}}/Views buildPhase: sources