{"id":28377152,"url":"https://github.com/kayak/attributions","last_synced_at":"2025-06-26T18:32:04.005Z","repository":{"id":87462863,"uuid":"100280148","full_name":"kayak/attributions","owner":"kayak","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-05T13:21:20.000Z","size":524,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-30T00:42:09.786Z","etag":null,"topics":["attributions","framework","github","ios","swift","xcode"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/kayak.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-14T15:04:28.000Z","updated_at":"2024-06-05T13:15:18.000Z","dependencies_parsed_at":"2023-03-04T16:00:45.557Z","dependency_job_id":null,"html_url":"https://github.com/kayak/attributions","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/kayak/attributions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fattributions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fattributions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fattributions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fattributions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayak","download_url":"https://codeload.github.com/kayak/attributions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2Fattributions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262122767,"owners_count":23262471,"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":["attributions","framework","github","ios","swift","xcode"],"created_at":"2025-05-30T00:39:57.035Z","updated_at":"2025-06-26T18:32:03.951Z","avatar_url":"https://github.com/kayak.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attributions\n\nAttributions is a framework used to acknowledge Third-Party Libraries and build tools used to develop and maintain your iOS application. Here's an example:\n\n| \u003cimg src=\"https://github.com/kayak/attributions/blob/master/Screenshots/AttributionsListView.png\" style=\"width: 50%; height: 50%\"\u003e | \u003cimg src=\"https://github.com/kayak/attributions/blob/master/Screenshots/AttributionsLicenseView.png\" style=\"width: 50%; height: 50%\"\u003e |\n:---:|:---:\n\n\n## Compile Attributions\n\nAttributions includes two scripts: one that compiles Attributions from Carthage dependencies, and the other which compiles Attributions from GitHub Repositories (for user specified Third-Party Libraries not managed by Carthage). Remaining Attributions can be specified manually by the user.\n\n### From Cartfile\n\nTo compile Attributions for dependencies managed by Carthage:\n\n* Run `carthage checkout --no-use-binaries` to download framework sources into your project's `Carthage/Checkouts` directory\n* Run `python cartfile2json.py [directory containing Carthage files] [output.json]`\n\n#### Customization\n\nIt's possible to further customize displayed Carthage attributions by modifying `Cartfile` with Attributions macros, which are comments with a simple syntax:\n\n``` text\n# Attributions[macro_key]=macro_value\ngithub \"kayak/attributions\"\n```\n\nAttributions macros apply to the next Carthage framework declaration. You can define multiple macros for a framework by separating each macro into separate line:\n\n``` text\n# Attributions[key1]=value1\n# Attributions[key2]=value2\ngithub \"kayak/attributions\"\n```\n\n### Change attribution display name\n\nSince framework name is inferred from second path of Carthage identifier (after slash), some framework attributions may not display with a self descriptive name. To provide a custom name for an attribution, insert `display_name` macro into `Cartfile`:\n\n``` text\n# Attributions[display_name]=KAYAK Attributions\ngithub \"kayak/attributions\"\n```\n\n### Limit attribution to specific bundle identifier\n\nIf you build multiple apps in one workspace, but there are frameworks, which are only embedded into a subset of those apps, you can limit displayed attributions to only that subset. Collect main app bundle identifiers and insert them with a `displayed_for_main_bundle_ids` macro into `Cartfile`:\n\n``` text\n# Attributions[displayed_for_main_bundle_ids]=com.company.myapp1,com.company.mayapp2\ngithub \"kayak/attributions\"\n```\n\nThis macro is optional and not providing it, displays the framework attribution in all your apps.\n\n### Custom GitHub Attributions\n\nTo compile Attributions for Third-Party Libraries with GitHub Repositories:\n\n* Create an input file containing a list of GitHub Repositories\n    ``` text\n    https://github.com/jenkinsci/jenkins\n    https://github.com/fastlane/fastlane\n    https://github.com/realm/SwiftLint\n    ```\n* Then, run `python attributions2json.py [./input file] [output.json]`\n\n`attributions2json.py` uses GitHub's JSON API. You can work around rate limits by generating an access token and exporting it under `GITHUB_ACCESS_TOKEN` in your shell session.\n\n## Example Attribution JSON Files\n\n* Output file from scripts:\n\n``` json\n[\n    {\n        \"name\": \"[Attribution from Carthage/GitHub]\",\n        \"license\": {\n            \"text\": \"This is a license... \"\n        }\n    },\n    ...\n]\n```\n\n* Example for manually specifying other attributions:\n\n``` json\n[\n    {\n        \"name\": \"[Attribution from user specified license files]\",\n        \"license\": {\n            \"id\": \"unlicense\"\n        }\n    },\n    {\n        \"name\": \"[Attribution from license in main bundle]\",\n        \"license\": {\n            \"filename\": \"unlicenseMain.txt\"\n        }\n    },\n    {\n        \"name\": \"[Attribution from license in another framework]\",\n        \"license\": {\n            \"bundleID\" : \"com.kayak.Framework\",\n            \"filename\": \"unlicenseFW.txt\"\n        }\n    }\n]\n```\n\n**NOTE**: Attributions no longer includes common license files. If you want to continue specifying licenses with the `id` property, you will have to supply the license files yourself. The `setAttributions()` function on `AttributionViewController` now includes a new parameters for passing in an array of these licenses. Each should be the full path to the license file.\n\n## Usage\n\n* `AttributionViewController` - is a subclassed UITableViewController that lists all the Attributions in a grouped UITableView. It has two public members:\n  * `attributionStyle` - an `AttributionStyle` struct used to modify styles (described below)\n  * `setAttributions(from sections: [AttributionSections])` - creates and compiles Attributions from all input JSON files, and populates a grouped UITableView with the data. Each input file is handled as its own section.\n  * NOTE: To use the AttributionViewController, the user must subclass the AttributionViewController, and add an initializer that calls `super.init(style: .grouped)`\n* `AttributionStyles` - is a struct that controls some styling options. Some or all the style parameters  can be specified when instantiated. If a parameter is not specified, the default style is used.\n    * `textColor: UIColor` - `black` by default\n    * `rowHeight: CGFloat` - `44` by default\n    * `statusBarStyle: UIStatusBarStyle`. - `.default` by default\n* `AttributionSections` - is a struct used to define each input JSON Attribution file.\n  * `file` -  URL specifying location of Attribution JSON file\n  * `description` - String describing the file (i.e. \"Carthage\")\n\nTo incorporate Attributions into your project, add the compiled Attribution JSON files to the project. Instantiate an AttributionViewController object, and set the `attributionStyles`. Build an array of `AttributionSections` from the compiled Attributions JSON files. Then call `controller.setAttributions(from: [AttributionSections])`. Lastly, add the AttributionViewController to the desired `UINavigationController`. For more details, please reference the Example App provided and the code snippet below.\n\n* Attributions Implementation Example:\n\n``` swift\nlet attributionController = AttributionController()\nguard let carthageFile = Bundle.main.url(forResource: \"carthageAttributions\", withExtension: \"json\") else {\n    assertionFailure(\"File not found\")\n    return false\n}\nguard let customAttributionsFile = Bundle.main.url(forResource: \"customAttributions\", withExtension: \"json\") else {\n    assertionFailure(\"File not found\")\n    return false\n}\nlet sections = [\n    AttributionSection(file: carthageFile, description: \"Carthage\"),\n    AttributionSection(file: customAttributionsFile, description: \"Other\")\n]\ndo {\n    try attributionController.setAttributions(from: sections)\n} catch {\n    assertionFailure(error.localizedDescription)\n    return false\n}\n\nlet navController = UINavigationController()\nnavController.viewControllers = [attributionController as UIViewController]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fattributions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayak%2Fattributions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fattributions/lists"}