Compare commits

...

5 Commits

40 changed files with 762 additions and 90 deletions

View File

@ -11,13 +11,38 @@ function generate {
}
# define variables
PROJECTS_PATH=$1
PROJECT_NAME=$2
PROJECT_NAME_WITH_PREFIX=$2-ios
COMMON_REPO_NAME=${3:-$2-common}
DEPLOYMENT_TARGET="10.0"
PROJECT_TYPE=$1
PROJECTS_PATH=$2
PROJECT_NAME=$3
case $PROJECT_TYPE in
project)
PROJECT_NAME_WITH_PREFIX=$3-ios
SCRIPT_MISC_FILES_DIR="project"
;;
library)
PROJECT_NAME_WITH_PREFIX=$3
SCRIPT_MISC_FILES_DIR="library"
;;
*)
echo "Please specify project type: \"project\" or \"library\""
exit 1
;;
esac
DEPLOYMENT_TARGET_IOS="9.0"
DEPLOYMENT_TARGET_WATCH_OS="2.0"
DEPLOYMENT_TARGET_TV_OS="9.0"
SWIFT_VERSION="5.0"
XCODE_VERSION="10.2"
CURRENT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
TEMPLATES=$CURRENT_DIR/templates
TEMPLATES=$CURRENT_DIR/$SCRIPT_MISC_FILES_DIR/templates
SOURCES=$CURRENT_DIR/$SCRIPT_MISC_FILES_DIR/sources
COMMON_SOURCES=$CURRENT_DIR/common/sources
FOLDERNAMES=$CURRENT_DIR/$SCRIPT_MISC_FILES_DIR/foldernames.txt
LOWERCASED_PROJECT_NAME=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]')
cd $PROJECTS_PATH
@ -40,80 +65,149 @@ else
echo "Git exists..."
fi
# source code project folder
echo "Create sources folders..."
mkdir -p $PROJECT_NAME
# copy and generate source files
cp -R $CURRENT_DIR/sources/project/. $PROJECT_NAME
cp -R $CURRENT_DIR/sources/fastlane/. fastlane
case $PROJECT_TYPE in
project)
# source code project folder
echo "Create sources folders..."
mkdir -p $PROJECT_NAME
# create each empty folder in location from file, except Resources, all folders with files inside
for folder in `cat $CURRENT_DIR/foldernames.txt`; do
echo "Creating $folder ..."
mkdir -p $PROJECT_NAME/$folder
done
cp -R $SOURCES/project/. $PROJECT_NAME
cp -R $SOURCES/fastlane/. fastlane
generate "{project_name_lowecased: $LOWERCASED_PROJECT_NAME}" $SOURCES/fastlane/configurations.mustache fastlane/configurations.yaml
# create each empty folder in location from file, except Resources, all folders with files inside
for folder in `cat $FOLDERNAMES`; do
echo "Creating $folder ..."
mkdir -p $PROJECT_NAME/$folder
done
;;
library)
# create each empty folder in location from file, except Resources, all folders with files inside
for folder in `cat $FOLDERNAMES`; do
echo "Creating $folder ..."
mkdir -p Sources/$folder
done
;;
esac
# install required gems & brews
cp $CURRENT_DIR/sources/Gemfile Gemfile
cp $CURRENT_DIR/sources/Gemfile.lock Gemfile.lock
cp $CURRENT_DIR/sources/Brewfile Brewfile
cp $SOURCES/Gemfile Gemfile
cp $SOURCES/Gemfile.lock Gemfile.lock
cp $COMMON_SOURCES/Brewfile Brewfile
bundle install
brew bundle
# create info plist
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache $PROJECT_NAME/Info.plist
case $PROJECT_TYPE in
project)
# create info plist
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache $PROJECT_NAME/Info.plist
# generate services
DATE_SERVICE_NAME="DateFormattingService"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/dateformatservice.mustache $PROJECT_NAME/Services/"$PROJECT_NAME$DATE_SERVICE_NAME".swift
# generate services
DATE_SERVICE_NAME="DateFormattingService"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/dateformatservice.mustache $PROJECT_NAME/Services/"$PROJECT_NAME$DATE_SERVICE_NAME".swift
NUMBER_SERVICE_NAME="NumberFormattingService"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/numberformatservice.mustache $PROJECT_NAME/Services/"$PROJECT_NAME$NUMBER_SERVICE_NAME".swift
NUMBER_SERVICE_NAME="NumberFormattingService"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/numberformatservice.mustache $PROJECT_NAME/Services/"$PROJECT_NAME$NUMBER_SERVICE_NAME".swift
TABLE_CONTENT_CONTROLLER_NAME="TableContentController"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/tablecontentcontroller.mustache $PROJECT_NAME/Controllers/"$PROJECT_NAME$TABLE_CONTENT_CONTROLLER_NAME".swift
TABLE_CONTENT_CONTROLLER_NAME="TableContentController"
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/tablecontentcontroller.mustache $PROJECT_NAME/Controllers/"$PROJECT_NAME$TABLE_CONTENT_CONTROLLER_NAME".swift
;;
library)
# create info plists
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache Sources/Info-iOS.plist
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache Sources/Info-iOS-Extension.plist
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache Sources/Info-watchOS.plist
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Info.mustache Sources/Info-tvOS.plist
# generate public header
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/PublicHeader.mustache Sources/$PROJECT_NAME.h
# copy example class
cp $TEMPLATES/ExampleClass.swift Sources/Classes/ExampleClass.swift
# generate podspec
generate "{
project_name: $PROJECT_NAME,
deployment_target_ios: $DEPLOYMENT_TARGET_IOS,
deployment_target_watch_os: $DEPLOYMENT_TARGET_WATCH_OS,
deployment_target_tv_os: $DEPLOYMENT_TARGET_TV_OS,
swift_version: $SWIFT_VERSION,
xcode_version: $XCODE_VERSION
}" $TEMPLATES/podspec.mustache $PROJECT_NAME.podspec
# copy licence
cp $TEMPLATES/LICENSE LICENSE
;;
esac
# generate file for generate xcodeproj
LOWERCASED_PROJECT_NAME=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]')
generate "{project_name: $PROJECT_NAME, deployment_target: $DEPLOYMENT_TARGET, project_name_lowecased: $LOWERCASED_PROJECT_NAME}" \
generate "{
project_name: $PROJECT_NAME,
deployment_target_ios: $DEPLOYMENT_TARGET_IOS,
deployment_target_watch_os: $DEPLOYMENT_TARGET_WATCH_OS,
deployment_target_tv_os: $DEPLOYMENT_TARGET_TV_OS,
swift_version: $SWIFT_VERSION,
xcode_version: $XCODE_VERSION,
project_name_lowecased: $LOWERCASED_PROJECT_NAME}" \
$TEMPLATES/project.mustache \
project.yml
# install carthage
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Cartfile.mustache Cartfile
carthage bootstrap
# generate xcode project file
echo "Generate xcodeproj file..."
xcodegen --spec project.yml
carting update -f list
# creating .gitkeep in each folder to enforce git stash this folder
for folder in `cat $CURRENT_DIR/foldernames.txt`; do
touch $PROJECT_NAME/$folder/.gitkeep
done
case $PROJECT_TYPE in
project)
for folder in `cat $FOLDERNAMES`; do
touch $PROJECT_NAME/$folder/.gitkeep
done
;;
library)
for folder in `cat $FOLDERNAMES`; do
touch Sources/$folder/.gitkeep
done
;;
esac
# install pods
generate "{project_name: $PROJECT_NAME, deployment_target: $DEPLOYMENT_TARGET}" $TEMPLATES/Podfile.mustache Podfile
generate "{
project_name: $PROJECT_NAME,
deployment_target_ios: $DEPLOYMENT_TARGET_IOS,
deployment_target_watch_os: $DEPLOYMENT_TARGET_WATCH_OS,
deployment_target_tv_os: $DEPLOYMENT_TARGET_TV_OS
}" $TEMPLATES/Podfile.mustache Podfile
pod repo update
pod install
# install carthage
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Cartfile.mustage Cartfile
carthage update
# configure git files
cp $TEMPLATES/gitignore .gitignore
cp $TEMPLATES/gitattributes .gitattributes
# configure rambafile
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Rambafile.mustache Rambafile
generamba template install
# configure README.md
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/README.mustache README.md
# configure submodules
git submodule add git@github.com:TouchInstinct/$COMMON_REPO_NAME.git common
git submodule add git@github.com:TouchInstinct/BuildScripts.git build-scripts
case $PROJECT_TYPE in
project)
# configure rambafile
generate "{project_name: $PROJECT_NAME}" $TEMPLATES/Rambafile.mustache Rambafile
generamba template install
COMMON_REPO_NAME=$PROJECT_NAME-common
git submodule add git@github.com:TouchInstinct/$COMMON_REPO_NAME.git common
;;
esac
git submodule update --init
# final clean up
@ -121,6 +215,9 @@ rm Gemfile*
rm Brewfile*
rm project.yml
# generate models, strings, etc
xcodebuild -workspace $PROJECT_NAME.xcworkspace -scheme $PROJECT_NAME -configuration StandardDebug -sdk iphonesimulator
# commit
git checkout -b feature/setup_project
git add .

