produce 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32cf30e2154b0e0035d8613a16f1ed0923d63d57
4
- data.tar.gz: ba39b0b0f3e9434feb7806e68acd4f697938d6bc
3
+ metadata.gz: 9dbc51cbf65a33e90f2eeb572f9d6e422d708413
4
+ data.tar.gz: ec2ad52b7269672e52dd0525eb9b55d983590e21
5
5
  SHA512:
6
- metadata.gz: 9937adbbdfc740fd009a6e1845862f27c364b8af80e3ad70f253b270cefc6d05df947220a4c7da7079dbb68b8a256b5b221509da9a6b7e627b0b7d5755ffeff4
7
- data.tar.gz: 0ffdf434f5fc7222e8dd9dd14f503f0b851687314e981bbe675aed654151120b1caa4b89d033a6722b0e534a318379e44bcdcc6f02a213aac0327bf888b5d1b8
6
+ metadata.gz: da7927a0ea715e923889b1dae1df6b44d527d9c15e0d95ca650bcb7e4a3fe76e02caf406543a70e61ad4a784461e278e400bca1266bcab69554fd1dbe03c19b6
7
+ data.tar.gz: 915ff04477f105dc3875e113781b1b4cf1c8a740f9141b0f9316e94efa04f8999227796b0af34c2bf0d1d8c937f35665f14230db5ae5a39afa5ccb3757b72abd
data/README.md CHANGED
@@ -80,6 +80,8 @@ In case you want to pass more information to `produce`:
80
80
  - `PRODUCE_LANGUAGE` (the language you want your app to use, e.g. `English`, `German`)
81
81
  - `PRODUCE_VERSION` (the initial app version)
82
82
  - `PRODUCE_SKU` (the SKU you want to use, which must be a unique number)
83
+ - `PRODUCE_SKIP_ITC` (should iTunes Connect app be created)
84
+ - `PRODUCE_SKIP_DEVCENTER` (should Apple Developer Portal app be created)
83
85
  - `FASTLANE_TEAM_ID` (the Team ID, e.g. `Q2CBPK58CA`)
84
86
  - `FASTLANE_TEAM_NAME` (the Team Name, e.g. `Felix Krause`)
85
87
 
data/bin/produce CHANGED
@@ -9,7 +9,7 @@ require 'credentials_manager/appfile_config'
9
9
 
10
10
  HighLine.track_eof = false
11
11
 
12
- class FastlaneApplication
12
+ class ProduceApplication
13
13
  include Commander::Methods
14
14
 
15
15
  def run
@@ -48,4 +48,9 @@ class FastlaneApplication
48
48
  end
49
49
  end
50
50
 
51
- FastlaneApplication.new.run
51
+ begin
52
+ FastlaneCore::UpdateChecker.start_looking_for_update('produce')
53
+ ProduceApplication.new.run
54
+ ensure
55
+ FastlaneCore::UpdateChecker.show_update_status('produce', Produce::VERSION)
56
+ end
data/lib/produce.rb CHANGED
@@ -14,6 +14,5 @@ module Produce
14
14
 
15
15
  ENV['FASTLANE_TEAM_ID'] ||= ENV["PRODUCE_TEAM_ID"]
16
16
 
17
- FastlaneCore::UpdateChecker.verify_latest_version('produce', Produce::VERSION)
18
17
  DependencyChecker.check_dependencies
19
18
  end
@@ -2,6 +2,7 @@ module Produce
2
2
  class Config
