Class: Bee::Task::BaseDependencyResolver
- Inherits:
-
Object
- Object
- Bee::Task::BaseDependencyResolver
- Includes:
- Util::BuildErrorMixin
- Defined in:
- lib/dependency_resolver.rb
Overview
Parent of all dependency resolvers.
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_REPOSITORY =
Default repository.
nil- DEFAULT_CACHE =
Default cache location.
nil- DEFAULT_SCOPE =
Default dependency scope.
'compile'
Instance Method Summary collapse
-
#classpath ⇒ Object
Return the classpath.
-
#dependencies ⇒ Object
Return dependencies as a list.
-
#initialize(file, scope, verbose = false) ⇒ BaseDependencyResolver
constructor
Constructor: - file: dependency file (should be maven.xml).
Constructor Details
#initialize(file, scope, verbose = false) ⇒ BaseDependencyResolver
Constructor:
-
file: dependency file (should be maven.xml).
-
scope: the scope for dependencies (compile, runtime or test).
-
verbose: tells if we should be verbose.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/dependency_resolver.rb', line 41 def initialize(file, scope, verbose=false) @file = file @scope = scope @verbose = verbose @repositories = parse_repositories @cache = DEFAULT_CACHE @dependencies = nil # print information if verbose puts "Repositories: #{@repositories.join(', ')}" if @verbose end |
Instance Method Details
#classpath ⇒ Object
Return the classpath.
53 54 55 56 57 58 59 |
# File 'lib/dependency_resolver.rb', line 53 def classpath synchronize classpath = @dependencies.map do |dependency| build_path(@cache, dependency) end return classpath.join(File::PATH_SEPARATOR) end |
#dependencies ⇒ Object
Return dependencies as a list.
62 63 64 65 66 67 68 |
# File 'lib/dependency_resolver.rb', line 62 def dependencies synchronize dependencies = @dependencies.map do |dependency| build_path(@cache, dependency) end return dependencies end |