Coder Social home page Coder Social logo

xcodetools's Introduction

XcodeTools

What Is This?

A collection of utilities to work with Xcode files. Currently there are two products in this SPM project.

XcodeProj

A reusable lib to work with xcodeproj files. Specifically the lib allows easy parsing of pbxproj and xcconfig files. Schemes are not supported (yet).

Example of use:

let xcodeproj = try XcodeProj(autodetectInFolderAtPath: "/path/to/project/")
try xcodeproj.iterateCombinedBuildSettingsOfTargets{ target, targetName, configurationName, combinedBuildSettings in
   print("\(targetName) - \(configurationName)")
   /* The line below returns the resolved value of the MARKETING_VERSION build
    * setting. All the rules I’m aware of (Xcode 12 beta 6) are followed,
    * including but not limited to:
    *    - Thorough xcconfig files parsing;
    *    - Embedded variables like so “$(VALUE_$(VARIANT))”;
    *    - Resolution of variable depending on build config levels (project config, then targets);
    *    - Other… */
   print(combinedBuildSettings["MARKETING_VERSION"])
}

Note: Parsing the parameters in a build configuration (e.g. FOO[sdk=macosx*]) is supported, however the resolution of the variables do not take the parameters in account yet.

Other Note: I use the post-Xcode 10 variable resolution to resolve variables. You might see a difference in the values XcodeProj computes and the ones Xcode shows in the GUI editor. That is expected; the GUI seems to still use the pre-Xcode 10 algorithm to resolve its variables.
You should however get the same values than XcodeProj at build time, if you don’t please file an issue!
You can check whether the values are the same by adding a key in your Info.plist file with the value set to $(VAR_TO_CHECK) and checking the values in the plist at runtime.
See https://stackoverflow.com/a/50731052 for more info about Xcode variable resolutions.

xct-versions

An executable to manage the versions in an Xcode project.

xcodetools's People

Contributors

frizlab avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.