produce 0.2.1 → 0.3.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: 2737d354d49b76ae67cab9aa54cf774546442791
4
- data.tar.gz: 5b35c15f98277dd2cc29c75938bb6ea53efb9329
3
+ metadata.gz: cdd87fbc197ac08bfa19d4530ea62f6611a24d9f
4
+ data.tar.gz: 88863487d9583382d07d1152ff1c955241587b1e
5
5
  SHA512:
6
- metadata.gz: e75858bd0c4bcf50300f314761a90858113d6dc4747b91273a4d98cb812e99f4e9e2c4839f5a26c30d7058de20d5dde15d54df2a072955b625937965d8a5649c
7
- data.tar.gz: 53c9452feb3eb2c7d3f1f64eaada75e8515c02d1e1f2585843a560e2ce1bae313a38928f40f24b2d9eaa9d37779dd37a8da89409bf58f541510874b5ab00dec1
6
+ metadata.gz: de9f3100f2ceeddb02a49bb039a99fbe7b20df43deffceb5ecabf977a4dd2a50fc376ff76d97fabd4ca3e8ec14985c0eb04c7974ea6bb22c5004a53fe766a573
7
+ data.tar.gz: 243616f71df1b02073ecdf9ae157a108310454ab313a2486e32fa3d8721a50647e1d590d4f773727c2a682edc86b9a85f69ccfe7024df0afe9d79b9142daadd9
data/bin/produce CHANGED
@@ -4,7 +4,6 @@ $:.push File.expand_path("../../lib", __FILE__)
4
4
 
5
5
  require 'produce'
6
6
  require 'commander'
7
- require 'credentials_manager/password_manager'
8
7
  require 'credentials_manager/appfile_config'
9
8
 
10
9
  HighLine.track_eof = false
@@ -18,7 +17,7 @@ class ProduceApplication
18
17
  program :help, 'Author', 'Felix Krause <produce@krausefx.com>'
19
18
  program :help, 'Website', 'https://fastlane.tools'
20
19
  program :help, 'GitHub', 'https://github.com/krausefx/produce'
21
- # program :help_formatter, :compact # https://github.com/commander-rb/commander/issues/12
20
+ program :help_formatter, :compact
22
21
 
23
22
  always_trace!
24
23
 
@@ -6,7 +6,8 @@ module Produce
6
6
  app_name: "App Name: ",
7
7
  version: "Initial version number (e.g. '1.0'): ",
8
8
  sku: "SKU Number (e.g. '1234'): ",
9
- primary_language: "Primary Language (e.g. 'English', 'German'): "
9
+ primary_language: "Primary Language (e.g. 'English', 'German'): ",
10
+ company_name: "Company name (Leave blank to leave the current one): "
10
11
  }
11
12
 
12
13
  # Left to prevent fastlane from crashing. Should be removed upon version bump.
@@ -42,7 +43,7 @@ module Produce
42
43
  q.validate = lambda { |val| is_valid_language?(val) }
43
44
  q.responses[:not_valid] = "Please enter one of available languages: #{AvailableDefaultLanguages.all_languages}"
44
45
  else
45
- q.validate = lambda { |val| !val.empty? }
46
+ q.validate = lambda { |val| !val.empty? } unless key == :company_name
46
47
  q.responses[:not_valid] = "#{key.to_s.gsub('_', ' ').capitalize} can't be blank"
47
48
  end
48
49
  end
@@ -67,11 +68,12 @@ module Produce
67
68
  bundle_identifier_suffix: ENV['PRODUCE_APP_IDENTIFIER_SUFFIX'],
68
69
  app_name: ENV['PRODUCE_APP_NAME'],
69
70
  version: ENV['PRODUCE_VERSION'],
70
- sku: ENV['PRODUCE_SKU'],
71
+ sku: ENV['PRODUCE_SKU'] || Time.now.to_i.to_s,
71
72
  skip_itc: is_truthy?(ENV['PRODUCE_SKIP_ITC']),
72
73
  skip_devcenter: is_truthy?(ENV['PRODUCE_SKIP_DEVCENTER']),
73
74
  team_id: ENV['PRODUCE_TEAM_ID'],
74
- team_name: ENV['PRODUCE_TEAM_NAME']
75
+ team_name: ENV['PRODUCE_TEAM_NAME'],
76
+ company_name: ENV['PRODUCE_COMPANY_NAME']
75
77
  }
76
78
 
77
79
  if ENV['PRODUCE_LANGUAGE']
@@ -113,4 +115,4 @@ module Produce
113
115
  end
114
116
 
115
117
  end
116
- end
118
+ end
@@ -1,18 +1,18 @@
1
- require 'fastlane_core/developer_center/developer_center'
1
+ require 'spaceship'
2
+ require 'babosa'
2
3
 
3
4
  module Produce
4
- class DeveloperCenter < FastlaneCore::DeveloperCenter
5
- APPS_URL = "https://developer.apple.com/account/ios/identifiers/bundle/bundleList.action"
6
- CREATE_APP_URL = "https://developer.apple.com/account/ios/identifiers/bundle/bundleCreate.action"
5
+ class DeveloperCenter
7
6
 
