VS Code sets file mode to executable on Mac

On Mac, when you build the project, Visual Studio Code changes the gradlew file mode from 644 to 755. I think other files get set to 755 also, but haven’t dug into which ones or under what circumstance.

This isn’t good as these files are not executable AND more important in terms of workflow, it causes GIT to mark the file as changed.

Does anyone know of a way to prevent VS Code from setting the file mode to 755?

gradlew does need to be set to executable. The extension runs it, so it needs to be executable. There is no way to disable that behavior, as it needs to be set in order for the builds to work.

That is the only file it sets to executable, and it should be pushed to git that way as well.

I’m new to gradle and thought they were just configuration files that were read and processed, not files that were executed. Thanks for the info, I will make that change and push it.

I did find that some older versions of Gradle also didn’t respect file permissions when they did a copy, but there was a work around to force the file permissions by adding fileMode = 0644

I’ll keep my eyes open and update this thread if anything else comes up.

The gradlew file is actually a script that executes the gradle wrapper. That is what allows you to run a project without having the full gradle build system installed on your system. The wrapper will actually go and download it on the first build. The build.gradle file is the actual configuration file for the build setup.