Record Class AssignVersion
java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.AssignVersion
Assigns one project the version of the package that claims it.
The whole of what either mode does to a project, and the reason the two modes cannot drift
apart: settings mode reaches projects by applying ProjectVersionPlugin to each of them, so
both routes end in exactly this code.
No longer an IsolatedAction. It is not what gets registered with beforeProject
any more - ApplyProjectPlugin is - so it need not be serializable, and the constraints that
came with that have moved there.
Reaching no further than the project it is handed is still visible in execute(Project): it uses
that project and nothing else. Matching a project to its package is a lookup in a value computed
before any project was evaluated, which is what keeps per-project versions compatible with isolated
projects at all.
-
Constructor Summary
ConstructorsConstructorDescriptionAssignVersion(VersionCatalogue catalogue) Creates an instance of aAssignVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecataloguerecord component.final booleanIndicates whether some other object is "equal to" this one.voidexecute(org.gradle.api.Project project) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AssignVersion
Creates an instance of aAssignVersionrecord class.- Parameters:
catalogue- the value for thecataloguerecord component
-
-
Method Details
-
execute
public void execute(org.gradle.api.Project project) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
catalogue
Returns the value of thecataloguerecord component.- Returns:
- the value of the
cataloguerecord component
-