Cocoapods project gen tool.

Overview

cocoapods-project-gen

License MIT 

A gem which can gen cocoapods project.

Installation

Add this line to your application's Gemfile:

gem 'cocoapods-project-gen'

And then execute:

# bundle install
$ bundle install

Or install it yourself as:

# gem install
$ gem install cocoapods-project-gen

Quickstart

To begin gen an cocoapods project by opening an podpsec dir, and to your command line with:

xcframework gen 

or

xcframework gen --output-dir=<xcframework output dir>
xcframework gen --output-dir=<xcframework output dir> **.podspec

To begin gen an cocoapods project start by create an ProjectGenerator:

podspecs = [**.podspec]
ProjectGen::Command.run(['gen', "--output-dir=#{File.expand_path('./Resources/output', __dir__)}", *podspecs])

or to build for xcframework use this way:

require 'cocoapods-project-gen'

product_type = :dynamic_framework
use_module = true
external_podspecs = []
swift_version = '4.2'
configuration = :release
output_dir = <output dir>
generator = ProjectGen::ProjectGenerator.new(include_podspecs.first, @sources, @platforms)
generator.local = false
generator.no_clean       = false
generator.allow_warnings = true
generator.only_subspec   = %w[AFNetworking/UIKit AFNetworking/Reachability]
generator.use_frameworks = product_type == :dynamic_framework
generator.use_static_frameworks = product_type == :framework
generator.use_modular_headers = use_module
generator.external_podspecs = external_podspecs.drop(1)
generator.swift_version = swift_version
generator.configuration = configuration
# xcframework gen
xc_gen = ProjectGen::XcframeworkGen.new(generator)
xc_gen.generate_xcframework(output_dir, build_library_for_distribution: true)

local or no local:

require 'cocoapods-project-gen'
podspecs = Pathname.glob(File.expand_path('./Resources/Specs', __dir__) + '/*.podspec{.json,}')
local_podspecs = Pathname.glob(File.expand_path('./Resources/Specs/local/**', __dir__) + '/*.podspec{.json,}').join(',')
no_local_podspecs = Pathname.glob(File.expand_path('./Resources/Specs/no_local/', __dir__) + '**/*.podspec{.json,}').join(',')
out_put = File.expand_path('./Resources/output', __dir__)
vs = ProjectGen::Command.run(['gen', '--use-libraries', '--build-library-for-distribution', '--sources=https://github.com/CocoaPods/Specs.git', *podspecs, "--include-podspecs=#{local_podspecs}", "--external-podspecs=#{no_local_podspecs}", "--output-dir=#{out_put}"])

other options:

