Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore project deps when checking for SNAPSHOT deps #52

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package to.wetransform.gradle.version

import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ProjectDependency;

import java.util.function.BiPredicate
import org.gradle.api.Plugin;
Expand Down Expand Up @@ -110,7 +111,11 @@ abstract class AbstractVersionPlugin implements Plugin<Project> {
* @param project the project to check
*/
void checkSnapshotDependencies(Project project, VersionExtension extension) {
def matcher = { Dependency d -> d.version?.contains('SNAPSHOT') }
def matcher = { Dependency d ->
// exclude project dependencies (we assume they are also managed by the plugin and will automatically change on release)
// include if version is SNAPSHOT version
!(d instanceof ProjectDependency) && d.version?.contains('SNAPSHOT')
}
def collector = { Dependency d -> "${d.group ?: ''}:${d.name}:${d.version ?: ''}" }

def message = ""
Expand Down
Loading