Skip to content

Commit

Permalink
Merge pull request #1 from Brantone/0.3.0-refactor
Browse files Browse the repository at this point in the history
Remove macOS group constraint and bump some dep versions
  • Loading branch information
rjaros87 authored Feb 2, 2017
2 parents 04dd45b + d0e378c commit f42e9a9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ AllCops:

Metrics/LineLength:
Max: 150

Metrics/BlockLength:
Max: 30
2 changes: 0 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ source 'https://supermarket.chef.io'

metadata

cookbook 'ark', git: 'https://github.com/rjaros87/ark', ref: 'seven-zip' # https://github.com/chef-cookbooks/ark/issues/157

group :integration do
cookbook 'android-sdk', path: './'
end
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
source 'https://rubygems.org'

gem 'rake'
gem 'tailor'
gem 'berkshelf', '~> 4.3'
gem 'chef', '~> 12.11'
gem 'chefspec', '~> 4.7'
gem 'foodcritic', '>= 5.0.0'
gem 'chef', '~> 12.11'
gem 'rake'
gem 'rubocop'
gem 'berkshelf', '~> 4.3'
gem 'tailor'

group :integration do
gem 'test-kitchen', '~> 1.10'
gem 'kitchen-vagrant', '~> 0.20.0'
gem 'test-kitchen', '~> 1.10'
end
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default['android-sdk']['name'] = 'android-sdk'
default['android-sdk']['owner'] = 'root'
default['android-sdk']['group'] = 'root'
default['android-sdk']['group'] = platform_family?('mac_os_x') ? 'wheel' : 'root'
default['android-sdk']['backup_archive'] = false # The number of backups to be kept in /var/chef/backup. To prevent backups set to false.
default['android-sdk']['setup_root'] = nil # ark defaults (/usr/local) is used if this attribute is not defined
default['android-sdk']['with_symlink'] = true # use ark's :install action when true; use ark's :put action when false
Expand Down
6 changes: 3 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
issues_url 'https://github.com/gildegoma/chef-android-sdk/issues'
source_url 'https://github.com/gildegoma/chef-android-sdk'
version '0.2.0'
version '0.3.0'

depends 'java', '~> 1.40.4'
depends 'java', '~> 1.42'
depends 'ark', '>= 1.1.0'
depends 'bash', '~> 0.1.2'
depends 'chef-sugar', '>= 3.3.0'
depends 'expect', '~> 2.0.0'
depends 'expect', '~> 2.0'

# TODO: maybe put maven into depends section
recommends 'maven' # Maven 3.1.1+ is required by android-sdk::maven-rescue recipe
Expand Down
6 changes: 3 additions & 3 deletions recipes/maven_rescue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
directory maven_android_sdk_deployer_home do
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
mode '0755'
action :create
end
Expand All @@ -19,7 +19,7 @@
checkout_branch "deploy_#{node['android-sdk']['maven-android-sdk-deployer']['version']}"
action :sync
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
end

#
Expand All @@ -35,7 +35,7 @@
execute 'Execute maven-android-sdk-deployer' do
command "mvn clean install -Dmaven.repo.local=#{node['android-sdk']['maven-local-repository']} --fail-never -B"
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
cwd maven_android_sdk_deployer_home

# FIXME: setting HOME might be required (if $HOME used in node['android-sdk']['maven-local-repository'],
Expand Down
14 changes: 7 additions & 7 deletions recipes/unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
prefix_root node['android-sdk']['setup_root']
prefix_home node['android-sdk']['setup_root']
owner node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
backup node['android-sdk']['backup_archive']
action node['android-sdk']['with_symlink'] ? :install : :put
end
Expand All @@ -86,12 +86,12 @@
execute 'Grant all users to read android files' do
command "chmod -R a+r #{android_home}/*"
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
end
execute 'Grant all users to execute android tools' do
command "chmod -R a+X #{File.join(android_home, 'tools')}/*"
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
end

#
Expand All @@ -102,7 +102,7 @@
source 'android-sdk.sh.erb'
mode '0644'
owner node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
variables(
android_home: android_home
)
Expand Down Expand Up @@ -137,7 +137,7 @@
environment 'ANDROID_HOME' => android_home
path [File.join(android_home, 'tools')]
user node['android-sdk']['owner']
group node['android-sdk']['group'] unless mac_os_x?
group node['android-sdk']['group']
# TODO: use --force or not?
code <<-EOF
spawn #{android_bin} update sdk --no-ui --all --filter #{sdk_component}
Expand Down Expand Up @@ -170,7 +170,7 @@
cookbook_file File.join(node['android-sdk']['scripts']['path'], android_helper_script) do
source android_helper_script
owner node['android-sdk']['scripts']['owner']
group node['android-sdk']['scripts']['group'] unless mac_os_x?
group node['android-sdk']['scripts']['group']
mode '0755'
end
end
Expand All @@ -179,7 +179,7 @@
template File.join(node['android-sdk']['scripts']['path'], android_helper_script) do
source "#{android_helper_script}.erb"
owner node['android-sdk']['scripts']['owner']
group node['android-sdk']['scripts']['group'] unless mac_os_x?
group node['android-sdk']['scripts']['group']
mode '0755'
end
end
Expand Down
1 change: 0 additions & 1 deletion test/support/dna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"android-sdk": {
"owner": "travis",
"version": "24.4.1",
"checksum": {
"linux": "e16917ad685c1563ccbc5dd782930ee1a700a1b6a6fd3e44b83ac694650435e9",
Expand Down

0 comments on commit f42e9a9

Please sign in to comment.