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

Cocoapods now recommends json file formats, so fastlane should support it #5869

Merged
merged 1 commit into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastlane/lib/fastlane/actions/pod_push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def self.available_options
optional: true,
verify_block: proc do |value|
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
UI.user_error!("File must be a `.podspec`") unless value.end_with?(".podspec")
UI.user_error!("File must be a `.podspec` or `.podspec.json`") unless value.end_with?(".podspec", ".podspec.json")
end),
FastlaneCore::ConfigItem.new(key: :repo,
description: "The repo you want to push. Pushes to Trunk by default",
Expand Down
18 changes: 18 additions & 0 deletions fastlane/spec/actions_specs/pod_push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@

expect(result).to eq("pod repo push MyRepo './fastlane/spec/fixtures/podspecs/test.podspec' --allow-warnings --use-libraries")
end

it "generates the correct pod push command with a json file" do
result = Fastlane::FastFile.new.parse("lane :test do
pod_push(path: './fastlane/spec/fixtures/podspecs/test.podspec.json', repo: 'MyRepo')
end").runner.execute(:test)

expect(result).to eq("pod repo push MyRepo './fastlane/spec/fixtures/podspecs/test.podspec.json'")
end

it "errors if the path file does not end with .podspec or .podspec.json" do
ff = Fastlane::FastFile.new.parse("lane :test do
pod_push(path: './fastlane/spec/fixtures/podspecs/test.notpodspec')
end")

expect do
ff.runner.execute(:test)
end.to raise_error("File must be a `.podspec` or `.podspec.json`")
end
end
end
end
24 changes: 24 additions & 0 deletions fastlane/spec/fixtures/podspecs/test.notpodspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Pod::Spec.new do |s|
s.name = "SpecName"
s.header_dir = "SuchHeader"
s.Version = "1.5.1"
s.summary = "With just a few lines of code, your app can add fastlane support."

s.description = <<-DESC
Much bla
DESC

s.homepage = "https://github.com/fastlane/fastlane"
s.license = { type: 'MIT', file: 'LICENSE.txt' }
s.authors = ["Felix Krause"]
s.social_media_url = "https://twitter.com/FastlaneTools"

s.source = { git: "https://github.com/fastlane/fastlane.git", tag: s.version }
s.platform = :ios, 7.0
s.source_files = "*.{h,m}"
s.frameworks = "UIKit"
s.weak_framework = "WebKit"
s.exclude_files = "Demos"
s.resource_bundles = { 'SomeResources' => ['yeah.xcassets/*.imageset/*.png', 'yeah.xcassets'] }
s.requires_arc = true
end
2 changes: 1 addition & 1 deletion fastlane/spec/fixtures/podspecs/test.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "SpecName"
s.header_dir = "SuchHeader"
s.Version = "1.5.1"
s.version = "1.5.1"
s.summary = "With just a few lines of code, your app can add fastlane support."

s.description = <<-DESC
Expand Down
34 changes: 34 additions & 0 deletions fastlane/spec/fixtures/podspecs/test.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "SpecName",
"header_dir": "SuchHeader",
"version": "1.5.1",
"summary": "With just a few lines of code, your app can add fastlane support.",
"description": "Much bla",
"homepage": "https://github.com/fastlane/fastlane",
"license": {
"type": "MIT",
"file": "LICENSE.txt"
},
"authors": [
"Felix Krause"
],
"social_media_url": "https://twitter.com/FastlaneTools",
"source": {
"git": "https://github.com/fastlane/fastlane.git",
"tag": "1.5.1"
},
"platforms": {
"ios": "7.0"
},
"source_files": "*.{h,m}",
"frameworks": "UIKit",
"weak_frameworks": "WebKit",
"exclude_files": "Demos",
"resource_bundles": {
"SomeResources": [
"yeah.xcassets/*.imageset/*.png",
"yeah.xcassets"
]
},
"requires_arc": true
}