/Statio

Primary LanguageSwiftMIT LicenseMIT

Statio 2

Build status license swift-version xcode-version

Statio is a system activity monitor for iOS devices. It is a Swift rewrite of the existing Objective-C app of the same name 9that is already available on the app store today.

The app is comprised of the primary app target, as well as several first party libraries and third party dependencies, the latter of which are integrated using the Swift Package Manager.

  • External Third Party Dependencies
    • SnapKit, an AutoLayout DSL
    • CombineExt, a collection of operators, publishers and utilities for Combine, that are not provided by Apple themselves, but are common in other Reactive Frameworks and standards.
    • Countly, Countly Product Analytics iOS SDK with macOS, watchOS and tvOS support.
    • NeedleFoundation, Compile-time safe Swift dependency injection framework (More Details Below)
    • iOSSnapshotTestCase, Snapshot Testing for iOS
  • External First Party Dependencies
  • Internal First Party Libraries
    • ShortRibs, a trimmed down version of Uber's RIBs, wihout routers, using Combine instead of RxSwift
    • Logging, a wrapper for Apple Unified Logging
    • Analytics, a Swift wrapper for Countly's Objective-C SDK
    • MonitorKit, A set of system monitoring utilities in Swift.

Additionally, the repo makes use of the following third party tooling utilities:

You need not install these utilities. The correct versions are bundled in the repo.

Setting Up

Instead of interacting with the third party tooling directly, you use the repo command line utility. Start by running the bootstrap command

$ cd path/to/repo
$ ./repo bootstrap

You will need Xcode 12.5 for this command to succeed. From there, you can run ./repo develop and generate the Xcode workspace to begin development.

Updating the DI graph

The generated workspace automatically updates the Needle dependency graph everytime a new build is triggered within Xcode. To update the DI graph manually, run the following:

$ cd path/to/repo
$ ./repo generate dig

Updating Mocks and Running Tests

First, generate the Xcode workspace:

$ cd path/to/repo
$ ./repo generate project

Then, update the protocol mocks:

$ ./repo generate mocks

Finally, run the unit tests:

$ ./repo test --pretty

Alternatively, you can open the generate the Xcode workspace and run the tests from there. Protocol mocks will be updated automatically.

Linting

You can lint swift files like this:

$ cd path/to/repo
$ ./repo lint

Add the --autofix flag to automatically correct fixable lint errors.