fastlane-plugin-versioning 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a5cecca55ea703c542b4b7ea91c29336282f1f8
4
- data.tar.gz: e0a9378879826b80ece1f8aaa28cbce9def0a70c
3
+ metadata.gz: 46009325fba89cb0e2e6b846645290dbdf101fe7
4
+ data.tar.gz: 140dd41a49b5c52bafb21d25989a6c78d92aed6b
5
5
  SHA512:
6
- metadata.gz: bbbb1d600e50316a1ed1ba71b137171e91b7ea9df76aefc470621162dcc8c26847556a12c932c025251173f0d59dd4ce76af5e60981802ba676d8ff293649cb5
7
- data.tar.gz: e367f303d8ebc5634da0acd83153b30ba2c0035f1a8599b9a7654588e8bc1f7ea3b39fce1c5e9cf6015457436dd4d67ab058f70df6da22d794e15a003f6a64cd
6
+ metadata.gz: 389c535cce09bf618f002c7cbf3c3b1d7af9311c94cc02b7449d02a0ee63ccc00512efc80255372ec9db9302dd53ee7d96505d4306b065dcd0fb344376cb19bf
7
+ data.tar.gz: 25b4bff43dbadffa4b430d8d5bba2f65596ff4fb3894461bc4d73d8a85671db9bcf8728192959a2869653b552b7d8de748014739cead3f0f559ff179edac35e7
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # fastlane-plugin-versioning `fastlane` Plugin
2
2
 
