こんにちは、Habr!「iOSDeveloper。Professional」コースの開始を見越して、便利な資料の伝統的な翻訳を用意しました。また、コースの先生とのオンラインミーティングをご希望の方もご招待します。ここでは、トレーニングについて興味のある質問を先生に尋ねることができます。
そして最後に、ウェビナー「SwiftUIとCombineを使用したアプリケーションの作成」の録画を視聴することをお勧めします。
I.はじめに
この記事では、ファイル内のマージの競合を即座に解決するソリューションについて説明します.xcodeproj
。これは、今日のiOSおよびmacOS開発チームが直面している最も時間のかかる問題の1つです。
, .
II -
1. XcodeGen
yonaskolb/XcodeGen
XcodeGen — , Swift, Xcode- .
XcodeGen Brew. brew install xcodegen ( ).
2.
. , ( ), , , CI . .
, , , XcodeGen, , .
, :
III -
1.
(sample project), , carthage-. makeProject.sh
. , .
2. XcodeGen
XcodeGen ( ) project.yml ( ).
XcodeGen/project.yml
: :
name: GoodToGo
options:
bundleIdPrefix: com.GoodToGo
xcodeVersion: '12.0.1'
deploymentTarget: '12.0'
groupSortPosition: top
generateEmptyDirectories: true
findCarthageFrameworks: true
minimumXcodeGenVersion: '2.18.0'
.xcodeproj
— GoodToGo
— , — com.GoodToGo
— , Xcode, …
3. XcodeGen
, , xcodegen -s ./XcodeGen/project.yml -p ./
.
, ./XcodeGen/project.yml
— . /, .
, . , !
, :
, … , , . , project.yml.
4.
XcodeGen/project.yml
: . project.yml
:
configs:
Debug.Dev: debug
Debug.Prod: debug
Release: release
targets:
GoodToGo:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
base:
MARKETING_VERSION: 1.0
sources:
- path: ../GoodToGo
, 3 — Debug.Dev, Debug.Prod Release, GoodToGo, iOS 12 ( ), GoodToGo.
, :
Spec validation error: Target “GoodToGo” has a missing source directory
“/Users/ricardosantos/Desktop/GitHub/RJPS_Articles/7/sourcecode/THE_FOLDER_THAT_DOES_NOT_EXISTS_NAME”
( ) …
… ( ) , !
5.
, , — . , , .
, , Framework.
, project.yml, , .
XcodeGen/project.yml
: :
targetTemplates:
Framework:
type: framework
platform: iOS
deploymentTarget: 11.0
settings:
base:
MARKETING_VERSION: 1.0
, :
framework,
iOS,
1.0,
, , iOS 11.0.
( ).
: AppTheme AppResources.
project.yml 2 (AppTheme AppResources). , .
AppTheme:
templates:
- Framework
sources:
- path: ../AppTheme
AppResources:
templates:
- Framework
sources:
- path: ../AppResources
XcodeGen/project.yml
:
( ) …
… 2 , .
: project.yml
:
targets:
GoodToGo:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
base:
MARKETING_VERSION: 1.0
sources:
- path: ../GoodToGo
AppTheme:
templates:
- Framework
sources:
- path: ../AppTheme
AppResources:
templates:
- Framework
sources:
- path: ../AppResources
, project.yml
:
name: GoodToGo
## options section ##
options:
bundleIdPrefix: com.GoodToGo
xcodeVersion: '12.0.1'
deploymentTarget: '12.0'
groupSortPosition: top
generateEmptyDirectories: true
findCarthageFrameworks: true
minimumXcodeGenVersion: '2.18.0'
## configs section ##
configs:
Debug.Dev: debug
Debug.Prod: debug
Release: release
## targetTemplates section ##
targetTemplates:
Framework:
type: framework
platform: iOS
deploymentTarget: 11.0
settings:
base:
MARKETING_VERSION: 1.0
## targets section ##
targets:
GoodToGo:
type: application
platform: iOS
deploymentTarget: 11.0
settings:
base:
MARKETING_VERSION: 1.0
sources:
- path: ../GoodToGo
AppTheme:
templates:
- Framework
sources:
- path: ../AppTheme
AppResources:
templates:
- Framework
sources:
- path: ../AppResources
AppConstants:
templates:
- Framework
sources:
- path: ../AppConstants
Core:
templates:
- Framework
sources:
- path: ../Core
Core.GalleryApp:
templates:
- Framework
sources:
- path: ../Core.GalleryApp
Domain:
templates:
- Framework
sources:
- path: ../Domain
Core.GalleryApp:
templates:
- Framework
sources:
- path: ../Core.GalleryApp
Designables:
templates:
- Framework
sources:
- path: ../Designables
DevTools:
templates:
- Framework
sources:
- path: ../DevTools
Extensions:
templates:
- Framework
sources:
- path: ../Extensions
Factory:
templates:
- Framework
sources:
- path: ../Factory
PointFreeFunctions:
templates:
- Framework
sources:
- path: ../PointFreeFunctions
Repositories:
templates:
- Framework
sources:
- path: ../Repositories
Repositories.WebAPI:
templates:
- Framework
sources:
- path: ../Repositories.WebAPI
UIBase:
templates:
- Framework
sources:
- path: ../UIBase
Test.GoodToGo:
type: bundle.unit-test
platform: iOS
sources:
- path: ../Test.GoodToGo
scheme: {}
XcodeGen/project.yml
: ()
XcodeGen !
, . — .plist
. 2- : project.yml
.plist
, GoodToGo-info.plist Info.plist.
6.
, . .
, , Domain RxCocoa RxSwift, carthage.
-, Domain project.yml
…
XcodeGen/project.yml
: Domain :
Domain:
templates:
- Framework
sources:
- path: ../Domain
… (carthage) . !
XcodeGen / project.yml
: Domain :
Domain:
templates:
- Framework
sources:
- path: ../Domain
dependencies:
- carthage: RxSwift
- carthage: RxCocoa
carthage-,
(link: true),
(link: false).
XcodeGen/project.yml
: (carthage, ):
dependencies:
- carthage: RxSwift
- carthage: RxCocoa
- target: BaseUI
link: false
- target: DevTools
link: true
- target: UICarTrack
link: false
, ! « » — , , , , .. :
1.
.xcodeproject
,
2. ,
3.
project.yml
,
4. 1.
7. :
( ):
, postCompileScript
.
GoodToGo:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
base:
MARKETING_VERSION: 1.0
sources:
- path: ../GoodToGo
dependencies:
...
postCompileScripts:
- script: |
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
name: Run SwiftLint
8. : Documents
Documents. , , . fileGroups ( fileGroups ).
fileGroups:
- ../Documents
IV -
project.yml
XcodeGen, ( )
1. , :
. / Remove Reference . , XcodeGen (, ). , Documents.
2. , :
. , , , , . , Documents.
V -
XcodeGen .
"iOS Developer. Professional".
« SwiftUI Combine».