{"id":18103553,"url":"https://github.com/mgrebenets/fastlane-plugin-xcconfig_actions","last_synced_at":"2025-04-13T19:26:03.066Z","repository":{"id":56846030,"uuid":"171790408","full_name":"mgrebenets/fastlane-plugin-xcconfig_actions","owner":"mgrebenets","description":"Fastlane plugin to work with xcconfig files","archived":false,"fork":false,"pushed_at":"2019-08-24T08:03:37.000Z","size":791,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T10:08:13.200Z","etag":null,"topics":["apple","buck","fastlane","fastlane-plugin","ios","macosx","xcconfig","xcode"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/mgrebenets.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":"2019-02-21T03:04:38.000Z","updated_at":"2023-08-20T06:23:16.000Z","dependencies_parsed_at":"2022-09-17T21:53:36.421Z","dependency_job_id":null,"html_url":"https://github.com/mgrebenets/fastlane-plugin-xcconfig_actions","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/mgrebenets%2Ffastlane-plugin-xcconfig_actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrebenets%2Ffastlane-plugin-xcconfig_actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrebenets%2Ffastlane-plugin-xcconfig_actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgrebenets%2Ffastlane-plugin-xcconfig_actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgrebenets","download_url":"https://codeload.github.com/mgrebenets/fastlane-plugin-xcconfig_actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766900,"owners_count":21158346,"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":["apple","buck","fastlane","fastlane-plugin","ios","macosx","xcconfig","xcode"],"created_at":"2024-10-31T22:12:31.629Z","updated_at":"2025-04-13T19:26:03.038Z","avatar_url":"https://github.com/mgrebenets.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xcconfig_actions plugin\n\n[![license](https://img.shields.io/github/license/mgrebenets/fastlane-plugin-xcconfig_actions.svg)](https://github.com/mgrebenets/fastlane-plugin-xcconfig_actions)\n[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-xcconfig_actions)\n[![version](https://img.shields.io/github/tag/mgrebenets/fastlane-plugin-xcconfig_actions.svg?color=green\u0026label=version)](https://github.com/mgrebenets/fastlane-plugin-xcconfig_actions)\n[![CircleCI](https://circleci.com/gh/mgrebenets/fastlane-plugin-xcconfig_actions.svg?style=svg)](https://circleci.com/gh/mgrebenets/fastlane-plugin-xcconfig_actions)\n[![Travis CI](https://img.shields.io/travis/mgrebenets/fastlane-plugin-xcconfig_actions.svg?label=%20\u0026logo=travis)](https://travis-ci.org/mgrebenets/fastlane-plugin-xcconfig_actions)\n[![Coverage Status](https://coveralls.io/repos/github/mgrebenets/fastlane-plugin-xcconfig_actions/badge.svg)](https://coveralls.io/github/mgrebenets/fastlane-plugin-xcconfig_actions)\n[![Inline docs](http://inch-ci.org/github/mgrebenets/fastlane-plugin-xcconfig_actions.svg)](http://inch-ci.org/github/mgrebenets/fastlane-plugin-xcconfig_actions)\n\n## Getting Started\n\nThis project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-xcconfig_actions`, add it to your project by running:\n\n```bash\nfastlane add_plugin xcconfig_actions\n```\n\n## About xcconfig_actions\n\nAdds actions to fastlane to work with xcconfig files.\n\n### read_xcconfig\n\nThe `read_xcconfig` action reads contents of xcconfig file the same way Xcode would do, meaning\n\n- Support for resolving variable references like `$(VAR)`\n- Support for nested variable references like `$(VAR1_$(VAR2))`\n- Support for `#include \"other.xcconfig\"` statements\n- Support for project/target level inheritance mechanism\n- Support for `XCODE_VERSION_MAJOR` build setting\n\nSee [this xcconfig guide](https://pewpewthespells.com/blog/xcconfig_guide.html) for detailed explanation.\n\nThings **not supported** at the moment:\n\n- Conditional variable assignment, such as `FOO[sdk=macosx*] = 1`\n- Use of `\u003cDEVELOPER_DIR\u003e` in include paths\n\nThe build settings are also saved as a dictionary under `SharedValues::XCCONFIG_ACTIONS_BUILD_SETTINGS` key in current `lane_context`.\n\n### build_settings_to_flags\n\nMap build settings to Clang Cxx/Objective-C compiler, Swift compiler and Linker flags.\n\nThis action is useful when you plan to reuse xcconfigs with other tools, such as [Buck](https://buckbuild.com/), and you want to translate xcconfigs into the compiler/linker flags.\n\nBuild flags can be printed to standard output or saved to file.\nThe flags are also available via lane context as `lane_context[SharedValues::XCCONFIG_ACTIONS_BUILD_FLAGS]`.\n\nThe result is a dictionary with following keys:\n\n- `compiler_flags` for Clang CXX/Objective-C compiler.\n- `swift_compiler_flags` for Swift compiler.\n- `linker_flags` for Clang linker.\n\n#### Unofficial Build Settings References\n\nThe following are unofficial build settings references.\nUnlike official help page, these pages contain extra information, such as build settings cross-reference and compiler and linker flags mapping.\n\n- [Xcode 11.0 Beta 6 Build Settings](lib/fastlane/plugin/xcconfig_actions/helper/xcspecs/11.0/README.md)\n- [Xcode 10.3 Build Settings](lib/fastlane/plugin/xcconfig_actions/helper/xcspecs/10.3/README.md)\n- [Xcode 10.2.1 Build Settings](lib/fastlane/plugin/xcconfig_actions/helper/xcspecs/10.2.1/README.md)\n- [Xcode 10.2 Build Settings](lib/fastlane/plugin/xcconfig_actions/helper/xcspecs/10.2/README.md)\n- [Xcode 10.1 Build Settings](lib/fastlane/plugin/xcconfig_actions/helper/xcspecs/10.1/README.md)\n\n#### References\n\n- [Xcode Build Settings](https://help.apple.com/xcode/mac/10.2/#/itcaec37c2a6)\n- [LLVM Clang Command Line Options](https://clang.llvm.org/docs/ClangCommandLineReference.html)\n- [LLVM Clang Diagnostics](https://clang.llvm.org/docs/DiagnosticsReference.html)\n- [GCC Warning Options](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html)\n- https://gist.github.com/fabiopelosin/4560417\n- [Xcode Build System](https://pewpewthespells.com/blog/xcode_build_system.html)\n\n#### Caveats\n\nFlags like `-sdk iphoneos` and `-isysroot iphoneos` may not be suitable for all use cases.\nThese settings only get generated if you add `SDKROOT = iphoneos` to your xcconfigs, so don't define `SDKROOT` in xcconfigs and leave it to build tool.\n\n##### Code Coverage\n\nFlags like `CLANG_ENABLE_CODE_COVERAGE` will not have effect if set to `YES`.\nThis flag needs to be accompanied by changes in Xcode scheme UI to enable code coverage.\n\nWhen used from command just setting `CLANG_ENABLE_CODE_COVERAGE=YES` has no effect either, instead the `-enableCodeCoverage YES` option has to be used.\n\nIn case of `CLANG_ENABLE_CODE_COVERAGE` add `CLANG_COVERAGE_MAPPING = YES` to xcconfigs to get proper flags mapping.\n\n#### Known Issues\n\n- [ ] The flags like `-std=gnu++14` are added to `compiler_flags` but are not applicable for C/Objective-C code.\nMost tools have differentiation between C flags (C and Objective-C) and Cxx flags (C++/Objective-C++).\nThe solution would be to return 2 sets of flags for C and Cxx families, instead of just one `compiler_flags` option.\n- [ ] [Build setting transformations](http://codeworkshop.net/posts/xcode-build-setting-transformations) like `$(PRODUCT_NAME:c99extidentifer)` are [not supported yet](https://github.com/mgrebenets/fastlane-plugin-xcconfig_actions/issues/1).\n- [ ] Xcconfig includes are resolved **before** variable references. For example:\n\n    ```c\n    #include \"A.xcconfig\"\n    VAR = A\n    #include \"B.xcconfig\" // Contains \"VAR = B\" statement.\n\n    // Resolved value of `VAR` is \"B\".\n    ```\n\n    Will be resolved in the following order:\n\n    ```c\n    #include \"A.xcconfig\"\n    #include \"B.xcconfig\"\n    VAR = A\n\n    // Resolved value of `VAR` is \"A\"!\n    ```\n\n    This will cause issues if value of `VAR` is set in `B.xcconfig`.\n\n### validate_xcconfig\n\nValidate xcconfig using set of very opinionated rules:\n\n- All included files must exist\n- Include flow is unidirectional, i.e. top-down only:\n\n```c\n#include \"../level_up.xcconfig\" // ERROR: File is in parent directory.\n```\n\n- Files do not include other files on the same level:\n\n```c\n#include \"same_level.xcconfig\" // ERROR: Included file is on the same level.\n```\n\n- Files do not include other files more than 1 level down\n\n```c\n#include \"level1/level2/level2.xcconfig\" // ERROR: 2 levels down: level1/level2.\n```\n\n- Duplicated includes are not allowed\n\n```c\n#include \"other.xcconfig\"\n#include \"other.xcconfig\" // ERROR: Duplicated include.\n```\n\n- Circular includes are not allowed\n\n```c\n// example.xcconfig file\n#include \"example.xcconfig\" // ERROR: Include self creates circular include.\n```\n\nThings **not supported** at the moment:\n\n- Use of `\u003cDEVELOPER_DIR\u003e` in include paths\n\n#### Rules Explanation\n\nXcconfigs are too easy to get out of hand.\nAbility to use arbitrary include paths complicates usage of xcconfigs in quite a few ways:\n\n- Hard to track where the variables are declared and then overwritten\n- Xcode does not always report an error when a file is missing, but silently fails to resolve variables instead\n\nThese rules introduce convention to organizing xcconfigs.\nThe end goal is to make config files more manageable.\n\nThis helps greatly when configs are used in Xcode combined with project-level and target-level inheritance.\n\n## Example\n\nCheck out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and\n\n```shell\n# Read xcconfig example.\nbundle exec fastlane read\n\n# Map build settings to build flags.\nbundle exec fastlane build_flags\n\n# Validate xcconfig example.\nbundle exec fastlane validate\n```\n\n## Run tests for this plugin\n\nTo run both the tests, and code style validation, run\n\n```shell\nrake\n```\n\nTo automatically fix many of the styling issues, use\n\n```shell\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://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.\n\n## Using _fastlane_ Plugins\n\nFor more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).\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%2Fmgrebenets%2Ffastlane-plugin-xcconfig_actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgrebenets%2Ffastlane-plugin-xcconfig_actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgrebenets%2Ffastlane-plugin-xcconfig_actions/lists"}