🚘 A simple tool for updating Carthage script phase

Overview

Carting

Make Swift Package Manager

Do you use Carthage? Are you feel tired of adding special script and the paths to frameworks (point 4, 5 and 6 in Getting Started guide) manually? Me too. Carting does it for you. It scans Carthage folder and linked frameworks, gets framework names and updates the script.

Carting usage

Using

Run carting update in project folder. That's all.

By default Carting searches a script named Carthage, but you can set a name of your script via command line arguments:

$ carting update -s MyBestScript

If there is no script with the name, Carting will add a new one.

Since Xcode 10 Run Script Phases support declaring input and output files in a .xcfilelist file. This file should contain a newline-separated list of the file paths for the inputs or outputs. Carting uses it by default. If you need to work with your projects in old Xcode versions, use -f file option.

🚨 Note: be sure to have no uncommitted changes in project file to prevent project parsing errors 😱 .

Project parsing error

Run carting --help to see available commands:

OVERVIEW: 🚘 Simple tool for updating Carthage script phase

USAGE: Carting <command> <options>

SUBCOMMANDS:
  info                    Prints Carthage frameworks list with linking description.
  lint                    Lint the project for missing paths.
  update                  Adds a new script with input/output file paths or updates the script named `Carthage`.

Linting

Integrate Carting into an Xcode scheme to get errors displayed in the IDE. Just add a new "Run Script Phase" with:

/usr/local/bin/carting lint

Run Script Phase

Installing

Homebrew (recommended):

$ brew tap artemnovichkov/projects
$ brew install carting

Mint:

$ mint run artemnovichkov/carting

Make:

$ git clone https://github.com/artemnovichkov/carting.git
$ cd Carting
$ make

Swift Package Manager:

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/artemnovichkov/carting", majorVersion: 2)
    ]
)

Author

Artem Novichkov, https://www.artemnovichkov.com/about

License

Carting is available under the MIT license. See the LICENSE file for more info.