8
7
  def run(config)
9
8
  @config = config
9
+ login
10
10
  create_new_app
11
- rescue => ex
12
- error_occured(ex)
13
11
  end
14
12
 
15
13
  def create_new_app
14
+ ENV["CREATED_NEW_APP_ID"] = Time.now.to_i.to_s
15
+
16
16
  if app_exists?
17
17
  Helper.log.info "App '#{@config[:app_name]}' already exists, nothing to do on the Dev Center".green
18
18
  ENV["CREATED_NEW_APP_ID"] = nil
@@ -20,29 +20,15 @@ module Produce
20
20
  else
21
21
  app_name = valid_name_for(@config[:app_name])
22
22
  Helper.log.info "Creating new app '#{app_name}' on the Apple Dev Center".green
23
- visit CREATE_APP_URL
24
- wait_for_elements("*[name='appIdName']").first.set app_name
25
- wait_for_elements("*[name='explicitIdentifier']").first.set @config[:bundle_identifier]
26
- click_next
27
-
28
- sleep 5 # sometimes this takes a while and we don't want to timeout
29
-
30
- if all(".form-error").count > 0
31
- error = all(".form-error").collect { |a| a.text }.join("\n")
32
- raise error.red
33
- end
34
-
35
- wait_for_elements("form[name='bundleSubmit']") # this will show the summary of the given information
36
- click_next
37
-
38
- sleep 5 # sometimes this takes a while and we don't want to timeout
39
-
40
- wait_for_elements(".ios.bundles.confirmForm.complete")
41
- click_on "Done"
23
+
24
+ app = Spaceship.app.create!(bundle_id: @config[:bundle_identifier].to_s,
25
+ name: app_name)
42
26
 
43
- raise "Something went wrong when creating the new app - it's not listed in the App's list" unless app_exists?
27
+ Helper.log.info "Created app #{app}"
28
+
29
+ raise "Something went wrong when creating the new app - it's not listed in the apps list" unless app_exists?
44
30
 
45
- ENV["CREATED_NEW_APP_ID"] = Time.now.to_s
31
+ ENV["CREATED_NEW_APP_ID"] = Time.now.to_i.to_s
46
32
 
47
33
  Helper.log.info "Finished creating new app '#{app_name}' on the Dev Center".green
48
34
  end
@@ -50,22 +36,22 @@ module Produce
50
36
  return true
51
37
  end
52
38
 
39
+ def valid_name_for(input)
40
+ latinazed = input.to_slug.transliterate.to_s # remove accents
41
+ latinazed.gsub(/[^0-9A-Za-z\d\s]/, '') # remove non-valid characters
42
+ end
53
43
 
54
44
  private
55
45
  def app_exists?
56
- visit APPS_URL
57
-
58
- wait_for_elements("td[aria-describedby='grid-table_identifier']").each do |app|
59
- identifier = app['title']
60
-
61
- return true if identifier.to_s == @config[:bundle_identifier].to_s
62
- end
63
-
64
- false
46
+ Spaceship.app.find(@config[:bundle_identifier].to_s) != nil
65
47
  end
66
48
 
67
- def click_next
68
- wait_for_elements('.button.small.blue.right.submit').last.click
49
+ def login
50
+ user = ENV["CERT_USERNAME"] || ENV["DELIVER_USER"] || CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
51
+ manager = CredentialsManager::PasswordManager.shared_manager(user)
52
+
53
+ Spaceship.login(user, manager.password)
54
+ Spaceship.select_team
69
55
  end
70
56
  end
71
57
  end
@@ -74,11 +74,14 @@ module Produce
74
74
 
75
75
  def initial_create
76
76
  open_new_app_popup
77
-
77
+
78
78
  # Fill out the initial information
79
79
  wait_for_elements("input[ng-model='createAppDetails.newApp.name.value']").first.set @config[:app_name]
80
80
  wait_for_elements("input[ng-model='createAppDetails.versionString.value']").first.set @config[:version]
81
81
  wait_for_elements("input[ng-model='createAppDetails.newApp.vendorId.value']").first.set @config[:sku]
82
+ if not @config[:company_name].to_s.empty?
83
+ wait_for_elements("input[ng-model='createAppDetails.companyName.value']", true).first.set @config[:company_name]
84
+ end
82
85
 
83
86
  all(:xpath, "//option[text()='#{@config[:primary_language]}']").first.select_option
84
87
  wait_for_elements("option[value='#{@config[:bundle_identifier]}']").first.select_option
@@ -1,3 +1,3 @@
1
1
  module Produce
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.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.2.1
4
+ version: 0.3.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-05-04 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.7.2
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.5.0
26
+ version: 0.7.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: spaceship
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.10
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.10
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
176
  version: '0'
163
177
  requirements: []
164
178
  rubyforge_project:
165
- rubygems_version: 2.2.2
179
+ rubygems_version: 2.4.7
166
180
  signing_key:
167
181
  specification_version: 4
168
182
  summary: Create new iOS apps on iTunes Connect and Dev Portal using the command line