Skip to content

Adds support for passing in related podspecs for validation#8536

Merged
dnkoutso merged 7 commits intomasterfrom
ort-multi-podspec-linter-rn
Mar 26, 2019
Merged

Adds support for passing in related podspecs for validation#8536
dnkoutso merged 7 commits intomasterfrom
ort-multi-podspec-linter-rn

Conversation

@orta
Copy link
Copy Markdown
Member

@orta orta commented Feb 21, 2019

The React Native team are starting to do more work with CocoaPods facebook/react-native#23559 , and I'd like to get them using pod lib lint on CI. To do that though, they would need the ability to say "Lint this Podspec, but grab all these other ones from the local repo" - and they have some dependencies which we're currently grabbing from trunk.

This adds support in the validator to declare local (or remote) podspecs as a part of your linting setup across pod lib lint, pod spec lint and the validation aspect of pod repo push.

@orta orta force-pushed the ort-multi-podspec-linter-rn branch 3 times, most recently from d467155 to af65a75 Compare February 21, 2019 14:42
#-------------------------------------------------------------------------#

#  @!group Configuration
# @!group Configuration
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an unknown invisible char - I switched it to a space

@dnkoutso
Copy link
Copy Markdown
Contributor

Why would spec lint and repo push accept these parameters? Wouldn't we want to limit this to lib lint only (local?)

@dnkoutso dnkoutso added this to the 1.7.0 milestone Feb 21, 2019
@orta
Copy link
Copy Markdown
Member Author

orta commented Feb 21, 2019

You wouldn't be able to push to a non-trunk specs repo you owned without this. You can't ship x Podspecs at once, and there's no way to skip validation. So this allows pod repo push to work.

At that point not having it in lib lint just seemed like an odd edge case.

@paulb777
Copy link
Copy Markdown
Member

But shouldn't spec lint and repo push require dependencies to be pushed to a spec repo? Otherwise won't it be possible to create an inconsistent spec repo?

@dnkoutso
Copy link
Copy Markdown
Contributor

dnkoutso commented Feb 21, 2019

You wouldn't be able to push to a non-trunk specs repo you owned without this.

How is the information passed through these parameters reconciled with the dependency list declared in the podspec?

In other words, if I pass this parameter and I successfully publish a podspec but I don't have s.dependency declared will this published podspec be consumable and work?

It seems to me a way to handle this is to write out support for a LocalSource that can be added and maintained by the repo list or we explicitly enable this option for lib lint only.

@orta
Copy link
Copy Markdown
Member Author

orta commented Feb 21, 2019

Hrm, yeah, just had a 2nd thought about that - will remove it from repo push and spec lint

Comment thread CHANGELOG.md Outdated
[dacaiguoguogmail](https://github.com/dacaiguoguogmail)
[#8470](https://github.com/CocoaPods/CocoaPods/pull/8470)

* Adds support for referring to other podspecs during validation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs two trailing spaces instead of 1

Comment thread lib/cocoapods/validator.rb Outdated
local = local?
urls = source_urls

additional_podspec_pods = Dir.glob(external_podspecs || '')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be external_podspecs ? Dir.glob(external_podspecs) : []?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally did this, but it felt a bit weird re-defining the same variable to be a different type. I'm happy to change this if it's a blocker though 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh - forgot to push this, hah

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont care so much about the variable name, but I dont like having a call to Dir.glob('')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense - will fix

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 👍

Comment thread spec/unit/validator_spec.rb Outdated

podfile = @validator.send(:podfile_from_spec, :ios, '5.0')

puts podfile.target_definitions['App'].dependencies
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugging code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks - fixed

Comment thread spec/unit/validator_spec.rb Outdated

podfile = @validator.send(:podfile_from_spec, :ios, '5.0')

puts podfile.target_definitions['App'].dependencies
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugging code

@orta orta force-pushed the ort-multi-podspec-linter-rn branch from af65a75 to c42a26b Compare February 22, 2019 12:48
Comment thread CHANGELOG.md
[#8461](https://github.com/CocoaPods/CocoaPods/issues/8461)

* Set the path of development pod groups to root directory of the Pod
* Adds support for referring to other podspecs during validation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: needs to move to updated master section after 1.7.0.beta.1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 cool, yeah, done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orta is this an enhancement or bug fix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to enhancement

@orta orta force-pushed the ort-multi-podspec-linter-rn branch 2 times, most recently from 6317f87 to ad22d08 Compare February 27, 2019 23:40
Comment thread CHANGELOG.md
[#8461](https://github.com/CocoaPods/CocoaPods/issues/8461)

* Set the path of development pod groups to root directory of the Pod
* Set the path of development pod groups to root directory of the Pod
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change intended?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it fixes that line (should also be two spaces)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yea

Comment thread lib/cocoapods/validator.rb Outdated

additional_path_pods.each do |podspec_path|
podspec_name = File.basename(podspec_path, '.*')
pod podspec_name, :path => File.dirname(podspec_path), :inhibit_warnings => false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would we not inhibit warnings? Those are external pods not currently being validated. I would expect to remove :inhibit_warnings here and below.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@orta orta force-pushed the ort-multi-podspec-linter-rn branch from ad22d08 to 6f03a82 Compare March 7, 2019 19:05
coconut_dep = podfile.target_definitions['App'].dependencies[1]
coconut_dep.name.should == 'CoconutLib'
coconut_dep.local?.should.nil?
coconut_dep.external?.should.not.nil?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should.be.true?


coconut_dep = podfile.target_definitions['App'].dependencies[1]
coconut_dep.name.should == 'CoconutLib'
coconut_dep.local?.should.not.nil?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should.be.true?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, they're strings, this is fine 👍

@orta orta force-pushed the ort-multi-podspec-linter-rn branch 2 times, most recently from 4234a28 to 67d5997 Compare March 10, 2019 22:10
@orta orta force-pushed the ort-multi-podspec-linter-rn branch from 67d5997 to fa0379b Compare March 11, 2019 02:06
@dnkoutso dnkoutso merged commit 39b9f74 into master Mar 26, 2019
@dnkoutso dnkoutso deleted the ort-multi-podspec-linter-rn branch March 26, 2019 17:24
mfiebig added a commit to mfiebig/fastlane that referenced this pull request Apr 12, 2019
joshdholtz pushed a commit to fastlane/fastlane that referenced this pull request Apr 17, 2019
…ommand (#14579)

* Add new cocoapods 1.7 parameters of the lint command

Source [PR 8536](CocoaPods/CocoaPods#8536)

* Add cocoapods version hint
minuscorp pushed a commit to minuscorp/fastlane that referenced this pull request Jul 18, 2020
…ommand (fastlane#14579)

* Add new cocoapods 1.7 parameters of the lint command

Source [PR 8536](CocoaPods/CocoaPods#8536)

* Add cocoapods version hint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants