DmytroShvetsov / uber-poet

A mock swift project generator & build runner to help benchmark various module dependency graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uber Poet

CII Best Practices Build Status

This python app makes mock Xcode Swift app projects with BUCK. It lets us test different swift module configurations to see how much build speed is affected by different dependency graphs with identical amounts of code. There are two main command line apps:

  • genproj.py which generates one app which you have to build manually yourself. Either with BUCK or xcodebuild.
  • multisuite.py, which generates all module configs, builds them, records how long they take to build into a CSV and outputs it's results to a directory passed in the command line. Essentially a benchmark test suite. Can take several hours to run depending how many lines of code each app takes.

This app was architected so other languages, graph generators or build systems wouldn't be much work to add. Theoretically you could extend this app to generate java gradle android apps with the same dependency graph types.

Project Status

This project is stable and being incubated for long-term support.

How to Install / Dependencies

With a mac computer that can run macOS 10.13+, install all the dependencies below:

Then:

  • Download / git clone this project into a folder.
  • Run pipenv install to install the required python dependencies.
  • If you want to run unit tests or develop for this app, make sure to run pipenv install --dev

How to Use

After installing all required dependencies:

See pipenv run ./genproj.py -h or pipenv run ./mulisuite.py -h for general help. Also take a look at the shell scripts in examples/ to see examples on how to use these command line programs.

Here a few quick examples:

pipenv run ./genproj.py --output_directory "$HOME/Desktop/mockapp" \
                        --buck_module_path "/mockapp" \
                        --gen_type flat \
                        --lines_of_code 150000
# You usually want to use `caffeinate` to prevent your computer 
# from going to sleep during a multi hour build test suite.             
caffeinate -s pipenv run \
./multisuite.py --log_dir "$HOME/Desktop/multisuite_build_results" \
                --app_gen_output_dir "$HOME/Desktop/multisuite_build_results/app_gen"

How to Contribute / Develop

Take a look at docs/CONTRIBUTING.md!

Licence

This project is covered by the Apache License, Version 2.0:

http://www.apache.org/licenses/LICENSE-2.0

LICENSE.txt

About

A mock swift project generator & build runner to help benchmark various module dependency graphs.

License:Apache License 2.0


Languages

Language:Python 98.2%Language:Shell 1.8%