6
library/foldernames.txt Normal file
View File

@ -0,0 +1,6 @@
Classes
Enums
Extensions
Functions
Protocols
Structures

4
library/sources/Brewfile Normal file
View File

@ -0,0 +1,4 @@
brew "SwiftLint"
brew "pmd"
brew "Carthage"
brew "Carting"

View File

@ -1,3 +1,2 @@
source 'https://rubygems.org'
gem 'mustache'
gem 'generamba'

View File

@ -0,0 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
mustache (1.0.5)
PLATFORMS
ruby
DEPENDENCIES
mustache
BUNDLED WITH
1.16.1

View File

View File

@ -0,0 +1,25 @@
//
// Copyright (c) 2018 Touch Instinct
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the Software), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import Foundation
public final class ExampleClass {}

22
library/templates/Info.mustache Executable file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

201
library/templates/LICENSE Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,35 @@
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/TouchInstinct/Podspecs.git'
abstract_target '{{project_name}}' do
use_frameworks!
inhibit_all_warnings!
# common pods
pod 'SwiftLint'
target '{{project_name}}-iOS' do
platform :ios, '{{deployment_target_ios}}'
# pods for iOS
end
target '{{project_name}}-watchOS' do
platform :watchos, '{{deployment_target_watch_os}}'
# pods for watchOS
end
target '{{project_name}}-tvOS' do
platform :tvos, '{{deployment_target_tv_os}}'
# pods for tvOS
end
end
ENV['COCOAPODS_DISABLE_STATS'] = "true"