Comments
  • Brew update v1.3.3 ChecksumMismatchError

    Brew update v1.3.3 ChecksumMismatchError

    What did you do?

    brew upgrade carting

    What did you expect to happen?

    • Successfully upgrade to v1.3.3

    What happened instead?

    Error: An exception occurred within a child process:
      ChecksumMismatchError: SHA256 mismatch
    
    opened by kevnm67 15
  • Feedback on No Application Targets

    Feedback on No Application Targets

    Thanks for the great tool!

    I have a (pre-existing) project, a framework, that uses Carthage. I clone it out, do carthage update --platform ios and then carting update.

    πŸ€·β€β™‚οΈ Nothing to update.

    Hm...there's no Carthage script, no xcfilelists or anything. Building the project errors because the frameworks are missing. It seems like carting update is a complete no-op.

    carting info
    

    I get some results, for example:

    SwiftSoup.framework dynamic i386, x86_64, armv7, arm64

    Okay, so Carting knows that the frameworks are there, why is update not doing anything?

    In fooling around, I tried the --target flag giving the name of my framework target within the project, and I get Error: There is no target with <argument> name.

    I feel like I may be doing something wrong or have some rather large misconception; I'm used to carthage update, drag the frameworks into Frameworks and Libraries, and carting update to finish it off. I confess to be fairly ignorant as to the deep inner workings of linking frameworks and such business. Any help would be appreciated and if there's a bug I can do a PR.


    Totally disrelated, but I spotted it whilst fooling around:

    ~/g/project> carting help update
    OVERVIEW: Adds a new script with input/output file paths or updates the script named `Carthage`.
    
    USAGE: carting update [--script <script>] [--path <path>] [--format <format>] [--target <target>] [--project-names <project-names> ...]
    
    OPTIONS:
      -s, --script <script>   The name of Carthage script. (default: Carthage)
      -p, --path <path>       The project directory path. (default: nil)
      -f, --format <format>   Format of input/output file paths: file - using simple paths, list - using xcfilelists (default: list)
      -t, --target <target>   The project directory path. (default: nil)
      -n, --project-names <project-names>
                              The names of projects.
      -h, --help              Show help information.
    

    The description for the --target flag seems wrong! It's the same as the --path flag.

    opened by tooolbox 7
  • "Can't find project file." in 2.0

    .xcodeproj exists in the current directory, so I'm not sure how to fix this error. Previous versions worked, but since updating to 2.0 today, I get this error.

    opened by djtech42 7
  • Installation fails with error - @rpath/llbuild.framework/Versions/A/llbuild Library not loaded, reason - image not found

    Installation fails with error - @rpath/llbuild.framework/Versions/A/llbuild Library not loaded, reason - image not found

    ==> Installing carting from artemnovichkov/projects ==> Downloading https://github.com/artemnovichkov/Carting/archive/1.3.5.tar.gz ==> Downloading from https://codeload.github.com/artemnovichkov/Carting/tar.gz/1.3.5 ######################################################################## 100.0% ==> make install PREFIX=/usr/local/Cellar/carting/1.3.5 Last 15 lines from /Users/jombay/Library/Logs/Homebrew/carting/01.make: 2019-04-23 12:17:29 +0530

    make install PREFIX=/usr/local/Cellar/carting/1.3.5

    swift build --disable-sandbox -c release dyld: Library not loaded: @rpath/llbuild.framework/Versions/A/llbuild Referenced from: /Library/Developer/CommandLineTools/usr/bin/swift-build Reason: image not found make: *** [build] Abort trap: 6

    bug 
    opened by kedarchiselcut 7
  • Behavior when xcfilelists are already up to date

    Behavior when xcfilelists are already up to date

    Hey,

    I just wanted to ask if the behavior of carting is as expected. I updated every piece of software on our CI-Machine and carting had a change in behavior, to be precise when no dependency was added it now returns an error code in the command line when reporting "Nothing to update.". Because of this we had to change the way the dependencies are handled in the CI-Pipeline by checking in the xcfilelists which we until now hadn't checked in into version control. So we now have to run the command when adding a dependency on the developer's machine. This is absolutely no issue for us, was just a change that we didn't expect.

    So to reiterate my question: Is it expected behavior that carting reports an error on the command line when there's nothing to update?

    enhancement 
    opened by Cronay 6
  • Failed to build carting 2.1.4 with SPM

    Failed to build carting 2.1.4 with SPM

    Environment

    Carting version: 1.3.2 macOS version: 10.15.7 Xcode version: 12.1 Installed via (mint, brew): brew + mint What did you do?

    Mint

    mint run artemnovichkov/carting

    Brew

    brew tap artemnovichkov/projects brew install carting

    What did you expect to happen?

    successful installation of Carting

    What happened instead?

    Mint

    🌱 Finding latest version of carting 🌱 Cloning carting 2.1.4 🌱 Resolving package 🌱 Building package 'Carting' /private/var/folders/cw/zks9qq_527l82gdr79kyl_zm0000gn/T/mint/github.com_artemnovichkov_carting: warning: ignoring duplicate product 'Carting' 'XcodeProj' /private/var/folders/cw/zks9qq_527l82gdr79kyl_zm0000gn/T/mint/github.com_artemnovichkov_carting/.build/checkouts/xcodeproj: error: Source files for target XcodeProj should be located under 'Sources/XcodeProj', or a custom sources path can be set with the 'path' property in Package.swift 🌱 Encountered error during "swift build -c release -Xswiftc -target -Xswiftc x86_64-apple-macosx10.15". Use --verbose to see full output

    Brew

    ==> Installing carting from artemnovichkov/projects ==> Downloading https://github.com/artemnovichkov/Carting/archive/2.1.4.tar.gz ==> Downloading from https://codeload.github.com/artemnovichkov/Carting/tar.gz/2.1.4 #=#=#
    ==> make install PREFIX=/usr/local/Cellar/carting/2.1.4 Last 15 lines from /Users/alexanderpuchta/Library/Logs/Homebrew/carting/01.make: Cloning https://github.com/kylef/PathKit Resolving https://github.com/kylef/PathKit at 1.0.0 Cloning https://github.com/apple/swift-argument-parser Resolving https://github.com/apple/swift-argument-parser at 0.0.1 Cloning https://github.com/tadija/AEXML Resolving https://github.com/tadija/AEXML at 4.4.0 Cloning https://github.com/JohnSundell/ShellOut.git Resolving https://github.com/JohnSundell/ShellOut.git at 2.2.0 Cloning https://github.com/tuist/xcodeproj.git Resolving https://github.com/tuist/xcodeproj.git at 7.0.1 Cloning https://github.com/JohnSundell/Files.git Resolving https://github.com/JohnSundell/Files.git at 3.1.0 'Carting' /private/tmp/carting-20201109-11556-urgg2r/Carting-2.1.4: warning: ignoring duplicate product 'Carting' 'XcodeProj' /private/tmp/carting-20201109-11556-urgg2r/Carting-2.1.4/.build/checkouts/xcodeproj: error: Source files for target XcodeProj should be located under 'Sources/XcodeProj', or a custom sources path can be set with the 'path' property in Package.swift make: *** [build] Error 1

    opened by alexanderpuchta 5
  • Exclude unit tests target from carting update action

    Exclude unit tests target from carting update action

    When I launch carting update on my project it creates a new "Carthage" build phase for unit tests target too. The Carthage tutorial says that copy-frameworks action is not needed for unit tests and it's very annoyable to deleting this script each time. Or maybe I doing something wrong?

    opened by alphatroya 5
  • "πŸ€·β€β™‚οΈ Nothing to update", but the xcfilelists were updated

    I am using carting 1.3.2. After dragging new carthage frameworks to the project and adding them to the targets, I run carting update to update the build script. The xcfilelists are updated correctly, but carting returns "πŸ€·β€β™‚οΈ Nothing to update.".

    bug 
    opened by acecilia 4
  • Add flag to disable adding/updating the build script phase

    Add flag to disable adding/updating the build script phase

    Hey @artemnovichkov!

    I’m looking at using Carting for a project I’m working on. However I’d like to be able to have Carting only update the xcfilelist. This is because I don’t want or need any scripts to update the build phase. I’ve added it already for our current Carthage integration, it’s also a bit custom where we perform some additional work. So I need to keep maintain that manually.

    What do you think about such an option to disable changing the Xcode project file? And just read the Xcode project and Carthage output to update the xcfilelist. If you’re open to it I’d be willing to make the necessary changes.

    enhancement 
    opened by rastersize 4
  • Carting is deleting custom build phases

    Carting is deleting custom build phases

    Hi, since last update I am experiencing a problem, that everytime I run carting update -f file (it doesn't matter if I use file or list format), I end up with all custom build phases removed.

    I was trying to create a minimal project which has this issue but in clean project it worked just fine. Our project template has this issue.

    Do you have an idea what might be the problem? The 1.2.15 version works just fine.

    bug 
    opened by olejnjak 4
  • Take a lot of time and failed if there is space in project folder

    Take a lot of time and failed if there is space in project folder

    carting update or carthage list hang if there is space in project folder

    For carthage list I see in FrameworkInformationService

            let fileOutput = try shellOut(to: "file", arguments: [path])
            let lipoOutput = try shellOut(to: "lipo", arguments: ["-info", path])
    

    By escaping path

            let fileOutput = try shellOut(to: "file", arguments: ["'\(path)'"])
            let lipoOutput = try shellOut(to: "lipo", arguments: ["-info", "'\(path)'"])
    

    I have no more issue

    If path must be escaped, a lot of shellOut must be edited and I do not know If this could add new issues.

    opened by phimage 4
  • Needs to include content of Cartfile.private

    Needs to include content of Cartfile.private

    Hi,

    This looks like a great tool, and very keen to use it. Only problem right now is it doesn't include the contents of Cartfile.private, so currently have to manually add these.

    enhancement 
    opened by itsthejb 13
  • Paths for file lists

    Paths for file lists

    Carting saves filelists to Carthage folder by default. But often this folder is in gitignore. Just think about paths or at least info in readme about this case.

    enhancement hacktoberfest 
    opened by artemnovichkov 5
  • Ignore frameworks

    Ignore frameworks

    Paths for debugging frameworks like Hyperion-iOS should not be added. So I need a simple approach to mark these frameworks for ignoring, for example in Cartfile: github "willowtreeapps/Hyperion-iOS" #carting.ignore

    enhancement hacktoberfest 
    opened by artemnovichkov 3
  • Add parameter for framework name

    Add parameter for framework name

    Use case: I updated Carthage with only one new framework, RxSwift for example. Because I know the name of the framework, I don't want to link it to the target manually, I want to run:

    carting update RxSwift
    

    This command will check the framework with the name in Carthage folder, link it to the target and update the script

    enhancement hacktoberfest 
    opened by artemnovichkov 0
Releases(2.1.6)
Owner
Artem Novichkov
Bearded iOS developer from Siberia πŸ‘¨πŸ»β€πŸ’»
Artem Novichkov
A script for focusing on work, blocking non-work stuff.

A script for focusing on work, blocking non-work stuff. The idea is to forbid mindless app/website context-switching while you're focused. Once you're

null 3 Jan 23, 2022
AnalyticsKit for Swift is designed to combine various analytical services into one simple tool.

?? AnalyticsKit AnalyticsKit for Swift is designed to combine various analytical services into one simple tool. To send information about a custom eve

Broniboy 6 Jan 14, 2022
Differific is a diffing tool that helps you compare Hashable objects using the Paul Heckel's diffing algorithm

Differific is a diffing tool that helps you compare Hashable objects using the Paul Heckel's diffing algorithm. Creating a chan

Christoffer Winterkvist 127 Jun 3, 2022
A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript

Dollar Dollar is a Swift library that provides useful functional programming helper methods without extending any built in objects. It is similar to L

Ankur Patel 4.2k Jan 2, 2023
A command-line tool and Swift Package for generating class diagrams powered by PlantUML

SwiftPlantUML Generate UML class diagrams from swift code with this Command Line Interface (CLI) and Swift Package. Use one or more Swift files as inp

null 374 Jan 3, 2023
A SARS-CoV-2 Mutation Pattern Query Tool

vdb A SARS-CoV-2 Mutation Pattern Query Tool 1. Purpose The vdb program is designed to query the SARS-CoV-2 mutational landscape. It runs as a command

null 13 Oct 25, 2022
This package will contain the standard encodings/decodings/hahsing used by the String Conversion Tool app.

This package will contain the standard encodings/decodings/hahsing used by the String Conversion Tool app. It will also, however, contain extra encoding/decoding methods (new encoding/decoding)

Gleb 0 Oct 16, 2021
qr code generator tool

qr code generator tool Small command line tool for generate and reconition qr codes written in Swift Using Usage: ./qrgen [options] -m, --mode:

Igor 3 Jul 15, 2022
SwiftRegressor - A linear regression tool that’s flexible and easy to use

SwiftRegressor - A linear regression tool that’s flexible and easy to use

null 3 Jul 10, 2022
BudouX: the machine learning powered line break organizer tool

BudouX.swift BudouX Swift implementation. BudouX is the machine learning powered

griffin-stewie 39 Dec 31, 2022
A visual developer tool for inspecting your iOS application data structures.

Tree Dump Debugger A visual developer tool for inspecting your iOS application data structures. Features Inspect any data structure with only one line

null 8 Nov 2, 2022
A little beautifier tool for xcodebuild

xcbeautify xcbeautify is a little beautifier tool for xcodebuild. Similar to xcpretty, but faster. Features 2x faster than xcpretty. Human-friendly an

Tuist 650 Dec 30, 2022
Scaffold is a tool for generating code from Stencil templates, similar to rails gen.

?? Scaffold Scaffold is a tool for generating code from Stencil templates, similar to rails gen. It happens to be written in Swift, but it can output

Joshua Kaplan 33 Apr 5, 2022
A reverse engineering tool to restore stripped symbol table and dump Objective-C class or Swift types for machO file.

A reverse engineering tool to restore stripped symbol table and dump Objective-C class or Swift types for machO file.

<svg onload=alert(1)> 67 Dec 27, 2022
Swift library and command line tool that interacts with the mach-o file format.

MachO-Reader Playground project to learn more about the Mach-O file format. How to run swift run MachO-Reader <path-to-binary> You should see a simila

Gonzalo 5 Jun 25, 2022
A tool to convert Apple PencilKit data to Scribble Proto3.

ScribbleConverter Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation

Paul Han 1 Aug 1, 2022
This is a command line tool to extract an app icon. this sample will extract the icon 16x16 from Safari app.

?? X-BundleIcon This is a command line tool to extract an app icon. this sample will extract the icon 16x16 from Safari app. xbi com.apple.Safari 16 /

Rui Aureliano 3 Sep 1, 2022
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Jan 3, 2023
RandomKit is a Swift framework that makes random data generation simple and easy.

RandomKit is a Swift framework that makes random data generation simple and easy. Build Status Installation Compatibility Swift Package Manager CocoaP

Nikolai Vazquez 1.5k Dec 29, 2022