From 5ce5cdda94f266b981e258c3b3b9f15e80cc654f Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 5 Mar 2019 15:17:52 +0300 Subject: [PATCH 1/3] Carthage generation added --- bootstrap.sh | 4 ++++ sources/Brewfile | 1 + sources/project/AppDelegate.swift | 1 - templates/Cartfile.mustage | 16 ++++++++++++++++ templates/Podfile.mustache | 3 --- templates/dateformatservice.mustache | 4 ---- templates/gitignore | 2 +- templates/numberformatservice.mustache | 4 ---- templates/tablecontentcontroller.mustache | 1 - 9 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 templates/Cartfile.mustage diff --git a/bootstrap.sh b/bootstrap.sh index 505adbf..e8a658a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -95,6 +95,10 @@ generate "{project_name: $PROJECT_NAME, deployment_target: $DEPLOYMENT_TARGET}" 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 diff --git a/sources/Brewfile b/sources/Brewfile index 7b38571..5b4394a 100644 --- a/sources/Brewfile +++ b/sources/Brewfile @@ -1,2 +1,3 @@ tap "yonaskolb/XcodeGen", "https://github.com/yonaskolb/XcodeGen.git" brew "XcodeGen" +brew "carthage" diff --git a/sources/project/AppDelegate.swift b/sources/project/AppDelegate.swift index 2e0c4ae..945b651 100755 --- a/sources/project/AppDelegate.swift +++ b/sources/project/AppDelegate.swift @@ -31,5 +31,4 @@ final class AppDelegate: UIResponder, UIApplicationDelegate { Fabric.with([Crashlytics.self]) return true } - } diff --git a/templates/Cartfile.mustage b/templates/Cartfile.mustage new file mode 100644 index 0000000..86e17d0 --- /dev/null +++ b/templates/Cartfile.mustage @@ -0,0 +1,16 @@ +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKit/LeadKit.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKitAdditions/LeadKitAdditions.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxKeyboard/RxKeyboard.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Alamofire/Alamofire.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Kingfisher/Kingfisher.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxGesture/RxGesture.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxOptional/RxOptional.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftDate/SwiftDate.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/PinLayout/PinLayout.json" +binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" +github "ReactiveX/RxSwift" +github "maxsokolov/TableKit" +github "pronebird/UIScrollView-InfiniteScroll" \ No newline at end of file diff --git a/templates/Podfile.mustache b/templates/Podfile.mustache index d5ce138..9b48b93 100755 --- a/templates/Podfile.mustache +++ b/templates/Podfile.mustache @@ -14,12 +14,9 @@ project '{{project_name}}', { } target '{{project_name}}' do - pod 'LeadKit' - pod 'LeadKitAdditions' pod 'Fabric' pod 'Crashlytics' pod 'SwiftLint' - pod 'RxKeyboard' end # If you have slow HDD diff --git a/templates/dateformatservice.mustache b/templates/dateformatservice.mustache index 99bf680..3a3fc48 100644 --- a/templates/dateformatservice.mustache +++ b/templates/dateformatservice.mustache @@ -12,7 +12,6 @@ enum {{project_name}}DateFormat: String, DateFormat { var dateToStringFormat: DateToStringStyles { return .custom(rawValue) } - } final class {{project_name}}DateFormattingService: DateFormattingService, Singleton { @@ -26,7 +25,6 @@ final class {{project_name}}DateFormattingService: DateFormattingService, Single private init() { // } - } extension DateRepresentable { @@ -34,7 +32,6 @@ extension DateRepresentable { func formatted(as format: {{project_name}}DateFormat) -> String { return {{project_name}}DateFormattingService.string(from: self, format: format) } - } extension String { @@ -42,5 +39,4 @@ extension String { func asDate(using format: {{project_name}}DateFormat) -> DateInRegion? { return {{project_name}}DateFormattingService.date(from: self, format: format) } - } diff --git a/templates/gitignore b/templates/gitignore index dff3d8e..19f7e8d 100755 --- a/templates/gitignore +++ b/templates/gitignore @@ -50,8 +50,8 @@ Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts +Carthage/Checkouts Carthage/Build # fastlane diff --git a/templates/numberformatservice.mustache b/templates/numberformatservice.mustache index a539760..c4435df 100644 --- a/templates/numberformatservice.mustache +++ b/templates/numberformatservice.mustache @@ -32,7 +32,6 @@ final class {{project_name}}NumberFormatter: NumberFormattingService, Singleton private init() { // } - } // MARK: - Number to string @@ -42,7 +41,6 @@ extension NSNumberConvertible { func formatted(as format: {{project_name}}NumberFormatType) -> String { return {{project_name}}NumberFormatter.string(from: asNSNumber(), format: format) } - } extension Optional where Wrapped: NSNumberConvertible { @@ -54,7 +52,6 @@ extension Optional where Wrapped: NSNumberConvertible { } return defaultString } - } // MARK: - String to number @@ -84,5 +81,4 @@ extension String { func asDouble(using format: {{project_name}}NumberFormatType) -> Double? { return asNumber(using: format)?.doubleValue } - } diff --git a/templates/tablecontentcontroller.mustache b/templates/tablecontentcontroller.mustache index ccc2b67..3fbc1f8 100644 --- a/templates/tablecontentcontroller.mustache +++ b/templates/tablecontentcontroller.mustache @@ -19,5 +19,4 @@ class {{project_name}}TableContentController: BaseTableContentControl view.backgroundColor = .white tableView.showsVerticalScrollIndicator = false } - } From 2f5e065167c0d12a04a0d03e5933f69a06dbe2a3 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 5 Mar 2019 15:33:52 +0300 Subject: [PATCH 2/3] Repository fix --- templates/Cartfile.mustage | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/templates/Cartfile.mustage b/templates/Cartfile.mustage index 86e17d0..05486bf 100644 --- a/templates/Cartfile.mustage +++ b/templates/Cartfile.mustage @@ -1,16 +1,16 @@ -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKit/LeadKit.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/LeadKitAdditions/LeadKitAdditions.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxKeyboard/RxKeyboard.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Alamofire/Alamofire.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxAlamofire/RxAlamofire.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/Kingfisher/Kingfisher.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxGesture/RxGesture.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/RxOptional/RxOptional.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftDate/SwiftDate.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/CryptoSwift/CryptoSwift.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/KeychainAccess/KeychainAccess.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/PinLayout/PinLayout.json" -binary "https://raw.github.com/petropavel13/CarthageBinaries/master/SwiftValidator/SwiftValidator.json" +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/Kingfisher/Kingfisher.json" +binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxGesture/RxGesture.json" +binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxOptional/RxOptional.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" \ No newline at end of file From 1ce6638934fa335a97515335d8404b1763a5d982 Mon Sep 17 00:00:00 2001 From: Pavel Lukandiy Date: Tue, 5 Mar 2019 15:35:20 +0300 Subject: [PATCH 3/3] Removed unnecessary --- templates/Cartfile.mustage | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/Cartfile.mustage b/templates/Cartfile.mustage index 05486bf..bf1c3ac 100644 --- a/templates/Cartfile.mustage +++ b/templates/Cartfile.mustage @@ -3,8 +3,6 @@ binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/LeadKitAddi 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/Kingfisher/Kingfisher.json" -binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxGesture/RxGesture.json" binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxOptional/RxOptional.json" binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/SwiftDate/SwiftDate.json" binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/CryptoSwift/CryptoSwift.json"