Runapk 2.2.2 → 3.0.1

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
  SHA256:
3
- metadata.gz: 885431aa828a2cc5041a6dd758c0f3bb5d332b1acba491de48a63357d83f70be
4
- data.tar.gz: 45f9dbba3aafa6a1264396c53adac4e4a3e99ffc4cdbef56025936ad5b3dfb17
3
+ metadata.gz: 960472bcf63450cd4b0a29c51862913dd779dc62fdf5b6182b69a42c377c73c4
4
+ data.tar.gz: b81749e854a84b04e4c2db92aa9128f3486b02f218150b5389895eb5a7ad95e5
5
5
  SHA512:
6
- metadata.gz: 137279edd4d27e1420713cb13fb71587438b381f80ef81496e74c6fc74be3dfd43c0c0aee203547ed928ff6ccaa851f7b144b45173c05f0d8df620545dd0ee7d
7
- data.tar.gz: '059f628e66b0774cae7226cd1555fe24b43843396f81eb73bda0717d7d57a5fc67f2596eef39aeec6e24440330dd99aa35858465240986aff6b656613820df39'
6
+ metadata.gz: 455903a473bd3b0fb2831cc9617c74ac674aee83b2c85daecca30da02c4db6a7305d92e2cf47048294bca1331ba988a2ad464bb867bf99cda46ffc933675ca38
7
+ data.tar.gz: e2f2b8dd279e4e72973f45514fb6e3192827b6dc2a1033de80eb9b7fd8dadddd0a37e34642a5cc7256e4344025ad16100fea99f77ad505089726520e5a086e7c
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  gem 'tty-prompt'
6
6
  gem 'colorator', '~> 1.1.0'
