{"id":23635092,"url":"https://github.com/joncardasis/cocoapods-user-defined-build-types","last_synced_at":"2025-04-06T06:10:20.618Z","repository":{"id":37718040,"uuid":"239028947","full_name":"joncardasis/cocoapods-user-defined-build-types","owner":"joncardasis","description":"⚒ A cocoapods plugin that can selectively set build type per pod (static library, dynamic framework, etc.)","archived":false,"fork":false,"pushed_at":"2020-10-02T06:25:48.000Z","size":33,"stargazers_count":134,"open_issues_count":7,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T20:05:33.353Z","etag":null,"topics":["build-types","cocoapods","cocoapods-plugin","dynamic","dynamic-frameworks","framework","library","pod","react-native","static"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/joncardasis.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":"2020-02-07T21:50:57.000Z","updated_at":"2024-04-04T15:17:48.000Z","dependencies_parsed_at":"2022-09-15T14:14:32.432Z","dependency_job_id":null,"html_url":"https://github.com/joncardasis/cocoapods-user-defined-build-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2Fcocoapods-user-defined-build-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2Fcocoapods-user-defined-build-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2Fcocoapods-user-defined-build-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2Fcocoapods-user-defined-build-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncardasis","download_url":"https://codeload.github.com/joncardasis/cocoapods-user-defined-build-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441053,"owners_count":20939239,"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":["build-types","cocoapods","cocoapods-plugin","dynamic","dynamic-frameworks","framework","library","pod","react-native","static"],"created_at":"2024-12-28T05:30:33.703Z","updated_at":"2025-04-06T06:10:20.456Z","avatar_url":"https://github.com/joncardasis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cocoapods-user-defined-build-types\n![Latest Version](https://img.shields.io/badge/Latest_supported_CocoaPods-1.9.1-gray.svg)\n\nAllow CocoaPods to mix dynamic/static libaries/frameworks.\n\nThis plugin allows for a Podfile to specify how each Pod (or multiple Pods) should be built (ex. *as a dynamic framework*).\n\n\n## Installation\n```Bash\n$ gem install cocoapods-user-defined-build-types\n```\n\n## Usage\n```C\nplugin 'cocoapods-user-defined-build-types'\n\nenable_user_defined_build_types!\n\ntarget \"CoffeeApp\" do\n    pod 'Alamofire'\n    pod \"SwiftyJSON\", :build_type =\u003e :dynamic_framework\n```\n- Add `plugin 'cocoapods-user-defined-build-types'` to the top of your Podfile\n- Add the `enable_user_defined_build_types!` directive to the top of your Podfile (removing `use_frameworks!` if present)\n- Add a `build_type` option to one or more Pods to direct how they're built (ex. `:build_type =\u003e :dynamic_framework`)\n- `pod install`\n\nBased on this configuration, CocoaPods will build your project such that `Alamofire` stays a static library (CocoaPods default) and is part of the umbrella `Pods-CoffeeApp` static library generated by CocoaPods. `SwiftyJSON` will become a dynamic framework and dynamically linked in CoffeeApp.\n\n| SUPPORTED BUILD TYPES |\n| --- |\n| `dynamic_library` |\n| `dynamic_framework` |\n| `static_library` |\n| `static_framework` |\n\n## Why\nCocoapod's `use_frameworks!` directive makes **all** integrated Pods build as dynamic frameworks.\n\nThis can cause issues with certain Pods. You may want some pods to be static libraries and a single Pod to a dynamic framework. CocoaPods currently does not support this. The `cocoapods-user-defined-build-types` plugin allows for build types to be changed on a Pod-by-Pod basis, otherwise defaulting to CocoaPods default build type (static library). \n\nThis plugin was specifically built for React Native projects to be able to incorporate dynamic Swift Pods without needing to change other Pods.\n\n## Verbose Logging\nHaving issues? Try enabling the plugin's verbose logging from the Podfile:\n```C\nplugin 'cocoapods-user-defined-build-types', {\n  verbose: true\n}\n\n...\n```\n\nFor even more detailed logging, the development flag can be set in your terminal env: `export CP_DEV=1`.\n\n## How\nBy overriding `Pod::Podfile::TargetDefinition`'s `build_type` function (from cocoapods-core) to return the specifed linking (static/dynamic) and packing (library/framework), we can change how Cococpods builts specific dependencies. Currently in core, there is support for multiple build type but the use_frameworks! directive is the only way to enable framework builds, and it is an all-or-nothing approach.\n\n## License\nAvailable under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Fcocoapods-user-defined-build-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncardasis%2Fcocoapods-user-defined-build-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Fcocoapods-user-defined-build-types/lists"}