Giter VIP home page Giter VIP logo

xcconfig-extractor's Introduction

xcconfig-extractor

Refactor buildSettings into xcconfigs.

Build Status patreon

Requirements

  • Xcode10+ is officially supported, but should work against older ones too.

Usage

$ xcconfig-extractor /path/to/Your.xcodeproj Configurations

This will create xcconfig files under Configuration dir. Configurations are removed from buildSettings section of pbxproj.

Generated xcconfigs are added to your project automatically. ✏️

xcode's general tab

Available Options

Options:
    --no-trim-duplicates [default: false] - Don't extract duplicated lines to common xcconfig files, simply map each buildSettings to one file.
    --no-edit-pbxproj [default: false] - Do not modify pbxproj at all.
    --include-existing [default: true] - `#include` already configured xcconfigs.
    --no-set-configurations [default: false] - Do not set xcconfig(baseConfigurationReference) in pbxproj. Ignored if `--no-edit-pbxproj` is true.

Build Setting Validation

⚠️ Waring ⚠️

xcconfig-extractor is a refactoring tool. It shouldn't affect your App's actual "Build Setting".

Recommended way to check Build Settings is to use xcodebuild command. Make sure outputs does not change between before and after.

$ xcodebuild -showBuildSettings -configuration Release > before
$ # apply xcconfig-extractor
$ xcodebuild -showBuildSettings -configuration Release > after
$ diff before after # should prints nothing!

If outputs differ, fix it manually e.g. simply by adding missing value to target's xcconfig.

xcconfig does not allow any $(inherited) from #includeing xcconfigs. (See: #8 (comment)) So if you have any existing xcconfig configured on your project, it might cause problems. This article is helpful to understand how inheritance works.

agvtool compatibility

⚠️ Waring ⚠️

If you use agvtool for automatic versioning, it won't work after applying xcconfig-extractor.
agvtool updates versions correctly iff INFOPLIST_FILE is configured in Xcode's buildSettings section.

So make sure you either

  • Restore INFOPLIST_FILE in Xcode's buildSettings section.

or

  • Quit using agvtool and fallback to other tools like /usr/libexec/PlistBuddy to update Info.plist.

e.g.

/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $(git describe --tags --abbrev=0)" App/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${BITRISE_BUILD_NUMBER}-${BITRISE_GIT_BRANCH}" App/Info.plist

Install

mint install toshi0383/xcconfig-extractor

Build from source

  • Clone this repo and run swift build -c release.
  • Executable will be created at .build/release/xcconfig-extractor.

Donate

If you think it's a useful tool, consider donation to maintain project.

patreon

License

MIT

xcconfig-extractor's People

Contributors

tokijh avatar toshi0383 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xcconfig-extractor's Issues

clarification with cocoapods

I run the xcconfig-extractor and it successfully rips out settings to Configuration folder.

It seems that cocoapods overrides all configs with it's own files.
Perhaps need to have cocoapods optionally adopt this library to strip out settings.
Is there any way to have the new config files piggy back off the pod settings? (inherit from)
screen shot 2017-05-12 at 9 45 18 am

Failed to parse xcodeproj

Dear @toshi0383

Your library is very useful and I've tried to use it.
The following error has occurred.
Can you advise me on what to do, Thanks.

スクリーンショット 2020-08-18 11 34 28

Environment

  • Xcode 11.6
  • Swift 5.2.4
  • xcconfig-extractor 0.5.0

Automatic Build Setting Validation

It might be useful if "Build Setting Validation" automatically happens for users. User is warned if Build Setting changed by xcconfig-extractor.

Outdated installer

Hi, I just wanted to install the newest version of this tool using your install script, but it still installs v0.5 instead of v0.6.1, since it is the latest tag referenced to a release.

can't install

Hi.

I would like to install it.
then i tried that.

but it can't be installed because of the following errors.

➜  ~ bash <(curl -sL https://raw.githubusercontent.com/toshi0383/scripts/master/swiftpm/install.sh) toshi0383/xcconfig-extractor

https://github.com/toshi0383/xcconfig-extractor/releases/download/0.4.0/xcconfig-extractor.zip
Archive:  xcconfig-extractor.zip
   creating: usr/
   creating: usr/local/
   creating: usr/local/bin/
  inflating: usr/local/bin/xcconfig-extractor
   creating: usr/local/Frameworks/
   creating: usr/local/Frameworks/xcconfig-extractor/
chmod: bin/xcconfig-extractor: No such file or directory

what is this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.