Class: Dependabot::FileParsers::Java::Gradle

Inherits:
Base
  • Object
show all
Defined in:
lib/dependabot/file_parsers/java/gradle.rb,
lib/dependabot/file_parsers/java/gradle/repositories_finder.rb,
lib/dependabot/file_parsers/java/gradle/property_value_finder.rb

Defined Under Namespace

Classes: PropertyValueFinder, RepositoriesFinder

Constant Summary collapse

PROPERTY_REGEX =
/
  (?:\$\{property\((?<property_name>[^:\s]*?)\)\})|
  (?:\$\{(?<property_name>[^:\s]*?)\})|
  (?:\$(?<property_name>[^:\s]*))
/x.freeze
PART =
%r{[^\s,@'":/\\]+}.freeze
VSN_PART =
%r{[^\s,'":/\\]+}.freeze
DEPENDENCY_DECLARATION_REGEX =
/(?:\(|\s)\s*['"](?<declaration>#{PART}:#{PART}:#{VSN_PART})['"]/.
freeze
DEPENDENCY_SET_DECLARATION_REGEX =
/(?:^|\s)dependencySet\((?<arguments>[^\)]+)\)\s*\{/.freeze
DEPENDENCY_SET_ENTRY_REGEX =
/entry\s+['"](?<name>#{PART})['"]/.freeze

Instance Attribute Summary

Attributes inherited from Base

#credentials, #dependency_files, #source

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dependabot::FileParsers::Base

Instance Method Details

#parseObject



33
34
35
36
37
38
39
# File 'lib/dependabot/file_parsers/java/gradle.rb', line 33

def parse
  dependency_set = DependencySet.new
  buildfiles.each do |buildfile|
    dependency_set += buildfile_dependencies(buildfile)
  end
  dependency_set.dependencies
end