Replace ./gradlew in build metadata with a call to gradlew-fdroid
Right now, fdroidserver strips gradle-wrapper (including the JAR and the gradlew script) from the upstream source tree, and F-Droid discourages app maintainers from downloading gradle-wrapper as part of the build process.
I understand this is happening for two reasons:
- disallow binary blobs (gradle wrapper jar) in the source repo, as they could be anything (proprietary/malware etc.)
- not having to download a version of gradle for each app built
This becomes an issue with non-standard builds, e.g. where build= refers to a script which makes calls to gradlew and relies on that calling a specific version of gradle. These builds need doctoring to work at all, and just replacing gradlew with gradle gives the developer of the build recipe very little control over which version of gradle ends up being called.
I understand fdroidserver has its own script, gradlew-fdroid, with some capabilities to pick a compatible gradle version and run that (downloading it if necessary).
As an improvement, I would suggest, rather than deleting gradlew, replacing it with a script which determines the desired gradle version from gradlew properties, then calls gradlew-fdroid to run it.
This would allow build scripts which utilize gradle-wrapper to run on the fdroid build server unmodified.