{"id":13994297,"url":"https://github.com/jdee/settings-bundle","last_synced_at":"2025-05-06T09:31:06.852Z","repository":{"id":56845930,"uuid":"72675585","full_name":"jdee/settings-bundle","owner":"jdee","description":"Fastlane plugin to update static settings in an iOS settings bundle","archived":false,"fork":false,"pushed_at":"2020-02-19T11:28:00.000Z","size":215,"stargazers_count":26,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T13:14:46.045Z","etag":null,"topics":["automation","fastlane-plugin","ios"],"latest_commit_sha":null,"homepage":null,"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/jdee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-02T19:48:22.000Z","updated_at":"2023-10-04T23:11:55.000Z","dependencies_parsed_at":"2022-09-17T21:43:44.895Z","dependency_job_id":null,"html_url":"https://github.com/jdee/settings-bundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fsettings-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fsettings-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fsettings-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fsettings-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdee","download_url":"https://codeload.github.com/jdee/settings-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224498991,"owners_count":17321591,"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":["automation","fastlane-plugin","ios"],"created_at":"2024-08-09T14:02:48.585Z","updated_at":"2024-11-13T17:45:48.879Z","avatar_url":"https://github.com/jdee.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# settings_bundle plugin\n\n[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg?style=flat-square)](https://rubygems.org/gems/fastlane-plugin-settings_bundle)\n[![Gem](https://img.shields.io/gem/v/fastlane-plugin-settings_bundle.svg?style=flat)](https://rubygems.org/gems/fastlane-plugin-settings_bundle)\n[![Downloads](https://img.shields.io/gem/dt/fastlane-plugin-settings_bundle.svg?style=flat)](https://rubygems.org/gems/fastlane-plugin-settings_bundle)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/jdee/settings-bundle/blob/master/LICENSE)\n[![CircleCI](https://img.shields.io/circleci/project/github/jdee/settings-bundle.svg)](https://circleci.com/gh/jdee/settings-bundle)\n\n## Getting Started\n\nThis project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-settings_bundle`, run the following command:\n```\nfastlane add_plugin settings_bundle\n```\n\n## About settings_bundle\n\nFastlane plugin to update static settings in an iOS settings bundle\n\n![Sample Settings Bundle](https://github.com/jdee/settings-bundle/blob/master/settings-bundle-example.png)\n\n### update_settings_bundle\n\nThis action updates a specified NSUserDefaults key in the project's\n`Settings.bundle` to a specified value. There are two macros that will\nbe expanded if included in the value argument. `:version` will be\nreplaced with the app's marketing version; `:build` will be replaced with\nthe current build number.\n\n```ruby\nupdate_settings_bundle(\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\"\n)\n```\n\nThis updates the key named `CurrentAppVersion` in the `Root.plist` in the\n`Settings.bundle` to contain the marketing version and build number in the\nspecified format. Use the action this way after `increment_build_number` or\n`increment_version_number` to update your settings bundle as part of a\nversion bump.\n\n#### Specifying the project file\n\nBy default, the action looks for a single .xcodeproj file in the repo,\nexcluding any under Pods. If more than one is present, use the `:xcodeproj`\nparameter:\n\n```ruby\nupdate_settings_bundle(\n  xcodeproj: \"./MyProject.xcodeproj\",\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\"\n)\n```\n\n#### Files other than Root.plist\n\n```ruby\nupdate_settings_bundle(\n  file: \"About.plist\",\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\"\n)\n```\n\nThe `file` argument specifies a file other than `Root.plist` in the\n`Settings.bundle`. If you have multiple projects, keys or files,\nrun the action multiple times.\n\n#### Key content\n\nAny string is valid for the value. It need not contain either or\nboth the symbols mentioned. If it contains neither, the literal value\nof the value argument will be used. This can be useful for including\nother settings besides the version and build numbers.\n\n```ruby\nupdate_settings_bundle(\n  key: \"BuildDate\",\n  value: Time.now.strftime(\"%Y-%m-%d\")\n)\n```\n\n#### Configuration parameter\n\nA project can use different `Info.plist` files per configuration\n(Debug, Release, etc.). However, a project only has a single settings\nbundle. By default, this action uses the `Info.plist` file from the\nRelease configuration. If you want to use the `Info.plist` for a\ndifferent configuration, use a `configuration` parameter:\n\n```ruby\nupdate_settings_bundle(\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\",\n  configuration: \"Debug\"\n)\n```\n\n#### Target parameter\n\nBy default, this action takes the settings from the first non-test, non-extension target in\nthe project. Use the optional :target parameter to specify a target by name.\n```ruby\nupdate_settings_bundle(\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\",\n  target: \"MyAppTarget\"\n)\n```\n\n#### Bundle name parameter\n\nBy default, this action looks for a file called `Settings.bundle` in the project. To\nspecify a different name for your settings bundle, use the `:bundle_name` option:\n```ruby\nupdate_settings_bundle(\n  key: \"CurrentAppVersion\",\n  value: \":version (:build)\",\n  bundle_name: \"MySettings.bundle\"\n)\n```\n\n### Use with commit_version_bump\n\nAs of version 1.3.0, it is no longer necessary\nto pass a `settings` parameter to the built-in `commit_version_bump` action\nwhen using `update_settings_bundle` if you are using Fastlane \u003e= 2.64.0.\n\n```ruby\nincrement_build_number\nupdate_settings_bundle key: \"CurrentAppVersion\",\n                     value: \":version (:build)\"\ncommit_version_bump\n```\n\n```ruby\nincrement_build_number\nupdate_settings_bundle key: \"CurrentAppVersion\",\n                     value: \":version (:build)\",\n                      file: \"About.plist\"\ncommit_version_bump\n```\n\n```ruby\nincrement_build_number\nupdate_settings_bundle key: \"CurrentAppVersion\",\n                     value: \":version (:build)\" # in Root.plist\nupdate_settings_bundle key: \"CurrentFrameworkVersion\",\n                     value: \":version (:build)\",\n                      file: \"Framework.plist\",\n                    target: \"MyFramework\"\ncommit_version_bump\n```\n\nAlso see the [example apps](./examples) and [example Fastfile](./fastlane/Fastfile) in the repo.\n\n## Examples\n\n[SettingsBundleExample]: ./examples/SettingsBundleExample\n[SettingsBundleLibraryExample]: ./examples/SettingsBundleLibraryExample\n\nThere are two examples in the `examples` subdirectory: [SettingsBundleExample] (basic) and\n[SettingsBundleLibraryExample] (advanced).\n\n### SettingsBundleExample (basic)\n\nSee the `examples/SettingsBundleExample` subdirectory for a simple example project that\nmakes use of this action.\n\nFirst build and run the sample project on a simulator or device. It should show\nyou the current\nversion and build number: 1.0.0 (1). This information is taken from the app's Info.plist.\n\nTap the version number to view the settings for\nSettingsBundleExample in the Settings app. You'll see the same version and build number\nas well as a blank field for the Build date.\n\nNow run Fastlane:\n\n```bash\nbundle install\nbundle exec fastlane test\n```\n\nRun the sample app again. It should display 1.0.0 (2). Tap the version number again\nto see the update to the\nsettings bundle. The Build date field should show the current date.\n\n### SettingsBundleLibraryExample (advanced)\n\nThe [SettingsBundleLibraryExample] project includes multiple targets with different versions\nand a settings bundle with multiple pages. In addition to the `SettingsBundleLibraryExample`\ntarget, there is a `SettingsBundleExampleFramework`, which builds a framework that is embedded\nin the application. The app version is 1.0.0. The framework version is 1.0.1.\n\nThe settings bundle includes a child pane in Framework.plist. The app version (CurrentAppVersion)\nand build date are in the Root.plist. The framework version (CurrentFrameworkVersion) is in\nFramework.plist. It appears on the \"Framework settings\" page in the Settings app.\n\nThe lane in the Fastfile makes use of the :target parameter to choose which version data to use.\n\nTo update this project:\n\n```bash\nbundle exec fastlane library_test\n```\n\nNow build and run the app. The settings have been updated with the appropriate version\nfor each component.\n\n#### Note\n\nThough you can use a different version in\nthe `Info.plist` for each target, `agvtool` will\nautomatically set them all to the same value on update.\nIf you do your version update using a different\nmechanism, `:build` will refer to the `CFBundleVersion` from the `Info.plist`\nfor whichever target you use.\n\n## Run tests for this plugin\n\nTo run both the tests, and code style validation, run\n\n```\nrake\n```\n\nTo automatically fix many of the styling issues, use\n```\nrubocop -a\n```\n\n## Issues and Feedback\n\nFor any other issues and feedback about this plugin, please submit it to this repository.\n\n## Troubleshooting\n\nIf you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.\n\n## Using `fastlane` Plugins\n\nFor more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).\n\n## About `fastlane`\n\n`fastlane` is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fsettings-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdee%2Fsettings-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fsettings-bundle/lists"}