3
+ [![CI Status](http://img.shields.io/travis/SiarheiFedartsou/fastlane-plugin-versioning.svg?style=flat)](https://travis-ci.org/SiarheiFedartsou/fastlane-plugin-versioning)
3
4
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning)
4
5
 
6
+
5
7
  ## Getting Started
6
8
 
7
9
  This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with fastlane-plugin-versioning, add it to your project by running:
@@ -12,12 +14,14 @@ fastlane add_plugin versioning
12
14
 
13
15
  ## About versioning
14
16
 
15
- Allows to work set/get app version directly to/from Info.plist
17
+ Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.
16
18
 
17
19
  ## Actions
18
20
 
19
21
  ### increment_version_number_in_plist
20
22
 
23
+ Increment/set version number in Info.plist of specific target. Doesn't use agvtool (unlike increment_version_number).
24
+
21
25
  ```ruby
22
26
  increment_version_number_in_plist # Automatically increment patch version number.
23
27
  increment_version_number_in_plist(
@@ -39,7 +43,10 @@ increment_version_number_in_plist(
39
43
  target: 'TestTarget' # (optional)
40
44
  )
41
45
  ```
42
- You can also only receive the version number from plist without modifying it
46
+
47
+ ### get_version_number_from_plist
48
+
49
+ Get version number from Info.plist of specific target. Doesn't use agvtool (unlike get_version_number).
43
50
 
44
51
  ```ruby
45
52
  version = get_version_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
@@ -47,6 +54,18 @@ version = get_version_number_from_plist(xcodeproj: "Project.xcodeproj", # option
47
54
  build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
48
55
  ```
49
56
 
57
+ ### get_app_store_version_number
58
+
59
+
60
+ ```ruby
61
+ version = get_app_store_version_number(xcodeproj: "Project.xcodeproj", # optional
62
+ target: 'TestTarget', # optional
63
+ build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
64
+ )
65
+ version = get_app_store_version_number(bundle_id: 'com.apple.Numbers')
66
+
67
+ ```
68
+
50
69
  ### get_info_plist_path
51
70
 
52
71
  Get a path to target's Info.plist
@@ -54,9 +73,13 @@ Get a path to target's Info.plist
54
73
  get_info_plist_path(xcodeproj: 'Test.xcodeproj', # optional
55
74
  target: 'TestTarget', # optional
56
75
  build_configuration_name: 'Release' # optional, must be specified if you have different Info.plist build settings for different build configurations
76
+
77
+
57
78
  )
58
79
  ```
59
80
 
81
+
82
+
60
83
  ## Issues and Feedback
61
84
 
62
85
  For any other issues and feedback about this plugin, please submit it to this repository.
@@ -0,0 +1,78 @@
1
+ module Fastlane
2
+ module Actions
3
+ class GetAppStoreVersionNumberAction < Action
4
+
5
+ require 'json'
6
+
7
+ def self.run(params)
8
+ if params[:bundle_id]
9
+ bundle_id = params[:bundle_id]
10
+ else
11
+ if Helper.test?
12
+ plist = "/tmp/fastlane/tests/fastlane/Info.plist"
13
+ else
14
+ plist = GetInfoPlistPathAction.run(params)
15
+ end
16
+ bundle_id = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleIdentifier')
17
+ end
18
+
19
+ uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}")
20
+ Net::HTTP.get(uri)
21
+
22
+ response = Net::HTTP.get_response(uri)
23
+ UI.crash!("Unexpected status code from iTunes Search API") unless response.is_a?(Net::HTTPSuccess)
24
+ response_body = JSON.parse(response.body)
25
+
26
+ UI.user_error!("Cannot find app with #{bundle_id} bundle ID in the App Store") if response_body["resultCount"] == 0
27
+
28
+ response_body["results"][0]["version"]
29
+ end
30
+
31
+ #####################################################
32
+ # @!group Documentation
33
+ #####################################################
34
+
35
+ def self.description
36
+ "Get the version number of your app in the App Store"
37
+ end
38
+
39
+ def self.available_options
40
+ [
41
+ FastlaneCore::ConfigItem.new(key: :bundle_id,
42
+ env_name: "FL_APPSTORE_VERSION_NUMBER_BUNDLE_ID",
43
+ description: "Bundle ID of the application",
44
+ optional: true,
45
+ conflicting_options: [:xcodeproj, :target, :build_configuration_name],
46
+ is_string: true),
47
+
48
+ FastlaneCore::ConfigItem.new(key: :xcodeproj,
49
+ env_name: "FL_VERSION_NUMBER_PROJECT",
50
+ description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
51
+ optional: true,
52
+ conflicting_options: [:bundle_id],
53
+ verify_block: proc do |value|
54
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
55
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
56
+ end),
57
+ FastlaneCore::ConfigItem.new(key: :target,
58
+ env_name: "FL_VERSION_NUMBER_TARGET",
59
+ optional: true,
60
+ conflicting_options: [:bundle_id],
61
+ description: "Specify a specific target if you have multiple per project, optional"),
62
+ FastlaneCore::ConfigItem.new(key: :build_configuration_name,
63
+ optional: true,
64
+ conflicting_options: [:bundle_id],
65
+ description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
66
+ ]
67
+ end
68
+
69
+ def self.authors
70
+ ["SiarheiFedartsou"]
71
+ end
72
+
73
+ def self.is_supported?(platform)
74
+ [:ios, :mac].include? platform
75
+ end
76
+ end
77
+ end
78
+ end
@@ -3,13 +3,13 @@ module Fastlane
3
3
  class GetVersionNumberFromPlistAction < Action
4
4
  def self.run(params)
5
5
  if Helper.test?
6
- plist = "./fastlane-plugin-versioning/spec/fixtures/plist/Info.plist"
6
+ plist = "/tmp/fastlane/tests/fastlane/Info.plist"
7
7
  else
8
8
  plist = GetInfoPlistPathAction.run(xcodeproj: params[:xcodeproj],
9
9
  target: params[:target],
10
10
  build_configuration_name: params[:build_configuration_name])
11
11
  end
12
-
12
+
13
13
  version_number = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleShortVersionString')
14
14
  # Store the number in the shared hash
15
15
  Actions.lane_context[SharedValues::VERSION_NUMBER] = version_number
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Versioning
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Fiedartsou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-03 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fastlane
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.93.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.93.1
69
69
  description:
@@ -72,14 +72,14 @@ executables: []
72
72
  extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
+ - LICENSE
76
+ - README.md
77
+ - lib/fastlane/plugin/versioning.rb
78
+ - lib/fastlane/plugin/versioning/actions/get_app_store_version_number.rb
75
79
  - lib/fastlane/plugin/versioning/actions/get_info_plist_path.rb
76
80
  - lib/fastlane/plugin/versioning/actions/get_version_number_from_plist.rb
77
81
  - lib/fastlane/plugin/versioning/actions/increment_version_number_in_plist.rb
78
- - lib/fastlane/plugin/versioning/helper/versioning_helper.rb
79
82
  - lib/fastlane/plugin/versioning/version.rb
80
- - lib/fastlane/plugin/versioning.rb
81
- - README.md
82
- - LICENSE
83
83
  homepage: https://github.com/SiarheiFedartsou/fastlane-plugin-versioning
84
84
  licenses:
85
85
  - MIT
@@ -90,17 +90,17 @@ require_paths:
90
90
  - lib
91
91
  required_ruby_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - '>='
98
+ - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.1.11
103
+ rubygems_version: 2.6.4
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Allows to work set/get app version directly to/from Info.plist
@@ -1,12 +0,0 @@
1
- module Fastlane
2
- module Helper
3
- class VersioningHelper
4
- # class methods that you define here become available in your action
5
- # as `Helper::VersioningHelper.your_method`
6
- #
7
- def self.show_message
8
- UI.message("Hello from the versioning plugin helper!")
9
- end
10
- end
11
- end
12
- end