Skip to content

Commit

Permalink
Best effort detection of project dependencies with complex parameters…
Browse files Browse the repository at this point in the history
… how to declare project name, we list dependency but project name is skipped
  • Loading branch information
chali committed Apr 8, 2021
1 parent 93df0e1 commit 780be44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ abstract class GradleLintRule extends GroovyAstVisitor implements Rule {
def path = entries.get("path")
if (path != null)
visitAnySubmoduleDependency(call, methodName, path)
} else {
visitAnySubmoduleDependency(call, methodName, null)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,23 +280,29 @@ class GradleLintRuleSpec extends AbstractRuleSpec {
given:
def library = addSubproject('library')
def library2 = addSubproject('library2')
def library3 = addSubproject('library3')
library.configurations.create('compile')
project.subprojects.add(library)
project.subprojects.add(library2)
project.subprojects.add(library3)
project.buildFile << """
def baseName = ":library"
dependencies {
compile project(":library")
compile project(path: ":library2")
compile project("\${baseName}3")
}
"""

when:
def foundDependencies = new DependencyVisitingRule().run().submoduleDependencies

then:
foundDependencies.size() == 2
foundDependencies.size() == 3
foundDependencies[0] == ':library'
foundDependencies[1] == ':library2'
foundDependencies[2] == null
}

def 'visit adding file collections and other configurations into a configuration'() {
Expand Down

0 comments on commit 780be44

Please sign in to comment.