{"id":13902961,"url":"https://github.com/uber/uber-poet","last_synced_at":"2025-07-25T16:34:37.815Z","repository":{"id":45057845,"uuid":"156401298","full_name":"uber/uber-poet","owner":"uber","description":"A mock swift project generator \u0026 build runner to help benchmark various module dependency graphs.","archived":false,"fork":false,"pushed_at":"2022-01-12T04:01:09.000Z","size":1025,"stargazers_count":96,"open_issues_count":12,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-11T18:06:15.057Z","etag":null,"topics":["incubation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2018-11-06T15:04:46.000Z","updated_at":"2024-06-21T17:05:43.000Z","dependencies_parsed_at":"2022-08-29T22:02:26.192Z","dependency_job_id":null,"html_url":"https://github.com/uber/uber-poet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uber/uber-poet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fuber-poet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fuber-poet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fuber-poet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fuber-poet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uber","download_url":"https://codeload.github.com/uber/uber-poet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fuber-poet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267030826,"owners_count":24024233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["incubation"],"created_at":"2024-08-06T22:01:31.346Z","updated_at":"2025-07-25T16:34:37.791Z","avatar_url":"https://github.com/uber.png","language":"Python","readme":"# Uber Poet\n\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2983/badge)](https://bestpractices.coreinfrastructure.org/projects/2983)\n[![Build Status](https://github.com/uber/uber-poet/actions/workflows/python-app.yml/badge.svg)](https://github.com/uber/uber-poet/actions)\n\nThis python app makes mock Xcode Swift / ObjC app projects with [Buck](https://buckbuild.com/), [Bazel](https://bazel.build/)\nand [CocoaPods](https://cocoapods.org).  It lets us test different Swift / ObjC module configurations to see how much build speed is affected by different [dependency graphs](docs/layer_types.md) with identical amounts of code.  There are two main command line apps:\n\n* `genproj.py` which generates one app which you have to build manually yourself.  Either with `buck`, `bazel` or `xcodebuild`.\n* `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.\n\nThis 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](docs/layer_types.md).\n\n## How to Install / Dependencies\n\nWith a mac computer that can run macOS 10.13+, install all the dependencies below:\n\n* macOS 10.13.X+, untested on older versions.\n* Python 2.7.X (pre-installed on macOS 10.13+)\n* Xcode command line tools \u0026 Xcode\n    * Install with: `xcode-select --install` / [The mac app store](https://itunes.apple.com/us/app/xcode/id497799835)\n* [pipenv](https://pipenv.readthedocs.io/en/latest/)\n    * Install with [homebrew](https://brew.sh): `brew install pipenv`\n* Optional:  [cloc (Count Lines Of Code)](https://github.com/AlDanial/cloc)\n    * Install with [homebrew](https://brew.sh): `brew install cloc`\n\nDepending on which project generator you plan to use, you will need to install at least one of the following:\n\n* [Buck](https://buckbuild.com/)\n    * [Install instructions](https://buckbuild.com/setup/getting_started.html)\n* [Bazel](https://bazel.build/)\n    * [Install instructions](https://docs.bazel.build/bazel-overview.html)\n* [CocoaPods](https://cocoapods.org/)\n    * [Install instructions](https://cocoapods.org/#get_started)\n\nThen:\n\n* Download / git clone this project into a folder.\n* Run `pipenv install` to install the required python dependencies.\n* If you want to run unit tests or develop for this app, make sure to run `pipenv install --dev`\n\n## How to Use\n\nAfter installing all required dependencies:\n\nSee `pipenv run ./genproj.py -h` or `pipenv run ./mulisuite.py -h` for general help.  Also take a look at the shell scripts in [examples/](examples/) to see examples on how to use these command line programs.\n\nHere a few quick examples:\n\nGenerate a project using Buck:\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"buck\" \\\n                        --blaze_module_path \"/mockapp\" \\\n                        --gen_type flat \\\n                        --swift_lines_of_code 150000\n```\n\nGenerate a project using Bazel:\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"bazel\" \\\n                        --blaze_module_path \"/mockapp\" \\\n                        --gen_type flat \\\n                        --swift_lines_of_code 150000\n```\n\nGenerate a project using CocoaPods:\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"cocoapods\" \\\n                        --gen_type flat \\\n                        --swift_lines_of_code 150000\n```\n\nYou may also generate a project that includes both Swift and ObjC:\n\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"cocoapods\" \\\n                        --gen_type flat \\\n                        --swift_lines_of_code 100000 \\\n                        --objc_lines_of_code 50000\n```\n\n```bash\n# You usually want to use `caffeinate` to prevent your computer \n# from going to sleep during a multi hour build test suite.             \ncaffeinate -s pipenv run \\\n./multisuite.py --log_dir \"$HOME/Desktop/multisuite_build_results\" \\\n                --app_gen_output_dir \"$HOME/Desktop/multisuite_build_results/app_gen\"\n```\n\nYou may also generate a project that matches your own project's dependency graph by using `--gen_type dot` parameter as well as supplying the location of the [`dot` file](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) that represents the graph:\n\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"cocoapods\" \\\n                        --gen_type dot \\\n                        --dot_file_path \"$HOME/MyProject/my_project_graph.dot\" \\\n                        --dot_root_node_name \"MyProject\" \\\n                        --swift_lines_of_code 150000\n```\n\nExamples on how to generate a `dot` file:\n\n\nUsing Buck:\n```\nbuck query \\\"deps(target)\\\" --dot \u003e file.gv\n```\n\nUsing Bazel:\n```\nbazel query \"deps(target)\" --output graph \u003e graph.in\n```\n\nUsing CocoaPods:\n\nInstall and use the [cocoapods-dependencies](https://github.com/segiddins/cocoapods-dependencies) plugin.\n\nYou may also supply an optional JSON file to be used as a LOC map.  This allows you to generate a project from your own dependency graph in which each generated module has proportional LOC to your original graph.\n\n```bash\npipenv run ./genproj.py --output_directory \"$HOME/Desktop/mockapp\" \\\n                        --project_generator_type \"cocoapods\" \\\n                        --gen_type dot \\\n                        --dot_file_path \"$HOME/MyProject/my_project_graph.dot\" \\\n                        --dot_root_node_name \"MyProject\" \\\n                        --loc_json_file_path \"$HOME/MyProject/cloc_mappings.json\"\n```\n\nPlease note the format of the JSON file for LOC mappings must look like:\n\n```json\n{\n    \"MyLibrary\":500,\n    \"MyOtherLibrary\":42\n}\n```\n\nYou may also specify a LOC mapping file that includes the language that you want to use for each module, for example:\n\n```json\n{\n    \"MyLibrary\": { \"loc\": 500, \"language\": \"Objective-C\" },\n    \"MyOtherLibrary\":42\n}\n```\n\nNOTE: All nodes found in your `dot` file must be present in your JSON LOC mappings file.\n\nExamples on how to get the CLOC:\n\n```\ncloc file.swift --include-lang=\"Swift\" --json\n```\n\nParse the JSON with your favorite language and read the `\"code\"` value from the `\"SUM\"` key.\n\n## How to Contribute / Develop\n\nTake a look at [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)! \n\n## Project Status\n\nThis project is stable and being incubated for long-term support.\n\n## Licence\n\nThis project is covered by the Apache License, Version 2.0:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\n[LICENSE.txt](LICENSE.txt)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Fuber-poet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuber%2Fuber-poet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Fuber-poet/lists"}