Skip to main content

Debug mode manager for iOS.

Project description

tomnvt

ios-debug

ios-debug is a tool for creating and managing mock implementation. It currently creates a mock implementation for each repository protocol within an iOS project.

THREE THINGS...

...that the app is expected to have:

  • there are repository protocols conforming to ...Repository naming convention
  • there is a single rootViewController assigned (doesn't matter in which file)
  • there is a ContainerBuilder.swift file with registerRepositoryLayer function

INSTALLATION

If you have some version of pip, either pip install ios-debug or pip3 install ios-debug should do the job.

USAGE

There is a simple console UI that show when ios-debug is called. Names of the shown options should be pretty self-explanatory :-)

Each command can be also called by passing it as an argument to ios-debug, e.g. ios-debug start or ios-debug stop.

WHEN IT STARTS

When the debug mode is starting, the following happens:

  1. Swift files are gathered and read
  2. Repository protocols are found
  3. Protocols are parsed and function declarations are extracted
  4. Repository mock implementation template is processed so there is a mock implementation for each protocol function for each repository. Also, Container registration are generated, overriding the origin registration.
  5. Registration functions are added to registerRepositoryLayer function in ContainerBuilder.
  6. MockManager and ShakeableNavigationController are generated.
    • MockManager enables user to choose different mock function implementations at runtime.
    • ShakeableNavigationController is used as rootViewController. It responds to shake gesterus by showing the MockManager.
  7. rootViewController is reassigned to ShakeableNavigationController.
  8. A Run Script build phase is added in order to sync* mock function variants and protocol functions during build.

WHEN IT STOPS

When the debug mode is stopping, the following happens:

  1. Swift files are gathered and read.
  2. All mock repositories are gathered and saved to a binary file.
  3. Calls to registration function are removed from ContainerBuilder.
  4. MockManager and ShakeableNavigationController are removed and ShakeableNavigationController is unassigned as rootViewController.
  5. The Run Script build phase is removed from the project.

*Syncing is basically just turning the debog mode off and on again. The whole process is designed to be a function of the code's state, so there are minimal side effect expectation during the processing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ios-debug-0.1.6.tar.gz (14.6 kB view details)

Uploaded Source

File details

Details for the file ios-debug-0.1.6.tar.gz.

File metadata

  • Download URL: ios-debug-0.1.6.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for ios-debug-0.1.6.tar.gz
Algorithm Hash digest
SHA256 399e579c75d4ad1cb6f6fce976918d4499600e2ea1b937c82a11c2fceb8bce25
MD5 1d929859440cfe0295a1ca1683af33b2
BLAKE2b-256 106b359968dfdffb5d5fd63450237f7e91d51c5494f5165a27b4570591687126

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page