afinstaller 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +39 -17
- data/lib/afinstaller/cli.rb +60 -3
- data/lib/afinstaller/installers/Android/androidBuild.rb +4 -0
- data/lib/afinstaller/installers/Resi/platform.rb +57 -0
- data/lib/afinstaller/installers/Resi/platformBuild.rb +75 -0
- data/lib/afinstaller/installers/iOS/ios.rb +4 -0
- data/lib/afinstaller/installers/iOS/iosBuild.rb +4 -0
- data/lib/afinstaller/version.rb +1 -1
- data/lib/afinstaller.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d799405716de00afc9790f019d84d48ed1ccefd2
|
4
|
+
data.tar.gz: 95b35f4494afe58ebbb314c9049e36a71d5b9e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd088ee1e498d922111b10442e529d46a3f2f2a6c70e7dfeba21b60896f338e15ed8d8bb748cdb74a7305102078fb129795283f702c142f294d6522c8274de78
|
7
|
+
data.tar.gz: ef58b36901b53b8cf5ffb713e44d40b66b6e9f106ae975eae2f90ba09384135158e595c6d649b1b69670610ef5ffbf44b285944511096c31002c51024fd4d136
|
data/README.md
CHANGED
@@ -1,38 +1,60 @@
|
|
1
|
-
#
|
1
|
+
# AFInstaller
|
2
2
|
|
3
|
-
|
3
|
+
AFInstaller is a tool that will clone and install AF projects.
|
4
4
|
|
5
|
-
|
5
|
+
## Requirements:
|
6
|
+
- Ruby 2.0.0 or above.
|
7
|
+
- RubyGems 2.0.0 or above
|
8
|
+
|
9
|
+
This gems assumes that you have general knowledge of Ruby, have a ruby manager (rvm or rbenv) or possibly already using homebrew.
|
6
10
|
|
7
11
|
## Installation
|
12
|
+
Run the following command on your terminal:
|
8
13
|
|
9
|
-
|
14
|
+
$ gem install afinstaller
|
10
15
|
|
11
|
-
|
12
|
-
gem 'afinstaller'
|
13
|
-
```
|
16
|
+
## Usage
|
14
17
|
|
15
|
-
|
18
|
+
### Flags
|
19
|
+
[Optional Flags] : -b
|
20
|
+
-b represents --build
|
16
21
|
|
17
|
-
|
22
|
+
### Help
|
23
|
+
$ afinstaller - This will show all available commands
|
18
24
|
|
19
|
-
|
25
|
+
$ afinstaller help [Platform] will show available commands for iOS
|
20
26
|
|
21
|
-
|
27
|
+
### iOS
|
28
|
+
$ afinstaller iOS [Version] will clone an AF 4.5.0 project, run pod install and open the project folder window.
|
22
29
|
|
23
|
-
|
30
|
+
$ afinstaller iOS [version] -b will do the same as above, but will to a test build via xcodebuild after pod install.
|
31
|
+
|
32
|
+
### Android
|
33
|
+
$ afinstaller Android [version] will clone an AF 4.5.0 project and open the proejct folder window.
|
34
|
+
|
35
|
+
$ afinstaller Android [version] -b will do the same as above, but will also ran Gradle Clean in your terminal.
|
36
|
+
|
37
|
+
|
38
|
+
## Known Issues
|
39
|
+
- Using ZSH for your bash.
|
40
|
+
|
41
|
+
Possible Solutions:
|
42
|
+
|
43
|
+
[StackOverflow](https://stackoverflow.com/questions/14607193/installing-gem-or-updating-rubygems-fails-with-permissions-error)
|
24
44
|
|
25
|
-
|
45
|
+
## Found a bug?
|
46
|
+
Report it here: [New Issues](https://github.com/gmorales-phunware/afinstaller/issues/new)
|
26
47
|
|
27
48
|
## Development
|
28
49
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
50
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec cucumber feature` to run the tests.
|
30
51
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
52
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
53
|
+
To release a new version, submit a pull request. Once approved, I will push an update.
|
32
54
|
|
33
55
|
## Contributing
|
34
56
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub
|
57
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/gmorales-phunware/afinstaller). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
58
|
|
37
59
|
## License
|
38
60
|
|
@@ -40,4 +62,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
40
62
|
|
41
63
|
## Code of Conduct
|
42
64
|
|
43
|
-
Everyone interacting in the
|
65
|
+
Everyone interacting in the AFInstaller project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/gmorales-phunware/afinstaller/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/afinstaller/cli.rb
CHANGED
@@ -5,6 +5,8 @@ require 'afinstaller/installers/iOS/iOS'
|
|
5
5
|
require 'afinstaller/installers/iOS/iOSBuild'
|
6
6
|
require 'afinstaller/installers/Android/android'
|
7
7
|
require 'afinstaller/installers/Android/androidBuild'
|
8
|
+
require 'afinstaller/installers/Resi/platform'
|
9
|
+
require 'afinstaller/installers/Resi/platformBuild'
|
8
10
|
|
9
11
|
def system!(*args)
|
10
12
|
system(*args) || abort(''+red('\n== Command #{args} failed =="')+'')
|
@@ -16,13 +18,20 @@ module Afinstaller
|
|
16
18
|
def self.exit_on_failure?
|
17
19
|
true
|
18
20
|
end
|
19
|
-
method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
|
20
21
|
|
22
|
+
# iOS AF
|
23
|
+
method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
|
21
24
|
desc "iOS [version]", "CLI Installer for AF iOS "
|
22
25
|
long_desc <<-LONGDESC
|
23
26
|
`afinstaller iOS [version]` will clone the AF iOS repo with the version you specify. It will then run `pod install`,
|
24
27
|
it will finally open the project folder.
|
25
28
|
|
29
|
+
* Note: This command utilizes the repo branch due to tag versioning not being up to date. If you get an error due to
|
30
|
+
a branch not being found or incorrect, please try an earlier version or contact someone in the AF team to add the branch
|
31
|
+
to the repo.
|
32
|
+
|
33
|
+
** For this same reason, master or develop branches are not supported.
|
34
|
+
|
26
35
|
You can optionally specify the build flag [-b], which will build your project after cocoapod installation
|
27
36
|
|
28
37
|
> $ afinstaller iOS 4.5.0 -b
|
@@ -30,8 +39,13 @@ module Afinstaller
|
|
30
39
|
def iOS(version)
|
31
40
|
build_project = options[:build]
|
32
41
|
if version == "help"
|
33
|
-
error = "Incorrect
|
42
|
+
error = "Incorrect command. Please try afinstaller help iOS"
|
43
|
+
Afinstaller::Installers::Error.start([error])
|
44
|
+
|
45
|
+
elsif version.downcase == "master" || version.downcase == "develop"
|
46
|
+
error = "Current branch is not supported. Please try a valid release branch. ie 4.5.0"
|
34
47
|
Afinstaller::Installers::Error.start([error])
|
48
|
+
|
35
49
|
end
|
36
50
|
|
37
51
|
if build_project
|
@@ -41,12 +55,16 @@ module Afinstaller
|
|
41
55
|
end
|
42
56
|
end
|
43
57
|
|
58
|
+
# Android AF
|
44
59
|
method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
|
45
60
|
desc "Android [version]", "CLI Installer for AF Android "
|
46
61
|
long_desc <<-LONGDESC
|
47
62
|
`afinstaller Android [version]` will clone the AF Android repo with the version you specify. It will it will
|
48
63
|
finally open the project folder.
|
49
64
|
|
65
|
+
* Note: This command uses the repo tags. If you get an error due to a tag not found during cloning, please try an
|
66
|
+
ealier version or contact somoene in the AF team to add the tag to the repo.
|
67
|
+
|
50
68
|
You can optionally specify the build flag [-b], which will attempt to run Gradle Clean.
|
51
69
|
This requires Java 8.0 and above.
|
52
70
|
|
@@ -58,7 +76,7 @@ module Afinstaller
|
|
58
76
|
error = "Incorrect comment. Please try afinstaller help iOS"
|
59
77
|
Afinstaller::Installers::Error.start([error])
|
60
78
|
end
|
61
|
-
|
79
|
+
|
62
80
|
if build_project
|
63
81
|
Afinstaller::Installers::AndroidBuild.start([version])
|
64
82
|
else
|
@@ -66,5 +84,44 @@ module Afinstaller
|
|
66
84
|
end
|
67
85
|
end
|
68
86
|
|
87
|
+
# Residential Project
|
88
|
+
# Single Command for both platforms.
|
89
|
+
method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
|
90
|
+
desc "Resi [Platform] [Version]", "CLI Installer for AF Resi"
|
91
|
+
long_desc <<-LONGDESC
|
92
|
+
`afinstaller Resi [platform] [version]` will clone the AF Resi [Platform] repo with the version you specify. It will it will
|
93
|
+
finally open the project folder.
|
94
|
+
|
95
|
+
Android:
|
96
|
+
You can optionally specify the build flag [-b], which will attempt to run Gradle Clean.
|
97
|
+
This requires Java 8.0 and above.
|
98
|
+
|
99
|
+
iOS:
|
100
|
+
You can optionally specify the build flag [-b], which will attmept to run pod install.
|
101
|
+
This requires cocoapods to be installed. `sudo gem install cocoapods`
|
102
|
+
|
103
|
+
> $ afinstaller Resi [Platform] 4.5.0 -b
|
104
|
+
LONGDESC
|
105
|
+
def Resi(platform, version)
|
106
|
+
build_project = options[:build]
|
107
|
+
if platform.downcase == "ios" || platform.downcase == "android"
|
108
|
+
if build_project
|
109
|
+
Afinstaller::Installers::ResiPlatformBuild.start([version, platform])
|
110
|
+
else
|
111
|
+
Afinstaller::Installers::ResiPlatform.start([version, platform])
|
112
|
+
end
|
113
|
+
else
|
114
|
+
error = "Incorrect Platform. Please try afinstaller Resi iOS [version]"
|
115
|
+
Afinstaller::Installers::Error.start([error])
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# Add support for Kiosk
|
120
|
+
# method_option :build, :aliases => "-b", :desc => "Build project after cloning repo."
|
121
|
+
# desc "Kiosk [Version]", "CLI Installer for PW Kiosk Template"
|
122
|
+
# def Kiosk(version)
|
123
|
+
# build_project = options[:build]
|
124
|
+
# end
|
125
|
+
|
69
126
|
end
|
70
127
|
end
|
@@ -25,6 +25,10 @@ module Afinstaller
|
|
25
25
|
puts Rainbow("== Attempting Gradle Clean ==").cyan
|
26
26
|
system! './gradlew clean :app:assemble$1Debug --parallel --daemon --configure-on-demand -PminSdk=21'
|
27
27
|
puts Rainbow("== Gradle successful ==").magenta
|
28
|
+
|
29
|
+
rescue NoMethodError => e
|
30
|
+
puts Rainbow("== Gradle Failed Check your settings. ==").red
|
31
|
+
exit 1
|
28
32
|
end
|
29
33
|
|
30
34
|
def open_project_folder
|
@@ -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 ResiPlatform < 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-Resi-#{version}-#{plat}" unless File.exists?("AF-Resi-#{version}-#{plat}")
|
23
|
+
FileUtils.cd("AF-Resi-#{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/resi/resi-template-ios.git' unless File.exist?('resi-template-ios')
|
27
|
+
else
|
28
|
+
system! 'git clone -b v'+v+' ssh://git@bitbucket.phunware.com:7999/resi/resi-template-android.git' unless File.exist?('resi-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('resi-template-ios', :verbose => false)
|
38
|
+
puts Rainbow("== Folder is now resi-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('resi-template-android', :verbose => false)
|
45
|
+
puts Rainbow("== Folder is now resi-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 ResiPlatformBuild < 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-Resi-#{version}-#{plat}" unless File.exists?("AF-Resi-#{version}-#{plat}")
|
18
|
+
FileUtils.cd("AF-Resi-#{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/resi/resi-template-ios.git' unless File.exist?('resi-template-ios')
|
22
|
+
else
|
23
|
+
system! 'git clone -b v'+v+' ssh://git@bitbucket.phunware.com:7999/resi/resi-template-android.git' unless File.exist?('resi-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('resi-template-ios', :verbose => false)
|
33
|
+
puts Rainbow("== Folder is now resi-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('resi-template-android', :verbose => false)
|
40
|
+
puts Rainbow("== Folder is now resi-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 GenericRESI -workspace GenericRESI.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
|
@@ -30,6 +30,10 @@ module Afinstaller
|
|
30
30
|
puts Rainbow("== Attempting to run pod install ==").cyan
|
31
31
|
system! 'pod install'
|
32
32
|
puts Rainbow("== Cocoapod installation completed ==").magenta
|
33
|
+
|
34
|
+
rescue NoMethodError => e
|
35
|
+
puts Rainbow("== Something went wrong. Please try again. ==").red
|
36
|
+
exit 1
|
33
37
|
end
|
34
38
|
|
35
39
|
def open_project_folder
|
@@ -25,6 +25,10 @@ module Afinstaller
|
|
25
25
|
puts Rainbow("== Attempting to run pod install ==").cyan
|
26
26
|
system! 'pod install'
|
27
27
|
puts Rainbow("== Cocoapod installation completed ==").magenta
|
28
|
+
|
29
|
+
rescue NoMethodError => e
|
30
|
+
puts Rainbow("== Something went wrong. Please try again. ==").red
|
31
|
+
exit 1
|
28
32
|
end
|
29
33
|
|
30
34
|
def build_attmept
|
data/lib/afinstaller/version.rb
CHANGED
data/lib/afinstaller.rb
CHANGED
@@ -4,6 +4,8 @@ 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
|
+
require 'afinstaller/installers/Resi/platform'
|
8
|
+
require 'afinstaller/installers/Resi/platformBuild'
|
7
9
|
|
8
10
|
module Afinstaller
|
9
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: afinstaller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabe Morales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,6 +165,8 @@ files:
|
|
165
165
|
- lib/afinstaller/installers/Android/android.rb
|
166
166
|
- lib/afinstaller/installers/Android/androidBuild.rb
|
167
167
|
- lib/afinstaller/installers/Errors/error.rb
|
168
|
+
- lib/afinstaller/installers/Resi/platform.rb
|
169
|
+
- lib/afinstaller/installers/Resi/platformBuild.rb
|
168
170
|
- lib/afinstaller/installers/iOS/ios.rb
|
169
171
|
- lib/afinstaller/installers/iOS/iosBuild.rb
|
170
172
|
- lib/afinstaller/ios.rb
|