Giter VIP home page Giter VIP logo

punic's Introduction

Punic

elephant

Punic is a remote caching CLI built for Carthage that exclusively supports Apple's .xcframeworks.

Features

  • ✅ Easy remote caching via AWS S3
  • ✅ Easy CI/CD integration
  • ✅ Support for versioned dependencies

Please give us a ⭐️ if you find this CLI useful!

Example Usage

elephant

Installation

brew tap summerlabs/homebrew-punic
brew install punic

AWS Credentials

Make sure you have your AWS config and credentials setup.

They are keys that Punic uses to upload your frameworks into AWS and will be automatically setup for you when you run aws configure.

Here is an example after you run the setup successfully.

~/.aws/config

[default]
region = us-west-1
output = json

~/.aws/credentials

[default]
aws_access_key_id = {SOME_ACCESS_KEY_ID}
aws_secret_access_key = {SOME_SECRET_KEY}

Documentation

Punfile

Punic looks for a Punfile in your top-level project to determine which dependencies to download as well as configuring the path of your local cache.

Example Punfile

# Configure Punic
configuration:
  # save dependencies into this AWS bucket directory
  #
  # ie. //some-remote-bucket/1.0.1/Alamofire/Alamofire.xcframework
  #
  # defaults to `output`
  #
  prefix: 1.0.1
  # local cache location
  local: ~/Library/Caches/Punic
  # output cache location
  output: Carthage/Build
  # aws bucket location
  s3Bucket: some-remote-bucket
  
# Search your output directory for these .xcframeworks
dependencies:
# single framework definition
- AlamoFire:
  - name: AlamoFire
  # support for explicit versioning
    version: 0.1.9
# multiple frameworks definition sometimes created by one library
- CocoaLumberjack:  
  # having no version defaults to a versionless dependency cache
  - name: CocoaLumberjack
  - name: CocoaLumberjackSwift
  - name: CocoaAsyncSocket
    version: {COCOA_VERSION}

we also support basic templating with environment variables the best way to do this is create a .env file and source it before running punfile

Commands

After building your .xcframeworks using

carthage update --use-xcframeworks

They will be located in the top level Carthage/Build directory.

Download .xcframeworks

punic download

Upload .xcframeworks

punic upload

Miscellaneous

# The `output cache` is the Carthage/Build folder

# ignore the local cache and zip directly from the output cache 
punic upload --ignore-local

# ignore the local cache and download anyway then copy
punic download --ignore-local

# ignore the output cache and copy anyway
punic download --ignore-output

# use an override cache prefix
punic {command} --cache-prefix {some_other_path_key}

# target specific dependencies
punic {command} --dependencies Alamofre,CocoaLumberjack

Carthage-less Support

Punic is capable of copying the downloaded/cached frameworks into a separate folder, you don't have to necessarily use Carthage/Build if you want to copy the files into a separate directory for your own reasons.

Feel free to change the output key in the Punfile to achieve this.

Developer Support

Punic is a new framework that was made to help our team achieve remote caching with Apple's latest .xcframework change. If you find any issues using the CLI, don't hesitate to open one up to help us bug splash.

For all you Rust developers, feel free to contribute to this framework and help us grow the CLI.

punic's People

Contributors

drewkiino avatar jcheungshred 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

Watchers

 avatar  avatar  avatar  avatar

punic's Issues

AWS Region is hardcoded to USWest1

Issue
The current implementation of s3.rs is hardcoded to the region uswest1. This is an issue for myself as our s3 bucket is configured to use a different region.

Proposed Fix
We will retrieve the region as set inside the aws configuration file and retrieve the correct region to be set.

upload version files?

Hi, currently only xcframework is being uploaded/downloaded without their respective .version files. Suppose I'am working on my local machine with dependency version 1 which I downloaded from AWS at some point in the past, then I merged master/develop which which has dependency of version 2 to my local, I can't easily verify that my current dependency in carthage/build has correct version. Previously with rome, we would match the version in version files with cartfile.resolved.

Installation requires Xcode 12.5

First, thanks for the great tool. I've been using Rome for a while but as it's still not supporting XCFrameworks it's great to see some other tools are arising.
I've noticed that to install the tool it requires Xcode 12.5 command line tools. Is it possible to support a lower version too? XCFrameworks are around for a while so might not every team is able to support the latest yet. (We specifically in Xcode 12.3)

Versioning does not work if not in the x.y.z format

Given the following content in the Punfile

- FooBar:
  - name: FooBar
    version: 1.2

you get an error:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/punfile.rs:85:109
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

That only works if your dependency has the x.y.z version formatting

- FooBar:
  - name: FooBar
    version: 1.2.0

I think version should be a free-form string.

Also that does not make sense to have to specify the version number in the Punfile, it should be automatically done somehow. I know there's no strong adherence with Carthage, so it should do it with some kind of hashing of the .xcframework.

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.