['--no-build', 'Is or is not to build xcframework'],
['--build-library-for-distribution', ' Enables BUILD_LIBRARY_FOR_DISTRIBUTION'],
['--use-latest', 'When multiple dependencies with different sources, use latest.'],
['--local', 'podpsecs is local or not'],
['--output-dir=/project/dir/', 'Gen output dir'],
['--allow-warnings', 'Gen even if warnings are present'],
['--subspecs=NAME/NAME', 'Gen only the given subspecs'],
['--no-clean', 'Gen leaves the build directory intact for inspection'],
['--use-libraries', 'Gen uses static libraries to install the spec'],
['--use-modular-headers', 'Gen uses modular headers during installation'],
['--use-static-frameworks', 'Gen uses static frameworks during installation'],
["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \
"(defaults to #{Pod::TrunkSource::TRUNK_REPO_URL}). Multiple sources must be comma-delimited"],
['--platforms=ios,macos', 'Gen against specific platforms (defaults to all platforms supported by the ' \
'podspec). Multiple platforms must be comma-delimited'],
['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used to gen the spec. ' \
'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
['--include-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for gening via :path'],
['--external-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for gening '\
'via :podspec. If there are --include-podspecs, then these are removed from them'],
['--configuration=CONFIGURATION', 'Build using the given configuration (defaults to Release)']

Command Line Tool

Installing the cocoapods-project-gen gem will also install one command-line tool xcframework gen which you can use to generate xcframework from podspec.

For more information consult

  • xcframework --help
  • xcframework gen --help

Contributing

Bug reports and pull requests are welcome on GitHub at cocoapods-project-gen. This project is intended to be a safe, welcoming space for collaboration.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the yaml-vfs project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

You might also like...
ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions
ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions

ExpoMod is a small application tool that lets you quickly setting up your computer for presentations / exhibitions. Or simply having useful shortcut to not being distract and keep awake your computer.

A tool to read the binarycookie format of Cookies on iOS applications

BinaryCookieReader Cloned from http://securitylearn.net/wp-content/uploads/tools/iOS/BinaryCookieReader.py ##Usage Python BinaryCookieReader.py [Cooki

Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

This project is a minimalistic Pomodoro timer for OS X written in Swift
This project is a minimalistic Pomodoro timer for OS X written in Swift

Minimalistic Pomodoro for OSX This project is a minimalistic Pomodoro timer for OS X written in Swift started by @bengsfort, and substantially enhance

XCode Preview template for UIkit based project.
XCode Preview template for UIkit based project.

SwiftPreview XCode Preview template for UIkit based project. Support custom file template class inherit from UIView and UIViewController. How to use?

A simple project which shows how to pull off custom view controller transitions.

Custom View Controller Transitions This project explains and shows how to make custom view controller transitions in the most simple way possible. Eac

A simple project that shows a list of local coffee shop reviews

Project This is a simple project that shows a list of local coffee shop reviews Details Please use git and commit often with meaningful commit message

swumap swift storyboard project

swumap swift storyboard project

Comments
  • undefined method `relative_path_from' for nil:NilClass

    undefined method `relative_path_from' for nil:NilClass

    Hello teacher, when i use Ruby3.0.0, execute “xcframework gen”. Error: .rvm/gems/ruby-3.0.0/gems/cocoapods-project-gen-0.2.3/lib/cocoapods-project-gen/gen/product.rb:155:in block in add_file_accessors_paths_to_products_group': undefined methodrelative_path_from' for nil:NilClass (NoMethodError)

    How to use cocoapods-project-gen in Ruby3.0.0?

    bug 
    opened by sunXiChun 1
Owner
Cat1237
Cat1237
A Swift command line tool for generating your Xcode project

XcodeGen XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec. The projec

Yonas Kolb 5.9k Jan 9, 2023
A starter project for Sample Project in Objective C.

A starter project for Sample Project in Objective C.

Zeeshan Haider 31 Jul 31, 2021
Command line tool for exporting resources and generating code from your Figma files

Fugen Fugen is a command line tool for exporting resources and generating code from your Figma files. Currently, Fugen supports the following entities

Almaz Ibragimov 69 Dec 17, 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

Thi Doãn 649 Dec 23, 2022
Swift sample app for running privileged operations on macOS using a helper tool

SwiftAuthorizationSample demonstrates how to run privileged operations on macOS using a helper tool managed by launchd. This sample was created with t

null 31 Dec 20, 2022
Open-source jailbreaking tool for many iOS devices

Open-source jailbreaking tool for many iOS devices *Read disclaimer before using this software. checkm8 permanent unpatchable bootrom exploit for hund

null 0 Nov 6, 2021
A GUI based virtualisation tool for running Linux on macOS Big Sur (x86 or arm64)

Project Mendacius GUI based virtualization tool to run Linux, based on the Virtualization framework introduced by Apple for macOS Big Sur with support

Praneet 113 Nov 18, 2022
A command line tool for managing Swift Playground projects on your Mac.

swift-playground-tools A command line tool for managing Swift Playground projects on your Mac. Generate Xcode Project $ playground-tools generate-xcod

Liam Nichols 0 Dec 31, 2021
FocusSpace - A time-management tool to help you stay focus with your friends

FocusSpace ?? ElleHacks2022 - (Telus) First Place ?? Developers Manyi Cheng(@man

Manyi Cheng 1 Feb 13, 2022
Apple SMC library & tool

SMCKit An Apple System Management Controller (SMC) library & command line tool in Swift for Intel based Macs. The library works by talking to the Appl

Omeed 415 Dec 10, 2022