Switching signing keys

Hi, I am maintaining some open-sourced Gradle-based projects. I wanted those projects to :

  1. Sign with different keys per project.
    • Company projects to be signed with my company address. Personal projects to be signed with my personal address.
  2. (Nice to have) Allow other developers to have different signing configurations with build.gradle shared.
    • Some may use properties signing.keyId, some may use useGpgCmd(), some may use useInMemoryPgpKeys().

Does anyone have good ideas?

Some thoughts and tries :

  • Once I have ~/.gradle/gradle.properties, (project)/gradle.properties does not look working. Having a default signing.KeyId in ~/.gradle/, and having per-project gradle.properties to override to cover #1, may not work fine.
  • PgpSignatoryFactory looks to have some createSignatory methods that receive propertyPrefix. They may allow us to read from signing.(prefix).keyId to cover #1, but not sure how they can be utilized from build.gradle. PgpSignatoryFactory (Gradle API 7.3.3)
  • No ideas for #2