View File

@ -0,0 +1,9 @@
#import <UIKit/UIKit.h>
//! Project version number for LeadKit.
FOUNDATION_EXPORT double {{project_name}}VersionNumber;
//! Project version string for LeadKit.
FOUNDATION_EXPORT const unsigned char {{project_name}}VersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <{{project_name}}/PublicHeader.h>

View File

@ -0,0 +1 @@
# {{project_name}} library

View File

@ -0,0 +1,18 @@
Pod::Spec.new do |s|
s.name = "{{project_name}}"
s.version = "0.0.1"
s.summary = "TouchInstinct framework"
s.homepage = "https://github.com/TouchInstinct/{{project_name}}"
s.license = "Apache License, Version 2.0"
s.author = "Touch Instinct"
s.source = { :git => "https://github.com/TouchInstinct/{{project_name}}.git", :tag => s.version }
s.ios.deployment_target = '{{deployment_target_ios}}'
s.watchos.deployment_target = '{{deployment_target_watch_os}}'
s.tvos.deployment_target = '{{deployment_target_tv_os}}'
s.swift_version = '{{swift_version}}'
s.source_files = "Sources/**/*.swift"
end

View File

@ -0,0 +1,106 @@
name: {{project_name}}
options:
createIntermediateGroups: true
xcodeVersion: "{{xcode_version}}"
usesTabs: false
indentWidth: 4
deploymentTarget:
iOS: "{{deployment_target_ios}}"
watchOS: "{{deployment_target_watch_os}}"
tvOS: "{{deployment_target_tv_os}}"
targets:
{{project_name}}-iOS:
settings:
base:
PRODUCT_NAME: "{{project_name}}"
INFOPLIST_FILE: Sources/Info-iOS.plist
SWIFT_VERSION: "{{swift_version}}"
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: YES
type: framework
platform: iOS
postbuildScripts:
- script: ". build-scripts/xcode/build_phases/swiftlint.sh Sources"
name: Swiftlint
- script: ". build-scripts/xcode/build_phases/copy_paste_detection.sh Sources"
name: CopyPaste Detection
sources:
- path: Sources
excludes:
- "*.plist"
- path: Sources/Classes
buildPhase: sources
- path: Sources/Enums
buildPhase: sources
- path: Sources/Extensions
buildPhase: sources
- path: Sources/Functions
buildPhase: sources
- path: Sources/Protocols
buildPhase: sources
- path: Sources/Structures
buildPhase: sources
- path: "Sources/{{project_name}}.h"
buildPhase: headers
{{project_name}}-watchOS:
settings:
base:
PRODUCT_NAME: "{{project_name}}"
INFOPLIST_FILE: Sources/Info-watchOS.plist
SWIFT_VERSION: "{{swift_version}}"
type: framework
platform: watchOS
postbuildScripts:
- script: ". build-scripts/xcode/build_phases/swiftlint.sh Sources"
name: Swiftlint
- script: ". build-scripts/xcode/build_phases/copy_paste_detection.sh Sources"
name: CopyPaste Detection
sources:
- path: Sources
excludes:
- "*.plist"
- path: Sources/Classes
buildPhase: sources
- path: Sources/Enums
buildPhase: sources
- path: Sources/Extensions
buildPhase: sources
- path: Sources/Functions
buildPhase: sources
- path: Sources/Protocols
buildPhase: sources
- path: Sources/Structures
buildPhase: sources
- path: "Sources/{{project_name}}.h"
buildPhase: headers
{{project_name}}-tvOS:
settings:
base:
PRODUCT_NAME: "{{project_name}}"
INFOPLIST_FILE: Sources/Info-tvOS.plist
SWIFT_VERSION: "{{swift_version}}"
type: framework
platform: tvOS
postbuildScripts:
- script: ". build-scripts/xcode/build_phases/swiftlint.sh Sources"
name: Swiftlint
- script: ". build-scripts/xcode/build_phases/copy_paste_detection.sh Sources"
name: CopyPaste Detection
sources:
- path: Sources
excludes:
- "*.plist"
- path: Sources/Classes
buildPhase: sources
- path: Sources/Enums
buildPhase: sources
- path: Sources/Extensions
buildPhase: sources
- path: Sources/Functions
buildPhase: sources
- path: Sources/Protocols
buildPhase: sources
- path: Sources/Structures
buildPhase: sources
- path: "Sources/{{project_name}}.h"
buildPhase: headers

