findLastMatchingRowIndex
Compares the target parsed string to the un-parsed lines of the original dependencies block, and returns the index of the last row which matches the parsed string.
So, given the target:
api(projects.foo.bar) {
exclude(group = "androidx.appcompat")
}
Content copied to clipboard
And given the dependencies lines:
<blank line>
// Remove leaking AppCompat dependency
api(projects.foo.bar) {
exclude(group = "androidx.appcompat")
} // this is index 4
api(libs.junit)
Content copied to clipboard
This function would return index 4
, because rows 2-4 match the target parsed string.
From this value, getOriginalString will return a multi-line string which includes the blank line and the comment.
Since
0.12.0