Sorry for my rusty gradle skills, but; Is there a ...
# gradle
e
Sorry for my rusty gradle skills, but; Is there a gradle target already that compiles my app for release but signs it with the debug cert?
g
Do you mean Android app?
e
yes and sorry, should've stated that. I can ofc easily create a keystore and sign it. I just thought it would be nice to get the perf optimizations bug with the debug cert.
g
I don’t think that there is anything like this built in. The direct solution is to create one more build type like
Optimized
which will do everything what Release is doing, but with debug signature, but It’s actually quite a heavy weight solution, it increases amount of tasks, requires full rebuilding on switch between build types (it will not reuse many caches from release), may require explicit support on side of your code (if you use BuildConfig) So our solution for this is that we just use debug keystore for release builds by default, because we anyway cannot push release keystore to the repo and we use gradle properties to specify path to release key store/alias/password so it allows you to build release with any signature without adding new build type
e
So our solution for this is that we just use debug keystore for release builds by default, because we anyway cannot push release keystore to the repo and we use gradle properties to specify path to release key store/alias/password so it allows you to build release with any signature without adding new build type
This is what what I want to do. This app will never be uploaded to the play store either way. I think I might have to google for the syntax to set that up though 🙂 like I said, by Gradle skills are rusty at best 😄 I really appreciate the longer explanation! big thanks!
g
Essentially we declare signingConfigs block as usual, with debug and release configs, and then we have:
Copy code
buildTypes {
  ...
  release {
    ...
    if (signingConfigs.release.storeFile == null) {
         // Use debug config instead of release
         signingConfig signingConfigs.debug
    } else {
         signingConfig signingConfigs.release
    }
  }
}
In your case, if you just want to use debug config for all types, do not declare singningConfigs.release at all and just use singningConfigs.debug unconditionally