3
3
  ASK_MESSAGES = {
4
4
  bundle_identifier: "App Identifier (Bundle ID, e.g. com.krausefx.app): ",
5
+ bundle_identifier_suffix: "App Identifier Suffix (Ignored if App Identifier does not ends with .*): ",
5
6
  app_name: "App Name: ",
6
7
  version: "Initial version number (e.g. '1.0'): ",
7
8
  sku: "SKU Number (e.g. '1234'): ",
@@ -55,10 +56,12 @@ module Produce
55
56
  def env_options
56
57
  hash = {
57
58
  bundle_identifier: ENV['PRODUCE_APP_IDENTIFIER'],
59
+ bundle_identifier_suffix: ENV['PRODUCE_APP_IDENTIFIER_SUFFIX'],
58
60
  app_name: ENV['PRODUCE_APP_NAME'],
59
61
  version: ENV['PRODUCE_VERSION'],
60
62
  sku: ENV['PRODUCE_SKU'],
61
- skip_itc: skip_itc?(ENV['PRODUCE_SKIP_ITC']),
63
+ skip_itc: is_truthy?(ENV['PRODUCE_SKIP_ITC']),
64
+ skip_devcenter: is_truthy?(ENV['PRODUCE_SKIP_DEVCENTER']),
62
65
  team_id: ENV['PRODUCE_TEAM_ID'],
63
66
  team_name: ENV['PRODUCE_TEAM_NAME']
64
67
  }
@@ -81,8 +84,10 @@ module Produce
81
84
  AvailableDefaultLanguages.all_langauges.include? language
82
85
  end
83
86
 
84
- def skip_itc? value
87
+ # TODO: this could be moved inside fastlane_core
88
+ def is_truthy? value
85
89
  %w( true t 1 yes y ).include? value.to_s.downcase
86
90
  end
91
+
87
92
  end
88
93
  end
@@ -10,12 +10,15 @@ module Produce
10
10
 
11
11
  def run(config)
12
12
  @config = config
13
+ @full_bundle_identifier = config[:bundle_identifier].gsub('*', config[:bundle_identifier_suffix].to_s)
13
14
 
14
15
  if ENV["CREATED_NEW_APP_ID"].to_i > 0
15
16
  # We just created this App ID, this takes about 3 minutes to show up on iTunes Connect
16
17
  Helper.log.info "Waiting for 3 minutes to make sure, the App ID is synced to iTunes Connect".yellow
17
18
  sleep 180
18
- unless app_exists?
19
+
20
+ open_new_app_popup # for some reason, we have to refresh the page twice to get it working
21
+ unless bundle_exist?
19
22
  Helper.log.info "Couldn't find new app yet, we're waiting for another 2 minutes.".yellow
20
23
  sleep 120
21
24
  end
@@ -47,12 +50,13 @@ module Produce
47
50
 
48
51
  def fetch_apple_id
49
52
  # First try it using the Apple API
50
- data = JSON.parse(open("https://itunes.apple.com/lookup?bundleId=#{@config[:bundle_identifier]}").read)
53
+ data = JSON.parse(open("https://itunes.apple.com/lookup?bundleId=#{@full_bundle_identifier}").read)
51
54
 
52
55
  if data['resultCount'] == 0 or true
53
- visit current_url
56
+ visit APPS_URL
54
57
  sleep 10
55
- first("input[ng-model='searchModel']").set @config[:bundle_identifier]
58
+
59
+ first("input[ng-model='searchModel']").set @full_bundle_identifier
56
60
 
57
61
  if all("div[bo-bind='app.name']").count == 2
58
62
  raise "There were multiple results when looking for the new app. This might be due to having same app identifiers included in each other (see generated screenshots)".red
@@ -75,11 +79,16 @@ module Produce
75
79
  wait_for_elements("input[ng-model='createAppDetails.newApp.name.value']").first.set @config[:app_name]
76
80
  wait_for_elements("input[ng-model='createAppDetails.versionString.value']").first.set @config[:version]
77
81
  wait_for_elements("input[ng-model='createAppDetails.newApp.vendorId.value']").first.set @config[:sku]
78
-
79
- wait_for_elements("option[value='#{@config[:bundle_identifier]}']").first.select_option
82
+
80
83
  all(:xpath, "//option[text()='#{@config[:primary_language]}']").first.select_option
84
+ wait_for_elements("option[value='#{@config[:bundle_identifier]}']").first.select_option
85
+
86
+ if wildcard_bundle?
87
+ wait_for_elements("input[ng-model='createAppDetails.newApp.bundleIdSuffix.value']").first.set @config[:bundle_identifier_suffix]
88
+ end
81
89
 
82
90
  click_on "Create"
91
+
83
92
  sleep 5 # this usually takes some time
84
93
 
85
94
  if all("p[ng-repeat='error in errorText']").count == 1
@@ -92,21 +101,34 @@ module Produce
92
101
  end
93
102
 
94
103
  def initial_pricing
104
+ # It's not important here which is the price set. It will be updated by deliver
95
105
  sleep 3
96
106
  click_on "Pricing"
97
- first('#pricingPopup > option[value="3"]').select_option
107
+ first('#pricingPopup > option[value="0"]').select_option
98
108
  first('.saveChangesActionButton').click
99
109
  end
100
110
 
101
111
  private
102
- def app_exists?
112
+ def bundle_exist?
103
113
  open_new_app_popup # to get the dropdown of available app identifier, if it's there, the app was not yet created
104
-
105
114
  sleep 4
106
115
 
107
116
  return (all("option[value='#{@config[:bundle_identifier]}']").count == 0)
108
117
  end
109
118
 
119
+ def app_exists?
120
+ visit APPS_URL
121
+ sleep 10
122
+
123
+ first("input[ng-model='searchModel']").set @full_bundle_identifier
124
+
125
+ return (all("div[bo-bind='app.name']").count == 1)
126
+ end
127
+
128
+ def wildcard_bundle?
129
+ return @config[:bundle_identifier].end_with?("*")
130
+ end
131
+
110
132
  def open_new_app_popup
111
133
  visit APPS_URL
112
134
  sleep 8 # this usually takes some time
@@ -4,7 +4,7 @@ module Produce
4
4
  # @param config (Config) (optional) config to use. Will fallback to
5
5
  # config with ENV values if not specified.
6
6
  def self.start_producing(config = Config.new)
7
- Produce::DeveloperCenter.new.run(config)
7
+ Produce::DeveloperCenter.new.run(config) unless config[:skip_devcenter]
8
8
  return Produce::ItunesConnect.new.run(config) unless config[:skip_itc]
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Produce
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: produce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 0.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement