Add support for Ivy
This commit is contained in:
parent
dd32f2472e
commit
325173d5bd
6 changed files with 61 additions and 0 deletions
13
docs/buckets/ivy.md
Normal file
13
docs/buckets/ivy.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# [Ivy](http://ant.apache.org/ivy/)
|
||||
|
||||
Compatible with probably any type of linux guest distro, will cache guests'
|
||||
`$HOME/.ivy2/cache` if sbt is detected.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-with-sbt-installed'
|
||||
config.cache.enable :ivy
|
||||
end
|
||||
```
|
|
@ -94,6 +94,7 @@
|
|||
<li><a tabindex="-1" href="buckets/npm">npm</a></li>
|
||||
<li><a tabindex="-1" href="buckets/rubygems">RubyGems</a></li>
|
||||
<li><a tabindex="-1" href="buckets/rvm">rvm</a></li>
|
||||
<li><a tabindex="-1" href="buckets/ivy">Ivy</a></li>
|
||||
<li><a tabindex="-1" href="buckets/yum">Yum</a></li>
|
||||
<li><a tabindex="-1" href="buckets/zypper">Zypper</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -101,3 +101,4 @@ require_relative "bucket/bower"
|
|||
require_relative "bucket/npm"
|
||||
require_relative "bucket/zypper"
|
||||
require_relative "bucket/generic"
|
||||
require_relative "bucket/ivy"
|
||||
|
|
21
lib/vagrant-cachier/bucket/ivy.rb
Normal file
21
lib/vagrant-cachier/bucket/ivy.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
module VagrantPlugins
|
||||
module Cachier
|
||||
class Bucket
|
||||
class Ivy < Bucket
|
||||
def self.capability
|
||||
:ivy_path
|
||||
end
|
||||
|
||||
def install
|
||||
if guest.capability?(:ivy_path)
|
||||
if ivy_path = guest.capability(:ivy_path)
|
||||
user_symlink(ivy_path)
|
||||
end
|
||||
else
|
||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Ivy')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/vagrant-cachier/cap/linux/ivy_path.rb
Normal file
20
lib/vagrant-cachier/cap/linux/ivy_path.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module VagrantPlugins
|
||||
module Cachier
|
||||
module Cap
|
||||
module Linux
|
||||
module IvyPath
|
||||
def self.ivy_path(machine)
|
||||
ivy_path = nil
|
||||
machine.communicate.tap do |comm|
|
||||
return unless comm.test('which sbt')
|
||||
comm.execute 'echo $HOME' do |buffer, output|
|
||||
ivy_path = output.chomp if buffer == :stdout
|
||||
end
|
||||
end
|
||||
return "#{ivy_path}/.ivy2/cache"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -26,6 +26,11 @@ module VagrantPlugins
|
|||
Cap::Linux::BowerPath
|
||||
end
|
||||
|
||||
guest_capability 'linux', 'ivy_path' do
|
||||
require_relative 'cap/linux/ivy_path'
|
||||
Cap::Linux::IvyPath
|
||||
end
|
||||
|
||||
guest_capability 'linux', 'chef_file_cache_path' do
|
||||
require_relative 'cap/linux/chef_file_cache_path'
|
||||
Cap::Linux::ChefFileCachePath
|
||||
|
|
Loading…
Reference in a new issue