7
+ gem 'nokogiri'
7
8
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Runapk (2.1.0)
4
+ Runapk (3.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -9,7 +9,10 @@ GEM
9
9
  colorator (1.1.0)
10
10
  equatable (0.5.0)
11
11
  hitimes (1.3.0)
12
+ mini_portile2 (2.4.0)
12
13
  necromancer (0.4.0)
14
+ nokogiri (1.10.0)
15
+ mini_portile2 (~> 2.4.0)
13
16
  pastel (0.7.2)
14
17
  equatable (~> 0.5.0)
15
18
  tty-color (~> 0.4.0)
@@ -36,6 +39,7 @@ PLATFORMS
36
39
  DEPENDENCIES
37
40
  Runapk!
38
41
  colorator (~> 1.1.0)
42
+ nokogiri
39
43
  tty-prompt
40
44
 
41
45
  BUNDLED WITH
data/README.md CHANGED
@@ -18,12 +18,10 @@ Runapk extends the capacity of ionic cli, providing an refined app exporting exp
18
18
 
19
19
  ## Introduction
20
20
 
21
- When working with Applications that relies on ionic sometimes you get stuck with a thousands of commands and folder navigation, Runapk comes to solve this problem combining all these steps into a refined experience, forgeth the necessity to browse through folders and executing commands.
21
+ TL;DR When working with Applications that relies on ionic sometimes you get stuck with a thousands of commands and folder navigation, Runapk comes to solve this problem combining all these steps into a refined exporting experience, stop browsing folders & running multiple commands!
22
22
 
23
23
  Just run ``runapk`` :D and you're ready to go!
24
24
 
25
- Gabriel Lacerda Runapk author.
26
-
27
25
  ## Installation
28
26
  ### Supported OS
29
27
  - Mac
@@ -53,30 +51,15 @@ gem install Runapk
53
51
  keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
54
52
  ```
55
53
 
56
- 3. Create a ``runapk.yml`` in your ionic app root folder with this content:
57
- ```yaml
58
- app: # App specific information
59
- name: 'App Name' # Your App name
60
- version: '1.0.0' # Your App version
61
- location: '' # Your App location
62
- android: # Platform specific information
63
- version: '5.0.0' # Your Android version
64
- sign: # App sign specific information
65
- path: 'demo.keystore' # Path to your keystore
66
- ionic: # Ionic specific information
67
- version: 1 # Your ionic version, versions 1 & 2 supported
68
- output: # Output specific information
69
- path: '~/Desktop' # Your app output path
70
- ```
71
-
72
- > Replace these properties according to your project
73
-
74
- 4. In your project root folder run
54
+ 2. In your project root folder run
75
55
 
76
56
  ```
77
- runapk
57
+ runapk
78
58
  ```
79
59
 
60
+ ## Common errors
61
+ If you get error with jarsigner try changing the app ionic version, from 3 to 1 and virse versa.
62
+
80
63
  ## Development
81
64
 
82
65
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/docs/index.html CHANGED
@@ -6,11 +6,18 @@
6
6
  <link rel="stylesheet" href="https://cdn.rawgit.com/yegor256/tacit/gh-pages/tacit-css-1.3.2.min.css"/>
7
7
  <link rel="stylesheet" href="https://cdn.rawgit.com/konpa/devicon/df6431e323547add1b4cf45992913f15286456d3/devicon.min.css">
8
8
  <style>
9
+ code {
10
+ color: #eec7c2;
11
+ background: #dc3519;
12
+ }
13
+ body {
14
+ border-top: solid #dc3519;
15
+ }
9
16
  article {
10
17
  text-align: center;
11
18
  }
12
19
  .app-title {
13
- color: #d000ff;
20
+ color: #dc3519;
14
21
  }
15
22
  .css-framework-icon {
16
23
  position: relative;
@@ -41,7 +48,7 @@
41
48
  <a href="https://rubygems.org/gems/Runapk">RubyGems</a>
42
49
  </li>
43
50
  <li>
44
- <small>Current version: <code>2.2.1</code></small>
51
+ <small>Current version: <code>Beta</code></small>
45
52
  </li>
46
53
  <li>
47
54
  <small>
@@ -1,3 +1,3 @@
1
1
  module Runapk
2
- VERSION = "2.2.2"
2
+ VERSION = "3.0.1"
3
3
  end
data/lib/runapk.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "runapk/version"
2
2
  require 'tty-prompt'
3
3
  require 'colorator'
4
- require 'yaml'
4
+ require 'nokogiri'
5
5
 
6
6
  def cmd(cmd)
7
7
  IO.popen("#{cmd}").each do |line|
@@ -19,7 +19,18 @@ def phrase_simple(phrase)
19
19
  puts phrase
20
20
  end
21
21
 
22
- def compiler(c, mode)
22
+ def compiler(doc, mode)
23
+
24
+ name = doc.at_css("name").content
25
+ version = doc.at_css("widget").attribute('version')
26
+ phrase_simple 'Nome do app: ' + name.blue
27
+ phrase_simple 'Versão do app: ' + version
28
+ phrase_simple ""
29
+ app_name_export = name + '-' + version
30
+ app_name_export = app_name_export.gsub!(/\s/, '')
31
+ end_app_phrase = "O seu apk vai se chamar: ".white + "#{app_name_export}.apk".blue
32
+ phrase_simple end_app_phrase
33
+
23
34
  case mode
24
35
  when 'dev'
25
36
  params = ''
@@ -29,104 +40,77 @@ def compiler(c, mode)
29
40
  prod = true
30
41
  end
31
42
 
32
- config = YAML.load_file("#{c}")
33
-
34
- app_name = config['app']['name'].delete(' ')
35
- app_version = config['app']['version']
36
- app_location = config['app']['location']
37
- android_version = config['android']['version']
38
- cert_path = config['sign']['path']
39
- ionic_version = config['ionic']['version']
40
- output_path = config['output']['path']
41
-
42
- case ionic_version
43
- when 1
44
- platform_build_folder = 'platforms/android/build/outputs/apk'
45
- case prod
46
- when true
47
- app_release_name = 'android-release-unsigned.apk'
48
- else
49
- app_release_name = 'android-debug.apk'
50
- end
51
- when 2
52
- case prod
53
- when true
54
- platform_build_folder = 'platforms/android/app/build/outputs/apk/release'
55
- app_release_name = 'app-release-unsigned.apk'
56
- else
57
- platform_build_folder = 'platforms/android/app/build/outputs/apk/debug'
58
- app_release_name = 'app-debug.apk'
59
- end
60
- when 3
61
- case prod
62
- when true
63
- platform_build_folder = 'platforms/android/app/build/outputs/apk/release'
64
- app_release_name = 'app-release-unsigned.apk'
65
- else
66
- platform_build_folder = 'platforms/android/app/build/outputs/apk/debug'
67
- app_release_name = 'app-debug.apk'
68
- end
69
- else
70
- phrase 'Invalid ionic version'.red
71
- abort()
72
- end
73
-
74
- phrase 'Ensuring the platform is added ...'.green
43
+ phrase 'Iniciando processo de build'
75
44
 
76
- cmd("(cd #{app_location} && ionic cordova platform add android)")
45
+ cmd("(ionic cordova build android #{params})")
77
46
 
78
- phrase 'Exporting apk'.green + " #{app_name}#{app_version}.apk".blue + " with ".green + "Android #{android_version}".blue
47
+ phrase 'O seu apk foi buildado, no entanto para continuar você precisa informar o diretório do apk, ele esta acima, basta copia-lo e colar abaixo'.white
79
48
 
80
- cmd("(cd #{app_location} && ionic cordova build android #{params})")
49
+ phrase_simple 'É parecido com isso: Built the following apk(s): /Users/apk/path/apk.apk, copie essa linha e cole abaixo'.green
50
+ phrase_simple ""
81
51
 
82
- case prod
83
- when true
84
- phrase 'Signing apk, enter the password of your certificate'.green
52
+ prompt = TTY::Prompt.new
85
53
 
86
- cmd("(cd #{app_location} && jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore #{cert_path} #{platform_build_folder}/#{app_release_name} alias_name)")
87
- end
54
+ path = prompt.ask("Localização do apk:")
88
55
 
89
- case prod
90
- when true
91
- phrase 'Compressing apk'.green + " #{app_name}#{app_version}.apk".blue
56
+ phrase 'Agora informe a localização da sua keystore'.white
92
57
 
93
- cmd("(cd #{app_location} && zipalign -v 4 #{platform_build_folder}/#{app_release_name} #{platform_build_folder}/#{app_name}#{app_version}.apk)")
94
- else
95
- cmd("(cd #{app_location} && mv #{platform_build_folder}/#{app_release_name} #{platform_build_folder}/#{app_name}#{app_version}.apk)")
96
- end
58
+ keystore_path = prompt.ask("Localização da keystore:")
97
59
 
98
- phrase 'Moving apk to: '.green + "#{output_path}".blue
60
+ phrase "Iniciando processo de assinatura do apk"
99
61
 
100
- cmd("(rm ~/#{output_path}/#{app_name}#{app_version}.apk)")
62
+ cmd("(jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore #{keystore_path} #{path} alias_name)")
101
63
 
102
- cmd("(cd #{app_location} && mv #{platform_build_folder}/#{app_name}#{app_version}.apk ~/#{output_path})")
64
+ phrase "Comprimindo app"
103
65
 
104
- phrase_simple "Thanks for using RunApk!".green
66
+ cmd("(zipalign -v 4 #{path} #{app_name_export}.apk)")
67
+ phrase_simple ""
68
+ phrase_simple "Seu app está pronto!"
69
+ phrase_simple "Basta navegar a pasta raiz do seu projeto ionic"
70
+ phrase_simple ""
71
+ phrase_simple "Obrigado por utilizar o RunApk!".green
105
72
  end
106
73
 
107
74
  def setup()
108
- phrase_simple '🤩 Welcome to RunApk! 🤩'.blue
109
- phrase_simple '⛱ RunApk is an ionic app exporting tool! 🏖'.green
110
- phrase "👩🏻‍💻 If you you'ld like to help, follow: " + "https://github.com/gabriellacerda/runapk".blue
111
-
112
- prompt = TTY::Prompt.new
75
+ case ARGV[0]
76
+ when 'skip'
77
+ # phrase_simple 'Hey you want to skip, sure!'
78
+ end
113
79
 
114
- type = prompt.select("👰 Choose a pipeline:", %w(Development Production))
80
+ phrase_simple ""
81
+ phrase_simple "============================================".green + "".blue + "===========================".green + "".blue
82
+ phrase_simple "== ".green + "".blue + " ==".green + "".blue
83
+ phrase_simple "== GabrielLacerda presents: ".green + "".blue + " 👩‍🚀 Runapk ==".green + "".blue
84
+ phrase_simple "== ".green + "".blue + " ==".green + "".blue
85
+ phrase_simple "============================================".green + "".blue + "===========================".green + "".blue
86
+ phrase "Runapk is open source, if you'd like to help follow:\n".blue + "https://github.com/gabriellacerda/Runapk".green
115
87
 
116
- config_file = './runapk.yml'
88
+ prompt = TTY::Prompt.new
117
89
 
118
- case File.file?(config_file)
119
- when true
120
- case type
121
- when 'Development'
122
- compiler config_file, 'dev'
123
- else
124
- compiler config_file, 'prod'
90
+ lang = prompt.select("🏳 Welcome Developer! for a better experience select your language:", ['Português Brasil', 'English'])
91
+
92
+ case lang
93
+ when 'Português Brasil'
94
+ phrase_simple ""
95
+ phrase_simple '👩‍🚀 Brr Dr, ei onde está o meu comp... 👩‍🚀'.white
96
+ phrase_simple ""
97
+ platform = prompt.select("👩‍🚀 Para qual plataform você deseja exportar?", %w(Android iOS))
98
+ phrase_simple ""
99
+ type = prompt.select("👩‍🚀 Que tipo de apk você deseja?", ['Desenvolvimento (Build rápida, recomendado para testes locais)', 'Produção (Inclui todas as otimizações necessárias para exportar o app para a Play Store ou Apple Store) Se for para android, você vai precisar de uma keystore: https://runapk.page.link/keystore'])
100
+ phrase_simple ""
101
+ load_config = prompt.select("👩‍🚀 Eu não sei o nome e a versão do seu app, deseja que eu carregue eles do seu arquivo de configuração? É o config.xml a propósito...", ['É claro'])
102
+ phrase_simple ""
103
+ case load_config
104
+ when 'É claro'
105
+ @doc = Nokogiri::XML(File.open("config.xml"))
106
+ case type
107
+ when 'Development'
108
+ compiler @doc, 'dev'
109
+ else
110
+ compiler @doc, 'prod'
111
+ end
125
112
  end
126
113
  else
127
- puts 'Sorry a configuration file is needed 😥'
128
- puts 'Please follow the instructions located at: ' + "💃🏻 " + 'https://github.com/gabriellacerda/runapk'.red + " 🎉"
129
- abort()
130
114
  end
131
115
  end
132
116
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Runapk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GabrielLacerda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-24 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RunApk comes to help when the problem is to export ionic apks
14
14
  email:
@@ -35,6 +35,20 @@ files:
35
35
  - runapk.gemspec
36
36
  - test/runapk_test.rb
37
37
  - test/test_helper.rb
38
+ - vendor/cache/colorator-1.1.0.gem
39
+ - vendor/cache/equatable-0.5.0.gem
40
+ - vendor/cache/hitimes-1.3.0.gem
41
+ - vendor/cache/mini_portile2-2.4.0.gem
42
+ - vendor/cache/necromancer-0.4.0.gem
43
+ - vendor/cache/nokogiri-1.10.0.gem
44
+ - vendor/cache/pastel-0.7.2.gem
45
+ - vendor/cache/timers-4.1.2.gem
46
+ - vendor/cache/tty-color-0.4.3.gem
47
+ - vendor/cache/tty-cursor-0.5.0.gem
48
+ - vendor/cache/tty-prompt-0.16.1.gem
49
+ - vendor/cache/tty-reader-0.3.0.gem
50
+ - vendor/cache/tty-screen-0.6.5.gem
51
+ - vendor/cache/wisper-2.0.0.gem
38
52
  homepage: https://gabriellacerda.github.io/Runapk
39
53
  licenses: []
40
54
  metadata: {}
@@ -54,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
68
  version: '0'
55
69
  requirements: []
56
70
  rubyforge_project:
57
- rubygems_version: 2.7.7
71
+ rubygems_version: 2.7.6
58
72
  signing_key:
59
73
  specification_version: 4
60
74
  summary: RunApk export apks of ionic v1 & v3 apps!