Preinstall gradle on the hybrid osx-vs4mac-stable stack

Description of the feature request

The osx-vs4mac-stable stack contains cordova, which requires gradle to run. Since gradle is missing from this stack, it needs to be added manually as a step dependency. When running a build, installing this dependency takes extra time.

It’d be beneficial to see gradle pre-installed on this stack to cut off build times.

Note that running the “Cordova Archive” workflow step is not an option because our build is based on fastlane.

Use case / for what or how I would use it

I would make my builds shorter since gradle would not need to be installed on the VM with every build.

Hy there!

Thank you for the feature request.
We will see to it! :upside_down_face:

The problem with preinstalling gradle is which version?

The official recommended way to run gradle is to use gradlew, the “gradle wrapper” which you’re expected to have committed into your repository, as that defines which version of gradle you use in your project and gradlew installs that version.

See previous discussion at How to update Grade version from script

Also official docs: https://docs.gradle.org/current/userguide/gradle_wrapper.html

All the platform dependent code of a cordova project is generated and in that context it should not be placed under version control. The cordova documentation does not point to a specific version of gradle.

In my bitrise step dependency I simply used

- fastlane@2.3.12:
deps:
  brew:
  - name: gradle

This installed the latest gradle (v5.1.1). The cordova generated gradlew defines gradle v4.1 as its dependency, which was then installed and the build works perfect.

Note that without defining the step dependency the build fails, i.e. it seems cordova insists on having gradle installed on the system. It’s not enough to have java and the gradlew file.

I think the latest stable version of gradle is what should be included in the system image by default.

Hey @fehersanyi-bitrise, @viktorbenei,

Any update on this? Would be nice to see this addition.
Thanks!

Hello there, not yet, I will create a task for the tooling team to check out if they can/want to do it :upside_down_face: