Backport of #56587 for 7.x
Backport of #48849. Update `.editorconfig` to make the Java settings the default for all files, and then apply a 2-space indent to all `*.gradle` files. Then reformat all the files.
This is the backport of #45076 with dependent changes.