XcodeTools

0.2.1

Tool to manage Xcode project versions.
happn-app/XcodeTools

What's New

XcodeTools 0.2.1

2020-09-29T10:43:24Z

First fully functional release of XcodeTools! This release should still be considered pre-alpha software.
Contained in this release is hagvtool v2: a complete rewrite of hagvtool.

XcodeTools

What Is This?

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

XcodeProjKit

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 XcodeProjKit 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 XcodeProjKit 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.

hagvtool

An executable to manage the versions in an Xcode project.

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

Last updated: Sat Jan 13 2024 00:32:11 GMT-1000 (Hawaii-Aleutian Standard Time)