afinstaller 0.1.4 → 0.1.6

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: d799405716de00afc9790f019d84d48ed1ccefd2
4
- data.tar.gz: 95b35f4494afe58ebbb314c9049e36a71d5b9e2c
3
+ metadata.gz: 815d0865d0e7af0301ef77e33b8280799c3dabe5
4
+ data.tar.gz: 27d54edd12ee977ef19b889a6574d8fec237a951
5
5
  SHA512:
6
- metadata.gz: dd088ee1e498d922111b10442e529d46a3f2f2a6c70e7dfeba21b60896f338e15ed8d8bb748cdb74a7305102078fb129795283f702c142f294d6522c8274de78
7
- data.tar.gz: ef58b36901b53b8cf5ffb713e44d40b66b6e9f106ae975eae2f90ba09384135158e595c6d649b1b69670610ef5ffbf44b285944511096c31002c51024fd4d136
6
+ metadata.gz: 8600d5df289322fbf797d8082f0eb6cf1a96f0ecc565764ce775788204fa8e591c6e4dc0daee9588c038db39d6ff7abc2ddd5928597fc3523ee3537eb1b18c3a
7
+ data.tar.gz: 8d67f12344b4518b9139285c4fda71380538dfffa377d437d26a1bb877f4b7f73b2a793a3a74e0ade694181468c984c56142779c0691951e838dfb8efe50986d
@@ -1,13 +1,18 @@
1
1
  require 'thor'
2
2
  require 'afinstaller'
3
3
  require 'afinstaller/installers/Errors/error'
4
+
4
5
  require 'afinstaller/installers/iOS/iOS'
5
6
  require 'afinstaller/installers/iOS/iOSBuild'
6
7
  require 'afinstaller/installers/Android/android'
7
8
  require 'afinstaller/installers/Android/androidBuild'
9
+
10
+ require 'afinstaller/installers/AF/platform'
8
11
  require 'afinstaller/installers/Resi/platform'
12
+ require 'afinstaller/installers/AF/platformBuild'
9
13
  require 'afinstaller/installers/Resi/platformBuild'
10
14
 
15
+
11
16
  def system!(*args)
12
17
  system(*args) || abort(''+red('\n== Command #{args} failed =="')+'')
13
18
  end
@@ -116,6 +121,37 @@ module Afinstaller
116
121
  end
117
122
  end
118
123
 
124
+
125
+ method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
126
+ desc "AF [Platform] [Version]", "CLI Installer for AF VS"
127
+ long_desc <<-LONGDESC
128
+ `afinstaller AF [Platform] [version]` will clone the AF VS [Platform] repo with the version you speicify. It will finally
129
+ open the project folder after it finishes setting up dependencies.
130
+
131
+ Android:
132
+ You can optionally specify the build flag [-b], which will attempt to run Gradle Clean.
133
+ This requires Java 8.0 and above.
134
+
135
+ iOS:
136
+ You can optionall specify the build flag [-b], which will attempt to run pod install.
137
+ This requires cocoapods to be installed. `sudo gem install cocoapods`.
138
+
139
+ > $ afinstaller AF [Platofrm] 4.5.0 -b
140
+ LONGDESC
141
+ def AF(platform, version)
142
+ build_project = options[:build]
143
+ if platform.downcase == "ios" || platform.downcase == "android"
144
+ if build_project
145
+ Afinstaller::Installers::AFPlatformBuild.start([version, platform])
146
+ else
147
+ Afinstaller::Installers::AFPlatform.start([version, platform])
148
+ end
149
+ else
150
+ error = "Incorrect Platform selected. Please try afinstaller AF iOS [version]"
151
+ Afinstaller::Installers::Error.start([error])
152
+ end
153
+ end
154
+
119
155
  # Add support for Kiosk
120
156
  # method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
121
157
  # desc "Kiosk [Version]", "CLI Installer for PW Kiosk Template"
