Coder Social home page Coder Social logo

cato's Introduction

cato

Build Status No Maintenance Intended

Cato makes it easy to run Swift scripts, by utilizing chswift to choose the right Swift version and Rome to install missing dependencies.

If you don't know what Swift scripts even are, check out Ayaka's talk.

Installation

$ gem install cocoapods cocoapods-rome
$ brew tap neonichu/formulae
$ brew install cato

Usage

Cato is supposed to be run via a script's hash-bang directive:

#!/usr/bin/env cato

import Chores

let result = >["xcodebuild", "-version"]
print(result.stdout)

Any frameworks that do not ship with the system will be installed into their own private directory under $HOME/.๐Ÿ“ฆ, named after the script's basename. Note that for performance reasons, the installation will only run the first time a script is executed.

Optionally, you can specify the version of Swift required to run the script:

#!/usr/bin/env cato 1.2

cato's People

Contributors

neonichu 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  avatar  avatar

cato's Issues

What about carthage support?

Cocoapods is great, but a lot of libraries don't have a podspec/don't work through it. It would be nice to either pick carthage globally, fallback to carthage if rome fails, or somethings like this:

import Alamofire // Carthage

Just an idea :P

Add support for CocoaPods 1.0

This currently breaks for various little reasons, but since Rome has been updated, nothing major keeps this for being fixed.

Offer an export option

$ cato --export foo

should create an application bundle with all the required frameworks that can be redistributed.

Example Doesn't Work

Example file as per README:

#!/usr/bin/env cato

import Chores

let result = >["xcodebuild", "-version"]
print(result.stdout)

After running it:

Analyzing dependencies
Downloading dependencies
Installing Chores (0.0.3)
Generating Pods project
Skipping User Project Integration
Building frameworks
[!] /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Pods.xcodeproj -scheme Pods-cato -configuration Release -sdk macosx

Build settings from command line:
    SDKROOT = macosx10.12

xcodebuild: error: 'Pods.xcodeproj' does not exist.

Any idea why?

Can't use

Hi neonichu
I installed all stuffs and it worked in the first time. After that, it always fail. Error like that:
no such module 'Chores'
import Chores
^

Have you any idea for that? Thanks

Brew can't find dependencies

Hi!
Sorry to disturb you but I was trying to install cato in order to make scriptiing easier and I found this error when running brew install cato

==> Installing cato from neonichu/formulae
cato: Unsatisfied dependency: cocoapods
Homebrew does not provide Ruby dependencies; install with:
  gem install cocoapods
cato: Unsatisfied dependency: cocoapods-rome
Homebrew does not provide Ruby dependencies; install with:
  gem install cocoapods-rome
Error: Unsatisfied requirements failed this build.

I think the issue is that brew tries to look for the gems in a different directory that where they are. I use RVM so for example cocoapods is in /Users/alex/.rvm/gems/ruby-2.2.1/bin/pod. Also the ruby version that is being used via the PATH is /Users/alex/.rvm/rubies/ruby-2.2.1/bin/ruby but I guess brew uses the system one?

I know that this is not related directly to cato but any help would be really appreciated ;)

error: module file's minimum deployment target is OS X v10.10

What am I doing wrong?

Swift script:

#!/usr/bin/env cato

import AEXML

First run:

$ cato Script.swift 
Analyzing dependencies
Downloading dependencies
Installing AEXML (3.0.0)
Generating Pods project
Skipping User Project Integration
Sending stats
Building frameworks
Built 1 frameworks
Copying 1 frameworks to `../../../../../.๐Ÿ“ฆ/Script/Rome`
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

Second run:

$ cato Script.swift 
./Script.swift:3:8: error: module file's minimum deployment target is OS X v10.10: /Users/marc/.๐Ÿ“ฆ/Script/Rome/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftmodule
import AEXML
       ^
  • cato 0.2.0
  • cocoapods (1.1.0.beta.1)
  • cocoapods-core (1.1.0.beta.1)
  • cocoapods-deintegrate (1.0.0)
  • cocoapods-downloader (1.1.0)
  • cocoapods-plugins (1.0.0)
  • cocoapods-rome (0.7.0)
  • cocoapods-search (1.0.0)
  • cocoapods-stats (1.0.0)
  • cocoapods-trunk (1.0.0)
  • cocoapods-try (1.1.0)
  • xcodeproj (1.2.0)
$ xcodebuild -version
Xcode 7.3.1
Build version 7D1014

$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

$ xcrun swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9

Podfile generated by cato:

platform :osx, '10.10'
plugin 'cocoapods-rome'
use_frameworks!

target 'cato' do
pod "AEXML"
end

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.