diff --git a/fastlane/lib/fastlane/actions/pod_push.rb b/fastlane/lib/fastlane/actions/pod_push.rb index 5be12adac63..1f516b8663c 100644 --- a/fastlane/lib/fastlane/actions/pod_push.rb +++ b/fastlane/lib/fastlane/actions/pod_push.rb @@ -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", diff --git a/fastlane/spec/actions_specs/pod_push_spec.rb b/fastlane/spec/actions_specs/pod_push_spec.rb index 387abb827e8..d1eef1c6c6f 100644 --- a/fastlane/spec/actions_specs/pod_push_spec.rb +++ b/fastlane/spec/actions_specs/pod_push_spec.rb @@ -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 diff --git a/fastlane/spec/fixtures/podspecs/test.notpodspec b/fastlane/spec/fixtures/podspecs/test.notpodspec new file mode 100644 index 00000000000..0570f9d738e --- /dev/null +++ b/fastlane/spec/fixtures/podspecs/test.notpodspec @@ -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 diff --git a/fastlane/spec/fixtures/podspecs/test.podspec b/fastlane/spec/fixtures/podspecs/test.podspec index 0570f9d738e..e7960bb1d2d 100644 --- a/fastlane/spec/fixtures/podspecs/test.podspec +++ b/fastlane/spec/fixtures/podspecs/test.podspec @@ -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 diff --git a/fastlane/spec/fixtures/podspecs/test.podspec.json b/fastlane/spec/fixtures/podspecs/test.podspec.json new file mode 100644 index 00000000000..5dab0e0933f --- /dev/null +++ b/fastlane/spec/fixtures/podspecs/test.podspec.json @@ -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 +}