autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

Allow determining if a project is an application

Open
#761 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

It would be really useful if there was a way to instruct the dependency-analysis plugin that a project should be analyzed as if it were an application. Currently this is determined by checking for various plugins in the project (e.g. `application` and `org.springframework.boot`), but this is rather inflexible.

In projects I'm working on there are several other types we'd like to consider as deployable projects (i.e. not libraries with an API), such as WAR and EJB projects, as well as runtime/implementation projects that implements an API defined elsewhere.

One way of allowing the user to set this could be to add a callback to the root-extension:
```kotlin
dependencyAnalysis {
projectIsApplicationIf { p -> p.name.endsWith("-impl") || p.pluginManager.hasPlugin("war") }
}
```

An alternative solution would be to add it as a `Property` to the `IssueHandler`, where it could then be configured for each project:
```kotlin
allprojects {
pluginManager.withPlugin("com.autonomousapps.dependency-analysis") {
if (name.endsWith("-impl") || pluginManager.hasPlugin("war")) {
dependencyAnalysis {
issues {
isApplication.set(true)
}
}
}
}
}
```

I'm willing to implement this and send a pull request, but I'd like to know if you find such a feature useful - and which of the two approaches you'd prefer. I personally prefer the first option as it's simpler and quite powerful.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the dependency-analysis plugin's current application detection and the root-extension and IssueHandler entry points named in the issue. Compare the callback and Property approaches, then confirm how WAR, EJB, and implementation projects should be classified. Done means users can configure deployable projects without relying only on the existing plugin checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.