@@ -0,0 +1,57 @@
1
+ require 'thor/group'
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ module Afinstaller
7
+ module Installers
8
+ class AFPlatform < Thor::Group
9
+ argument :version, :type => :string
10
+ argument :platform, :type => :string
11
+ include Thor::Actions
12
+
13
+ def self.source_root
14
+ File.dirname(__FILE__)
15
+ end
16
+
17
+ def clone_command
18
+ v = "#{version}"
19
+ plat = "#{platform}"
20
+
21
+ # Create directory and change directory into created dir.
22
+ FileUtils::mkdir "AF-#{version}-#{plat}" unless File.exists?("AF-#{version}-#{plat}")
23
+ FileUtils.cd("AF-#{version}-#{plat}", :verbose => false)
24
+ puts Rainbow("== Cloning Repo ==").cyan
25
+ if platform.downcase == "ios"
26
+ system! 'git clone -b release/v'+v+' ssh://git@bitbucket.phunware.com:7999/af/af-template-ios.git' unless File.exist?('af-template-ios')
27
+ else
28
+ system! 'git clone -b v'+v+' ssh://git@bitbucket.phunware.com:7999/af/af-template-android.git' unless File.exist?('af-template-android')
29
+ end
30
+ puts Rainbow("== Cloning Succeeded ==").magenta
31
+ end
32
+
33
+ def dependency_install_command
34
+ puts Rainbow("== Moving to project folder ==").cyan
35
+
36
+ if platform.downcase == "ios"
37
+ FileUtils.cd('af-template-ios', :verbose => false)
38
+ puts Rainbow("== Folder is now af-template-ios ==").magenta
39
+
40
+ puts Rainbow("== Attempting to run pod install ==").cyan
41
+ system! 'pod install'
42
+ puts Rainbow("== Cocoapod installation completed ==").magenta
43
+ else
44
+ FileUtils.cd('af-template-android', :verbose => false)
45
+ puts Rainbow("== Folder is now af-template-android ==").magenta
46
+ end
47
+ end
48
+
49
+ def open_project_folder
50
+ puts Rainbow("== Open project folder ==").cyan
51
+ system! 'open .'
52
+ puts Rainbow("== AF Installer process completed. Thank you ==").magenta
53
+ end
54
+
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,75 @@
1
+ module Afinstaller
2
+ module Installers
3
+ class AFPlatformBuild < Thor::Group
4
+ argument :version, :type => :string
5
+ argument :platform, :type => :string
6
+ include Thor::Actions
7
+
8
+ def self.source_root
9
+ File.dirname(__FILE__)
10
+ end
11
+
12
+ def clone_command
13
+ v = "#{version}"
14
+ plat = "#{platform}"
15
+
16
+ # Create directory and change directory into created dir.
17
+ FileUtils::mkdir "AF-#{version}-#{plat}" unless File.exists?("AF-#{version}-#{plat}")
18
+ FileUtils.cd("AF-#{version}-#{plat}", :verbose => false)
19
+ puts Rainbow("== Cloning Repo ==").cyan
20
+ if platform.downcase == "ios"
21
+ system! 'git clone -b release/v'+v+' ssh://git@bitbucket.phunware.com:7999/af/af-template-ios.git' unless File.exist?('af-template-ios')
22
+ else
23
+ system! 'git clone -b v'+v+' ssh://git@bitbucket.phunware.com:7999/af/af-template-android.git' unless File.exist?('af-template-android')
24
+ end
25
+ puts Rainbow("== Cloning Succeeded ==").magenta
26
+ end
27
+
28
+ def dependency_install_command
29
+ puts Rainbow("== Moving to project folder ==").cyan
30
+
31
+ if platform.downcase == "ios"
32
+ FileUtils.cd('af-template-ios', :verbose => false)
33
+ puts Rainbow("== Folder is now af-template-ios ==").magenta
34
+
35
+ puts Rainbow("== Attempting to run pod install ==").cyan
36
+ system! 'pod install'
37
+ puts Rainbow("== Cocoapod installation completed ==").magenta
38
+ else
39
+ FileUtils.cd('af-template-android', :verbose => false)
40
+ puts Rainbow("== Folder is now af-template-android ==").magenta
41
+ puts Rainbow("== Attempting Gradle Clean ==").cyan
42
+ system! './gradlew clean :app:assembleDebug --parallel --daemon --configure-on-demand -PminSdk=21'
43
+ puts Rainbow("== Gradle successful ==").magenta
44
+ end
45
+
46
+ rescue NoMethodError => e
47
+ puts Rainbow("== Something went wrong. Please try again. ==").red
48
+ exit 1
49
+
50
+ end
51
+
52
+ def build_attmept
53
+ puts Rainbow("== Attempting to build project ==").cyan
54
+ if platform.downcase == "ios"
55
+ system! 'xcodebuild -scheme GenericAF4 -workspace GenericAF4.xcworkspace/ -sdk iphonesimulator build | xcpretty'
56
+ else
57
+ system! 'adb install -r app/build/outputs/apk/app-$1-debug.apk'
58
+ system! 'adb shell monkey -p com.phunware.appframework.sample.generic_template.$1 -c android.intent.category.LAUNCHER 1'
59
+ end
60
+ puts Rainbow("== Project built successfully ==").magenta
61
+
62
+ rescue NoMethodError => e
63
+ puts Rainbow("== Something went wrong. Please try again. ==").red
64
+ exit 1
65
+ end
66
+
67
+ def open_project_folder
68
+ puts Rainbow("== Open project folder ==").cyan
69
+ system! 'open .'
70
+ puts Rainbow("== AF Installer process completed. Thank you ==").magenta
71
+ end
72
+
73
+ end
74
+ end
75
+ end
@@ -1,3 +1,3 @@
1
1
  module Afinstaller
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/afinstaller.rb CHANGED
@@ -4,7 +4,10 @@ require 'afinstaller/installers/Errors/error'
4
4
  require 'afinstaller/installers/iOS/iOSBuild'
5
5
  require 'afinstaller/installers/Android/android'
6
6
  require 'afinstaller/installers/Android/androidBuild'
7
+
8
+ require 'afinstaller/installers/AF/platform'
7
9
  require 'afinstaller/installers/Resi/platform'
10
+ require 'afinstaller/installers/AF/platformBuild'
8
11
  require 'afinstaller/installers/Resi/platformBuild'
9
12
 
10
13
  module Afinstaller
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afinstaller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Morales
@@ -162,6 +162,8 @@ files:
162
162
  - features/support/setup.rb
163
163
  - lib/afinstaller.rb
164
164
  - lib/afinstaller/cli.rb
165
+ - lib/afinstaller/installers/AF/platform.rb
166
+ - lib/afinstaller/installers/AF/platformBuild.rb
165
167
  - lib/afinstaller/installers/Android/android.rb
166
168
  - lib/afinstaller/installers/Android/androidBuild.rb
167
169
  - lib/afinstaller/installers/Errors/error.rb