Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --local option to use local sources while packaging #195

Closed
wants to merge 4 commits into from

Conversation

@manuyavuz
Copy link
Member

commented Mar 4, 2018

This adds support for packaging using local state of the source files, rather than using the latest version existing on given spec sources.

Proposed behavior is the following:

  • pod package AFNetworking : Packages AFNetworking by downloading the source code from GitHub according to latest spec definitions existing in CocoaPods master source repo. This option will add the pod to generated Podfile as pod AFNetworking.
  • pod package /path/to/AFNetworking.podspec : Packages AFNetworking by downloading the sources following the spec definitions inside /path/to/AFNetworking.podspec spec file. This option will add the pod to generated Podfile as pod AFNetworking, :podspec => '/path/to/AFNetworking.podspec'.
  • pod package --local /path/to/AFNetworking.podspec : Packages AFNetworking using existing local sources, which will be found following the spec definitions inside /path/to/AFNetworking.podspec spec file. This option will add the pod to generated Podfile as pod AFNetworking, :path => '/path/to/AFNetworking.podspec', meaning it will be regarded as a development pod.

I opened the PR based upon manu-feature-vendored-libraries branch because that branch contains general fixes to currently failing specs on master branch.

@manuyavuz manuyavuz requested a review from segiddins Mar 4, 2018

@manuyavuz manuyavuz changed the title Manu imp local Add --local option to use local sources while packaging Mar 4, 2018

@coveralls

This comment has been minimized.

Copy link

commented Mar 4, 2018

Coverage Status

Coverage increased (+0.5%) to 93.258% when pulling 23dbec5 on manu-imp-local into f3fb03f on manu-feature-vendored-libraries.

@manuyavuz manuyavuz force-pushed the manu-imp-local branch from dd3c9d1 to fd43249 Mar 5, 2018

@manuyavuz

This comment has been minimized.

Copy link
Member Author

commented Mar 6, 2018

Closing because changes here has been merged into #194.

@radvansky-tomas

This comment has been minimized.

Copy link

commented Mar 21, 2019

So how to package local source, I am always receiving error Could not find remote branch 0.1.0 to clone. as I dont have source online...I want to package locally developer podspec

@manuyavuz

This comment has been minimized.

Copy link
Member Author

commented Mar 23, 2019

Hi,

As I explained in proposal, you just need to call similar to pod package --local /path/to/AFNetworking.podspec, changing podspec path to your local file path.

If you do pod package help, you would see the usage:

$ pod package help
[!] A podspec name or path is required.

Usage:

    $ pod package NAME [SOURCE]

      Package a podspec into a static library.

Options:

    --force                                                         Overwrite existing
                                                                    files.
    --no-mangle                                                     Do not mangle
                                                                    symbols of
                                                                    depedendant Pods.
    --embedded                                                      Generate embedded
                                                                    frameworks.
    --library                                                       Generate static
                                                                    libraries.
    --dynamic                                                       Generate dynamic
                                                                    framework.
    --local                                                         Use local state
                                                                    rather than
                                                                    published
                                                                    versions.
    --bundle-identifier                                             Bundle identifier
                                                                    for dynamic
                                                                    framework
    --exclude-deps                                                  Exclude symbols
                                                                    from dependencies.
    --configuration                                                 Build the
                                                                    specified
                                                                    configuration
                                                                    (e.g. Debug).
                                                                    Defaults to
                                                                    Release
    --subspecs                                                      Only include the
                                                                    given subspecs
    --spec-sources=private,https://github.com/CocoaPods/Specs.git   The sources to
                                                                    pull dependent
                                                                    pods from
                                                                    (defaults to
                                                                    https://github.com/CocoaPods/Specs.git)
@radvansky-tomas

This comment has been minimized.

Copy link

commented Mar 25, 2019

Yep but version I installed does not have local option at all. Could you explain how I can install your changes ?

@manuyavuz

This comment has been minimized.

Copy link
Member Author

commented Mar 31, 2019

You can install version in master branch using bundler and a Gemfile like this:

source 'https://rubygems.org'
gem 'cocoapods-packager', github: "CocoaPods/cocoapods-packager", branch: 'master'

More information here: https://bundler.io/v1.12/git.html

@radvansky-tomas

This comment has been minimized.

Copy link

commented Apr 1, 2019

Did exactly there but my pod -help shows

Tomass-iMac:NavRushFramework tomasradvansky$ pod package --local /Users/tomasradvansky/NavRush/navrushframework-ios-pod/NavRushFramework/NavRushFramework.podspec 
[!] Unknown option: `--local`
Did you mean: --force?

Usage:

    $ pod package NAME [SOURCE]

      Package a podspec into a static library.

Options:

    --force                                                         Overwrite existing
                                                                    files.
    --no-mangle                                                     Do not mangle
                                                                    symbols of
                                                                    depedendant Pods.
    --embedded                                                      Generate embedded
                                                                    frameworks.
    --library                                                       Generate static
                                                                    libraries.
    --dynamic                                                       Generate dynamic
                                                                    framework.
    --bundle-identifier                                             Bundle identifier
                                                                    for dynamic
                                                                    framework
    --exclude-deps                                                  Exclude symbols
                                                                    from dependencies.
    --configuration                                                 Build the
                                                                    specified
                                                                    configuration
                                                                    (e.g. Debug).
                                                                    Defaults to
                                                                    Release
    --subspecs                                                      Only include the
                                                                    given subspecs
    --spec-sources=private,https://github.com/CocoaPods/Specs.git   The sources to
                                                                    pull dependant
                                                                    pods from
                                                                    (defaults to
                                                                    https://github.com/CocoaPods/Specs.git)
@radvansky-tomas

This comment has been minimized.

Copy link

commented Apr 1, 2019

I tried to uninstall gem, and then install it only using bundle install (master branch)... but now there is no plugin installed at all!

@radvansky-tomas

This comment has been minimized.

Copy link

commented Apr 1, 2019

Ok found it, I had to run it with bundle exec pod package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.