Skip to content

Commit fe79d93

Browse files
authored
Update SwiftLint to v0.59.1 and remove DrString dependency (#125)
- Upgrade SwiftLint from v0.45.0 to v0.59.1 (latest release) - Remove DrString completely (outdated binary with compatibility issues) - Update setup script to remove DrString integration for frameworks - Clean up README.md: remove EOL SDK sections (HockeyApp, Sentry, Buglife, DrString) - Update version references and documentation - Add CLAUDE.md for future development guidance
1 parent c4745cb commit fe79d93

7 files changed

Lines changed: 94 additions & 168 deletions

File tree

CLAUDE.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This repository contains Smart Mobile Factory's common project setup files for iOS development. It provides reusable components, scripts, and configurations that are shared across multiple iOS projects and frameworks through git submodules.
8+
9+
## Architecture
10+
11+
The repository is organized into several functional directories:
12+
13+
### SDK Helper Wrappers
14+
- **LifetimeTracker/**: Memory leak detection helpers with base view controllers (wraps https://github.com/krzysztofzablocki/LifetimeTracker)
15+
16+
### Development Tools
17+
- **SwiftLint/**: SwiftLint v0.59.1 configurations and execution scripts with portable binary
18+
- **Xcode/**: Xcode version checking utilities
19+
20+
### Utilities
21+
- **Plist2swift/**: Swift Package Manager tool that generates Swift code from plist files
22+
- **Git/**: Git merge drivers and upmerge scripts for framework development
23+
- **Strato/**: License management utilities
24+
25+
## Common Development Commands
26+
27+
### Main Setup Script
28+
```bash
29+
# For apps
30+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "${PRODUCT_TYPE}"
31+
32+
# For SwiftUI apps
33+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "${PRODUCT_TYPE}" --SwiftUI
34+
35+
# For framework unit tests
36+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "com.apple.product-type.framework"
37+
```
38+
39+
### Individual Tool Commands
40+
```bash
41+
# SwiftLint only
42+
./SwiftLint/copy-and-run-swiftlint-config.sh
43+
44+
# Xcode version check
45+
./Xcode/check-xcode-version.swift
46+
47+
# Plist2Swift code generation
48+
./Plist2swift/Plist2swift -e EnumName -o output.swift input1.plist input2.plist
49+
```
50+
51+
### Testing Plist2swift
52+
```bash
53+
cd Plist2swift
54+
swift test
55+
```
56+
57+
## Setup Integration
58+
59+
The main setup script handles:
60+
- Copying and merging SwiftLint configurations (`.swiftlint.yml` and `.project-swiftlint.yml`)
61+
- Running SwiftLint with portable binary or system installation
62+
- Copying GitHub PR templates based on project type
63+
- Optional Xcode version validation
64+
65+
## Key Configuration Files
66+
67+
- **swiftlint.yml**: Base SwiftLint v0.59.1 configuration
68+
- **swiftlint+frameworks.yml**: Additional rules for frameworks
69+
- **swiftlint+swiftUI.yml**: SwiftUI-specific rules
70+
- **project-swiftlint.yml**: Template for project-specific excluded paths
71+
72+
## SDK Integration Pattern
73+
74+
The LifetimeTracker SDK helper follows this pattern:
75+
1. Provides base view controllers that integrate with LifetimeTracker when available
76+
2. Uses conditional compilation (`#if canImport(LifetimeTracker)`) to support projects with or without the dependency
77+
3. Offers simple setup methods with sensible defaults
78+
4. Handles debug vs release build configurations
79+
80+
## File Generation
81+
82+
- `.swiftlint.yml` is automatically copied to project root
83+
- Add this file to `.gitignore` as it is generated
84+
- Project-specific configurations use `.project-swiftlint.yml` template
85+
86+
## Framework Development
87+
88+
For framework projects:
89+
- Unit test targets get separate SwiftLint configuration
90+
- Special PR templates are used for breaking changes
91+
- Git merge drivers help with version management during upmerges

DrString/copy-and-run-DrString-config.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

DrString/drstring

-12.4 MB
Binary file not shown.

DrString/drstring.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# SMF-iOS-CommonProjectSetupFiles
22

3-
[![Language: Swift 5.3](https://img.shields.io/badge/Swift-5.2-orange.svg)](https://swift.org)
4-
[![Xcode: Xcode 11.7](https://img.shields.io/badge/Xcode-11.7-orange.svg)](https://developer.apple.com/xcode)
3+
[![Language: Swift 5.3](https://img.shields.io/badge/Swift-5.9-orange.svg)](https://swift.org)
4+
[![Xcode: Xcode 15](https://img.shields.io/badge/Xcode-15-orange.svg)](https://developer.apple.com/xcode)
55

66
This Repo contains our common project setup files.
77

88
Helpers which can be added manually to the Xcode project which should be used:
99

10-
- [HockeySDK.swift](#hockeyapp-sdk)
11-
- [SentrySDK.swift](#sentry-sdk)
12-
- [BuglifeSDK.swift](#buglife-sdk)
1310
- [LifetimeTrackerSDK](#lifetimetracker-sdk)
1411

1512
Scripts which should be called during the build phase:
1613

1714
- [SwiftLint](#swiftlint)
18-
- [DrSwift](#drswift)
1915
- [Xcode version check](#xcode-version-check)
2016

2117
### Setup
@@ -52,100 +48,7 @@ If you want to add more parameters, eg. to disable SwiftLint, you have to add th
5248

5349
## Helper classes
5450

55-
### HockeyApp-SDK
5651

57-
This repo contains the `HockeySDK` helper struct which takes care of the default HockeyApp SDK setup. The SDK will be initialized with the App ID and the Crash Manager started.
58-
59-
### Sentry-SDK
60-
61-
This repo contains the `SentrySKD` (plus the SMFLogger variant) helper struct which takes care of the default Sentry SDK setup. The SDK will be initialized with the Sentry DSN (in the info.plist).
62-
63-
#### Integrate the HockeyApp SDK
64-
To use the HockeySDK.swift helper struct you have to manually add the HockeyApp SDK to your project first. Use the preferred way to do this - at this time it's [CocoaPods](https://cocoapods.org).
65-
66-
#### Add the HockeyApp App ID to the info plists
67-
The helper struct will automatically read the App IDs from the info plists. It's mandatory to add these with the key `HockeyAppId` to all info plists in the project:
68-
69-
```
70-
<key>HockeyAppId</key>
71-
<string>ABCDE...</string>
72-
```
73-
74-
#### Add the HockeySDK.swift file to the project
75-
76-
Once the SDK is properly integrated and the App IDs set you have to add the `HockeySDK.swift` file to the Xcode project:
77-
78-
```
79-
Project navigator > Submodules > Add files to "SMF-iOS-CommonProjectSetupFiles" > Choose the folder "HockeyApp"
80-
```
81-
82-
#### Use the HockeySDK.swift helper struct
83-
84-
If all former steps are completed you can call the `HockeySDK.setup()` method during the `applicationDidFinishLaunching(_:)` in the app delegate:
85-
86-
```
87-
func applicationDidFinishLaunching(_ application: UIApplication) {
88-
HockeySDK.setup()
89-
}
90-
```
91-
92-
#### Customiztion
93-
94-
If you want to use a diferent `BITCrashManagerStatus` (the default is `.autoSend`) or want to enable crash reports also for debug builds you can send these as optional parameters:
95-
96-
```
97-
HockeySDK.setup(withStatus: .alwaysAsk, configureHockeyAppAlsoForDebugBuildTypes: true)
98-
```
99-
100-
#### Perform a test crash
101-
102-
If you want to test if crash reports are working you can perform a test crash. This will trigger a `fatalError()`. Note: If you didn't set `configureHockeyAppAlsoForDebugBuildTypes` to `true` you have to build the app as release app in order to capture crashes!
103-
104-
```
105-
HockeySDK.performTestCrash()
106-
```
107-
108-
109-
### Buglife-SDK
110-
111-
This repo contains the `BuglifeSDK` helper struct which takes care of the default Buglife SDK setup with `Shake` as default invocation option to trigger the Buglife view controller.
112-
113-
#### Integrate the Buglife SDK
114-
To use the BuglifeSDK.swift helper struct you have to manually add the Buglife SDK to your project first. Use the preferred way to do this - at this time it's [CocoaPods](https://cocoapods.org).
115-
116-
#### Add the Buglife ID to the info plists
117-
The helper struct will automatically read the IDs from the info plists. It's mandatory to add these with the key `BuglifeId` to all info plists in the project:
118-
119-
```
120-
<key>BuglifeId</key>
121-
<string>ABCDE...</string>
122-
```
123-
124-
#### Add the BuglifeSDK.swift file to the project
125-
126-
Once the SDK is properly integrated and the Buglife ID set you have to add the `BuglifeSDK .swift` file to the Xcode project:
127-
128-
```
129-
Project navigator > Submodules > Add files to "SMF-iOS-CommonProjectSetupFiles" > Choose the folder "Buglife"
130-
```
131-
132-
#### Use the BuglifeSDK.swift helper struct
133-
134-
If all former steps are completed you can call the `BuglifeSDK.setup()` method during the `applicationDidFinishLaunching (_:)` in the app delegate:
135-
136-
```
137-
func applicationDidFinishLaunching(_ application: UIApplication) {
138-
BuglifeSDK.setup()
139-
}
140-
```
141-
142-
#### Customiztion
143-
144-
If you want to use a diferent `LIFEInvocationOptions` (the default is `.shake`) you can send it as optional parameter:
145-
146-
```
147-
BuglifeSDK.setup(withOption: .screenshot)
148-
```
14952

15053
### LifetimeTracker-SDK
15154

@@ -165,7 +68,7 @@ Multiple `#if canImport(LifetimeTracker)` checks make sure that targets with Lif
16568

16669
### SwiftLint
16770

168-
Swiftlint is integrated in SMF-iOS-CommonProjectSetupFiles itself. The current version is 0.28.1.
71+
SwiftLint is integrated in SMF-iOS-CommonProjectSetupFiles itself. The current version is 0.59.1.
16972

17073
#### Integrate it into the project
17174

@@ -187,15 +90,6 @@ excluded:
18790
##### Optional: Call the SwiftLint script without using the setup script
18891
If you want to copy the SwiftLint configuration and lint the code without integrating the setup script you can call `Submodules/SMF-iOS-CommonProjectSetupFiles/SwiftLint/copy-and-run-swiftlint-config.sh` directly.
18992

190-
### DrSwift
191-
192-
[DrSwift](https://github.com/dduan/DrString) is integrated in SMF-iOS-CommonProjectSetupFiles itself. The current version is 0.4.2.
193-
194-
#### Integrate it into the project
195-
196-
DrString is configured to run when you execute `Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh` with [framework target configuration](#setup) parameters.
197-
198-
**Make sure that `/.drstring.toml` is added to the gitignore file as the DrSwift configuration file be automatically copied from the repo into the projects base folder.**
19993

20094
### Xcode version check
20195

6.17 MB
Binary file not shown.

setup-common-project-files.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ if [ $callSwiftlint = true ]; then
130130
./SwiftLint/copy-and-run-swiftlint-config.sh "$projectDir" $isFramework $isSwiftUIProject || exit 1;
131131
fi
132132

133-
if [ $isFramework = true ]; then
134-
./DrString/copy-and-run-DrString-config.sh "$projectDir" || exit 1;
135-
fi
136133

137134
if [ $copyPRTemplate = true ]; then
138135

0 commit comments

Comments
 (0)