{"id":25272895,"url":"https://github.com/apleshkov/saber","last_synced_at":"2025-10-27T10:32:24.672Z","repository":{"id":63904259,"uuid":"142469070","full_name":"apleshkov/saber","owner":"apleshkov","description":"Dependency injection (DI) \u0026 Inversion of Control (IoC) command line tool for Swift based on code generation","archived":false,"fork":false,"pushed_at":"2019-04-01T19:25:44.000Z","size":154,"stargazers_count":20,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-21T00:50:05.342Z","etag":null,"topics":["dependency-injection","inversion-of-control","saber","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apleshkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-26T16:52:21.000Z","updated_at":"2024-08-12T19:40:22.000Z","dependencies_parsed_at":"2023-01-14T13:01:11.396Z","dependency_job_id":null,"html_url":"https://github.com/apleshkov/saber","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apleshkov%2Fsaber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apleshkov%2Fsaber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apleshkov%2Fsaber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apleshkov%2Fsaber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apleshkov","download_url":"https://codeload.github.com/apleshkov/saber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238481261,"owners_count":19479638,"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","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":["dependency-injection","inversion-of-control","saber","swift"],"created_at":"2025-02-12T13:37:15.352Z","updated_at":"2025-10-27T10:32:23.584Z","avatar_url":"https://github.com/apleshkov.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saber\n\n[Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) (DI) / [Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) (IoC) _command line_ tool for Swift based on __code generation__.\n\n_Saber_ requires __no__ frameworks, just parses sources (via [SourceKitten](https://github.com/jpsim/SourceKitten)), finds [annotations](https://github.com/apleshkov/saber/wiki/Annotations) and generates [containers](https://github.com/apleshkov/saber/wiki/Container).\n\n## Documentation\n\nPlease, see [wiki](https://github.com/apleshkov/saber/wiki) and [examples](https://github.com/apleshkov/saber-examples).\n\n## Installation\n\nBuilding on macOS requires Xcode w/ Swift 4.2 and Swift Package Manager.\n\n### [Mint](https://github.com/yonaskolb/mint)\n\n```\n$ mint install apleshkov/saber\n```\n\n### Homebrew\n\n_TODO_ ([not notable enough](https://github.com/Homebrew/homebrew-core/pull/34604) yet)\n\n### Make\n\nClone \u0026 run `make install` in the root directory of this project.\n\nRun `make uninstall` to uninstall.\n\n## Usage\n\n```\n$ saber help\nAvailable commands:\n\n   help        Display general or command-specific help\n   sources     Generate containers from sources\n   version     Print current version\n   xcodeproj   Generate containers from Xcode project\n```\n\n### sources\n\n_Saber_ traverses swift-files `--from` __recursively__ and generates container classes to `--out`.\n\nExample: `saber sources --workDir . --from Sources --out Sources/Saber`\n\n```\n$ saber help sources\nGenerate containers from sources\n\n[--workDir (string)]\n\tWorking directory (optional)\n\n[--from (string)]\n\tDirectory with sources (is relative to --workDir if any)\n\n[--out (string)]\n\tOutput directory (is relative to --workDir if any)\n\n[--config (string)]\n\tPath to *.yml or YAML text (optional)\n\n[--log (string)]\n\tCould be 'info' (by default) or 'debug' (optional)\n```\n\n### xcodeproj (on macOS only)\n\n_Saber_ parses Xcode project at `--path`, traverses enumerated `--targets` and generates container classes to `--out`. The main difference from the `sources` command is an ability to work with __Swift modules__.\n\nExample: `saber xcodeproj --workDir . --path MyProject.xcodeproj --targets Target1,Target2 --out Sources/Saber`\n\n```\n$ saber help xcodeproj\nGenerate containers from Xcode project\n\n[--workDir (string)]\n\tWorking directory (optional)\n\n[--path (string)]\n\tPath to *.xcodeproj (is relative to --workDir if any)\n\n[--targets (string)]\n\tComma-separated list of project target names\n\n[--out (string)]\n\tOutput directory (is relative to --workDir if any)\n\n[--config (string)]\n\tPath to *.yml or YAML text (optional)\n\n[--log (string)]\n\tCould be 'info' (by default) or 'debug' (optional)\n```\n\n### Configuration\n\nProvide it via `--config` as text or file:\n```yaml\n# Access level for generated classes (internal by default)\naccessLevel: internal # public, open, ...\n# Identation for generated files (4 spaces by default)\nindentation:\n    type: space # or tab\n    size: 4\n# Lazy typealias (see wiki; none by default)\nlazyTypealias: LazyInjection\n```\n\n## Development\n\n__Xcode__: clone, run `make xcodeproj` and then open a generated `Saber.xcodeproj`. Use `make docker_linux_test` to test on Linux inside a [docker](https://www.docker.com) container.\n\n__Linux__: `make clean`, `make build` and `make test`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapleshkov%2Fsaber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapleshkov%2Fsaber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapleshkov%2Fsaber/lists"}