5
project/sources/Brewfile Normal file
View File

@ -0,0 +1,5 @@
brew "XcodeGen"
brew "SwiftLint"
brew "pmd"
brew "Carthage"
brew "Carting"

3
project/sources/Gemfile Normal file
View File

@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'mustache'
gem 'generamba', git: 'https://github.com/strongself/Generamba.git', branch: 'develop'

View File

@ -1,53 +1,60 @@
GEM
remote: https://rubygems.org/
GIT
remote: https://github.com/strongself/Generamba.git
revision: 4c450efc3ea63dd34fa04206194813dbb021441e
branch: develop
specs:
CFPropertyList (2.3.6)
activesupport (5.1.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
claide (1.0.2)
cocoapods-core (1.0.1)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
colored (1.2)
concurrent-ruby (1.0.5)
fuzzy_match (2.0.4)
generamba (1.4.1)
cocoapods-core (= 1.0.1)
cocoapods-core (= 1.5.3)
git (= 1.2.9.1)
liquid (= 4.0.0)
terminal-table (= 1.4.5)
thor (= 0.19.1)
xcodeproj (= 1.4.2)
xcodeproj (= 1.6.0)
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (5.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods-core (1.5.3)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.5)
fuzzy_match (2.0.4)
git (1.2.9.1)
i18n (1.0.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
liquid (4.0.0)
minitest (5.11.3)
mustache (1.0.5)
nanaimo (0.2.4)
mustache (1.1.0)
nanaimo (0.2.6)
nap (1.1.0)
terminal-table (1.4.5)
thor (0.19.1)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.4.2)
CFPropertyList (~> 2.3.3)
activesupport (>= 3)
claide (>= 1.0.1, < 2.0)
colored (~> 1.2)
nanaimo (~> 0.2.3)
xcodeproj (1.6.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
PLATFORMS
ruby
DEPENDENCIES
generamba
generamba!
mustache
BUNDLED WITH
1.16.1
2.0.1

View File

@ -15,3 +15,14 @@ end
lane :EnterpriseRelease do |options|
buildConfiguration(options)
end
lane :AppStoreRelease do |options|
options[:uploadToAppStore] = true
buildConfiguration(options)
end
lane :SyncCodeSigning do |options|
options = merge_options_with_config_file(options)
options = options.merge(get_keychain_options(options))
syncCodeSigning(options)
end

View File

@ -0,0 +1,17 @@
development:
app_identifier:
- ru.touchin.{{project_name_lowecased}}
apple_id: "apple@touchin.ru"
team_id: "D4HA43V467"
itc_team_id: "1426360"
enterprise:
app_identifier:
- com.touchin.{{project_name_lowecased}}
apple_id: "enterpriseapple@touchin.ru"
team_id: "228J5MMU7S"
appstore:
app_identifier:
- customer.bundle.id
apple_id: "apple@touchin.ru"
team_id: "CUSTOMER_TEAM_ID"
itc_team_id: "CUSTOMER_ITC_TEAM_ID"

View File

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

View File

@ -1,14 +1,10 @@
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKit/LeadKit.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKitAdditions/LeadKitAdditions.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxKeyboard/RxKeyboard.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/Alamofire/Alamofire.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxAlamofire/RxAlamofire.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxOptional/RxOptional.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SnapKit/SnapKit.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftDate/SwiftDate.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/CryptoSwift/CryptoSwift.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/KeychainAccess/KeychainAccess.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/PinLayout/PinLayout.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftValidator/SwiftValidator.json"
github "ReactiveX/RxSwift"
github "maxsokolov/TableKit"
github "pronebird/UIScrollView-InfiniteScroll"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/TableKit/TableKit.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxSwift/RxSwift.json"
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/UIScrollView_InfiniteScroll/UIScrollView_InfiniteScroll.json"

View File

@ -1,7 +1,7 @@
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/TouchInstinct/Podspecs.git'
platform :ios, '{{deployment_target}}'
platform :ios, '{{deployment_target_ios}}'
use_frameworks!
inhibit_all_warnings!
@ -10,7 +10,8 @@ project '{{project_name}}', {
'StandardDebug' => :debug,
'EnterpriseDebug' => :debug,
'StandardRelease' => :release,
'EnterpriseRelease' => :release
'EnterpriseRelease' => :release,
'AppStore' => :release
}
target '{{project_name}}' do

View File

@ -0,0 +1,2 @@
*.pbxproj merge=union
*.strings text diff

74
project/templates/gitignore Executable file
View File

@ -0,0 +1,74 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
# Touch Instinct custom
Downloads/
fastlane/README.md
Templates/
cpd-output.xml
*IDEWorkspaceChecks.plist

View File

@ -1,23 +1,24 @@
name: {{project_name}}
options:
createIntermediateGroups: true
xcodeVersion: 10.0
xcodeVersion: "{{xcode_version}}"
usesTabs: false
indentWidth: 4
deploymentTarget:
iOS: "{{deployment_target}}"
iOS: "{{deployment_target_ios}}"
configs:
StandardDebug: debug
StandardRelease: release
EnterpriseDebug: debug
EnterpriseRelease: release
AppStore: release
targets:
{{project_name}}:
settings:
base:
SWIFT_VERSION: 4.2
SWIFT_SWIFT3_OBJC_INFERENCE: On
SWIFT_VERSION: "{{swift_version}}"
CODE_SIGN_STYLE: Manual
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: YES
configs:
StandardDebug:
PRODUCT_BUNDLE_IDENTIFIER: ru.touchin.{{project_name_lowecased}}
@ -27,12 +28,27 @@ targets:
PRODUCT_BUNDLE_IDENTIFIER: com.touchin.{{project_name_lowecased}}
EnterpriseRelease:
PRODUCT_BUNDLE_IDENTIFIER: com.touchin.{{project_name_lowecased}}
AppStore:
PRODUCT_BUNDLE_IDENTIFIER: customer.bundle.id
type: application
platform: iOS
dependencies:
- carthage: Alamofire
- carthage: TableKit
- carthage: SnapKit
- carthage: SwiftDate
- carthage: LeadKit
- carthage: RxAtomic
- carthage: RxSwift
- carthage: RxCocoa
- carthage: RxAlamofire
- carthage: RxOptional
- carthage: Rxkeyboard
- carthage: UIScrollView_InfiniteScroll
prebuildScripts:
- script: ". build-scripts/xcode/build_phases/localization.sh"
name: Localization
- script: ". build-scripts/xcode/build_phases/api_generator.sh 1.1.35"
- script: ". build-scripts/xcode/build_phases/api_generator.sh 1.2.20"
name: API Generator
postbuildScripts:
- script: ". build-scripts/xcode/build_phases/swiftlint.sh"
@ -69,8 +85,12 @@ targets:
- path: {{project_name}}/Realm
buildPhase: sources
- path: {{project_name}}/Resources
excludes:
- "Localization"
buildPhase: resources
- path: {{project_name}}/Resources/Localization
excludes:
- "String+Localization.swift"
buildPhase: resources
- path: {{project_name}}/Services
buildPhase: sources