Class: Licensed::Sources::Gradle
- Defined in:
- lib/licensed/sources/gradle.rb
Defined Under Namespace
Classes: Dependency, Runner
Constant Summary collapse
- DEFAULT_CONFIGURATIONS =
["runtimeOnly", "runtimeClasspath"].freeze
- GRADLE_LICENSES_PATH =
".gradle-licenses".freeze
- GRADLE_LICENSES_CSV_NAME =
"licenses.csv".freeze
Instance Attribute Summary
Attributes inherited from Source
Instance Method Summary collapse
Methods inherited from Source
#dependencies, full_type, #ignored?, inherited, #initialize, register_source, require_matched_dependency_version, #source_config, type, type_and_version
Constructor Details
This class inherits a constructor from Licensed::Sources::Source
Instance Method Details
#enabled? ⇒ Boolean
44 45 46 |
# File 'lib/licensed/sources/gradle.rb', line 44 def enabled? !executable.to_s.empty? && File.exist?(config.pwd.join("build.gradle")) end |
#enumerate_dependencies ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/licensed/sources/gradle.rb', line 48 def enumerate_dependencies JSON.parse(gradle_runner.run("printDependencies")).map do |package| name = "#{package['group']}:#{package['name']}" Dependency.new( name: name, version: package["version"], path: config.pwd, url: package_url(name: name, version: package["version"]), metadata: { "type" => Gradle.type, } ) end end |