Now iOS developers have a lot of tools to automate routine actions. In Surf we use Generamba, Fastlane, SwiftGen, SwiftLint, Jenkins. And constantly looking for ways to automate something else. And if earlier we spent 1-2 days on initializing a new project, now it takes no more than 4 hours.
What you need to start developing a large project?
1. Create a repository.
- Configure access rights;
- Set notifications in the developers chat.
2. Create a project.
- Create a folder structure;
- Add various support files like all your favorite extensions;
- Customize CI / CD;
- Add various linters and generators (Generamba / SwiftLint / SwiftGen);
- Tighten dependencies;
- ...
After 1-2 days of work, you can begin to fully develop.
Obviously, most of these steps can be automated. Of the possible options on hand were:
- XcodeGen;
- Templates Xcode projects;
- Basic Xcode project.
')
Xcodegen
+ Allows you to generate .xcodeproj on the fly using the configuration file, with which adds the ability to get rid of conflicts in the project file.
- Used in conjunction with other scripts, as it works only with the project file, without affecting the rest of the files.
Xcode Project Templates
+ You can generate .xcodeproj with all settings, as well as any other additional files.
- There is no full-fledged official documentation and description of templates in xml.
Basic Xcode project
+ Quickly set up and immediately with all the necessary files and dependencies.
- Redo for a specific project for a long time. And you can accidentally skip a step and shoot yourself in the foot.
As a result, we stopped at using Xcode projects, this allowed us to optimize the process and reduce the time to create a project. The basic Xcode project seemed too crutchy, and the flexibility that custom scripts introduce is not needed for now.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/
<?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>Kind</key> <string>Xcode.Xcode3.ProjectTemplateUnitKind</string> <key>Identifier</key> <string>ru.surfstudio.dt.unit.customTemplate</string> <key>Ancestors</key> <array> <string>com.apple.dt.unit.singleViewApplication</string> </array> <key>Concrete</key> <true/> <key>Description</key> <string></string> <key>Definitions</key> <dict> <key>../Podfile</key> <string>platform :ios, '11.0' pod 'Alamofire' pod 'Crashlytics' pod 'Fabric' </string> </dict> <key>Nodes</key> <array> <string>../Podfile</string> </array> </dict> </plist>
# ___PROJECTNAME___ Description of my project
<string>../README.md</string>
<key>../README.md</key> <dict> <key>Path</key> <string>README.md</string> </dict>
<?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>Kind</key> <string>Xcode.Xcode3.ProjectTemplateUnitKind</string> <key>Identifier</key> <string>ru.surfstudio.dt.unit.customTemplate</string> <key>Ancestors</key> <array> <string>com.apple.dt.unit.singleViewApplication</string> </array> <key>Concrete</key> <true/> <key>Description</key> <string></string> <key>Definitions</key> <dict> <key>../Podfile</key> <string> platform :ios, '11.0' pod 'Alamofire' pod 'Crashlytics' pod 'Fabric' </string> <key>../README.md</key> <dict> <key>Path</key> <string>README.md</string> </dict> </dict> <key>Nodes</key> <array> <string>../Podfile</string> <string>../README.md</string> </array> </dict> </plist>
// // ___FILENAME___ // ___PACKAGENAME___ // // Created by ___FULLUSERNAME___ on ___DATE___. //___COPYRIGHT___ //
Source: https://habr.com/ru/post/460265/
All Articles