cirruslabs / docker-images-flutter

Docker Images for Flutter
MIT License
449 stars 139 forks source link

Add gradle home for flutter android #199

Closed Hoang-Nguyenn closed 2 years ago

Hoang-Nguyenn commented 2 years ago

Hi. We're now working with fastlane and build android but seem need to manual download and export environment for gradle from this one https://gist.github.com/Ashok-Varma/6b5864c1e444a3f1b61158254a43c4bc It would be great if you guys can help us to add gradle environment for flutter docker.

Hoang-Nguyenn commented 2 years ago

Maybe can only add this command to step run binsh

wget https://services.gradle.org/distributions/gradle-6.7.1-bin.zip -P /tmp sudo unzip -d /opt/gradle /tmp/gradle-*.zip export GRADLE_HOME="/opt/gradle/gradle-6.7.1/bin" export PATH=${PATH}:$GRADLE_HOME gradle -v

image

fkorotkov commented 2 years ago

I believe the recommended way is to use a Gradle Wrapper ./gradlew script. Otherwise Gradle will be yet another dependency to upgrade within the image.

Hoang-Nguyenn commented 2 years ago

I believe the recommended way is to use a Gradle Wrapper ./gradlew script. Otherwise Gradle will be yet another dependency to upgrade within the image.

I'm using fastlane for build android in ci machine now. I got problem that we ignore gradlew file in android folder. And i got ./gradlew not found. Do you have any suggestion ?

image

Hoang-Nguyenn commented 2 years ago

I believe the recommended way is to use a Gradle Wrapper ./gradlew script. Otherwise Gradle will be yet another dependency to upgrade within the image.

I'm using fastlane for build android in ci machine now. I got problem that we ignore gradlew file in android folder. And i got ./gradlew not found. Do you have any suggestion ?

image

I'm using this script "./gradlew wrapper --gradle-version 6.7.1"

fkorotkov commented 2 years ago

I'd suggest to check in the gradlew script since it will allow you to pin Gradle version that you use for the app so the same version will be used among all the engineers and CI.