Produce a single library for multiple file dependencies on the same file
Previously, the Gradle plugin’s ProjectLibraries produced a new library for every file dependency, even if the dependencies where on the same file. This would lead to a repackaging failure due to multiple libraries having the same name. This commit updates ProjectLibraries to treat file dependencies on the same file as a single library, thereby resolving the name clash. Fixes gh-1646
This commit is contained in:
@@ -199,6 +199,23 @@ class ProjectLibraries implements Libraries {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getFile().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof GradleLibrary) {
|
||||
return getFile().equals(((GradleLibrary) obj).getFile());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getFile().getAbsolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user