GithubHelp home page GithubHelp logo

rome's Introduction

cocoapods-rome

Rome makes it easy to build a list of frameworks for consumption outside of Xcode, e.g. for a Swift script.

Installation

$ gem install cocoapods-rome

Important

In the examples below the target 'caesar' could either be an existing target of a project managed by cocapods for which you'd like to run a swift script or it could be fictitious, for example if you wish to run this on a standalone Podfile and get the frameworks you need for adding to your xcode project manually.

Usage

Write a simple Podfile, like this:

MacOS

platform :osx, '10.10'

plugin 'cocoapods-rome'

target 'caesar' do
  pod 'Alamofire'
end

iOS

platform :ios, '8.0'

plugin 'cocoapods-rome', { :pre_compile => Proc.new { |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.0'
        end
    end

    installer.pods_project.save
},

    dsym: false,
    configuration: 'Release'
}

target 'caesar' do
  pod 'Alamofire'
end

then run this:

pod install

and you will end up with dynamic frameworks:

$ tree Rome/
Rome/
└── Alamofire.framework

Advanced Usage

For your production builds, when you want dSYMs created and stored:

platform :osx, '10.10'

plugin 'cocoapods-rome', {
  dsym: true,
  configuration: 'Release'
}

target 'caesar' do
  pod 'Alamofire'
end

Resulting in:

$ tree dSYM/
dSYM/
├── iphoneos
│   └── Alamofire.framework.dSYM
│       └── Contents
│           ├── Info.plist
│           └── Resources
│               └── DWARF
│                   └── Alamofire
└── iphonesimulator
    └── Alamofire.framework.dSYM
        └── Contents
            ├── Info.plist
            └── Resources
                └── DWARF
                    └── Alamofire

Hooks

The plugin allows you to provides hooks that will be called during the installation process.

pre_compile

This hook allows you to make any last changes to the generated Xcode project before the compilation of frameworks begins.

It receives the Pod::Installer as its only argument.

post_compile

This hook allows you to run code after the compilation of the frameworks finished and they have been moved to the Rome folder.

It receives the Pod::Installer as its only argument.

Example

Customising the Swift version of all pods

platform :osx, '10.10'

plugin 'cocoapods-rome', 
    :pre_compile => Proc.new { |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end

        installer.pods_project.save
    },
    :post_compile => Proc.new { |installer|
        puts "Rome finished building all the frameworks"
    }

target 'caesar' do
    pod 'Alamofire'
end

rome's People

Contributors

bradphilips avatar dnkoutso avatar dulacp avatar endocrimes avatar hwaxxer avatar jugutier avatar keith avatar koenpunt avatar manuyavuz avatar mau888 avatar mjholgate avatar neonichu avatar orta avatar segiddins avatar tomaslinhart avatar unsafepointer 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.