itamae-plugin-recipe-android_sdk 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 6de6d72f6abd41cd7f31ba8a9a3d6c55726ed8dc
4
- data.tar.gz: 8043653af1b397f73cbfecb222027ad01ab51e2e
3
+ metadata.gz: f2a8968ea9bd9e0e5540a656a0d514d7060a688a
4
+ data.tar.gz: 19e16c03aded9e4a14caab7083d96c740f5af442
5
5
  SHA512:
6
- metadata.gz: 1b3c5c4335fd8a61ef24f1c986fbc269bf4dcb1df510178d235b38f547f1545774f6f0ac0477325fa50c92b5835132783ea2963d3c19e0a6bf4764e247dd9dc3
7
- data.tar.gz: 4f685ad9ce1a42b7fce88a3f54c5637085e1256b0414c7d914c48114ba060f106045d8fc3b58d835c05f3ffb9a322b0b49bc8ea7f18cf45dea36473d52e858c5
6
+ metadata.gz: 5ec36ed726d35f3e4b9e53a6e393fb69798813815e5dab2d4c1d3db4b8b6ffdb4aa44efa1c81d40db9b896c187114d47b313c605d7b796758849566db02a393a
7
+ data.tar.gz: 63d239b9fa313dd2964a0db48cbcae720b647e0dbdd7281cdf1025473710c64dd25ea19a1ba3a74b047073c797cac19113665ae674be8ebc1fcac05d8459dd48
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Require JDK.
4
4
 
5
- ## Installation
5
+ [![Gem Version](https://badge.fury.io/rb/itamae-plugin-recipe-android_sdk.svg)](https://badge.fury.io/rb/itamae-plugin-recipe-android_sdk)
6
6
 
7
- **Not yet published in 'RubyGems.org'**
7
+ ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
@@ -45,7 +45,7 @@ include_recipe 'android_sdk::install'
45
45
 
46
46
  Default install path `/usr/local`, if not set 'install_path'
47
47
 
48
- #### android sdk update
48
+ #### android sdk update with filter
49
49
 
50
50
  Update Android SDK at like node.json following:
51
51
 
@@ -61,6 +61,29 @@ Update Android SDK at like node.json following:
61
61
  }
62
62
  ```
63
63
 
64
+ e.g.
65
+ ```
66
+ $ itamae ssh --vagrant --node-json node.json android_sdk.rb
67
+ ```
68
+
69
+ #### android sdk update latest
70
+
71
+ Install Android SDK and update without filter.
72
+
73
+ * recipe
74
+
75
+ ```ruby
76
+ include_recipe 'android_sdk::latest'
77
+ ```
78
+
79
+ It is the same with the following command:
80
+
81
+ ```sh
82
+ $ android update sdk -u
83
+ ```
84
+
85
+ ※ Caution<br>
86
+ It takes long time :sob:
64
87
 
65
88
  ## License
66
89
 
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ node[:sdk] ||= {}
4
+
5
+ # To disable user specified.
6
+ node[:sdk][:update_list] = nil
7
+
8
+ # Run install.
9
+ include_recipe 'android_sdk::install'
10
+
11
+ # Run update sdk latest.
12
+ include_recipe 'android_sdk::update_sdk'
@@ -4,6 +4,7 @@ ANDROID_SDK_ROOT = "#{node[:sdk][:install_path]}/#{node[:sdk][:directory]}"
4
4
 
5
5
  # Interactive android sdk update shell.
6
6
  TEMPLATE_SRC_PATH = "#{File.expand_path('../../', __FILE__)}/templates/android-update-sdk.sh.erb"
7
+ TEMPLATE_LATEST_SRC_PATH = "#{File.expand_path('../../', __FILE__)}/templates/android-update-sdk-latest.sh.erb"
7
8
  TEMPLATE_DEST_PATH = "#{ANDROID_SDK_ROOT}/tools/android-update-sdk.sh"
8
9
 
9
10
  case node[:platform]
@@ -13,13 +14,20 @@ else
13
14
  package 'expect'
14
15
  end
15
16
 
17
+ src_path = TEMPLATE_LATEST_SRC_PATH
18
+ update_list = ''
19
+
20
+ if node[:sdk][:update_list]
21
+ # Filter by user.
22
+ src_path = TEMPLATE_SRC_PATH
23
+ update_list = node[:sdk][:update_list].join(',')
24
+ end
25
+
16
26
  template TEMPLATE_DEST_PATH do
17
27
  mode "0755"
18
- source TEMPLATE_SRC_PATH
28
+ source src_path
19
29
  end
20
30
 
21
- update_list = node[:sdk][:update_list].join(',')
22
-
23
31
  # Prepare.
24
32
  case node[:platform]
25
33
  when 'osx', 'darwin'
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module AndroidSdk
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+
3
+ expect -c "
4
+ set timeout -1
5
+ spawn <%= "#{node[:sdk][:install_path]}/#{node[:sdk][:directory]}" %>/tools/android update sdk -u
6
+ expect {
7
+ \"Do you accept the license\" {
8
+ send \"y\n\"
9
+ exp_continue
10
+ }
11
+ Downloading {
12
+ exp_continue
13
+ }
14
+ Installing {
15
+ exp_continue
16
+ }
17
+ }
18
+ "
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-android_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - slowhand0309
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -83,8 +83,10 @@ files:
83
83
  - lib/itamae/plugin/recipe/android_sdk.rb
84
84
  - lib/itamae/plugin/recipe/android_sdk/dependency.rb
85
85
  - lib/itamae/plugin/recipe/android_sdk/install.rb
86
+ - lib/itamae/plugin/recipe/android_sdk/latest.rb
86
87
  - lib/itamae/plugin/recipe/android_sdk/update_sdk.rb
87
88
  - lib/itamae/plugin/recipe/android_sdk/version.rb
89
+ - lib/itamae/plugin/recipe/templates/android-update-sdk-latest.sh.erb
88
90
  - lib/itamae/plugin/recipe/templates/android-update-sdk.sh.erb
89
91
  homepage: https://github.com/Slowhand0309/itamae-plugin-recipe-android_sdk
90
92
  licenses: