Gradle - File System (File API )

About

The file api of gradle to execute file system operations is detailled in this page

Note

File Permission chmod

You need to be cautious when setting the file permission because the value expected is in base 10 and not in base 8 (which is the standard)

Example when copying file into a distribution (ie archive).

into("/bin") {
        from("${buildDir}/scripts") {
          fileMode = Integer.parseInt("755", 8) // or 493 which is 755 base 8 in base 10
          dirMode = Integer.parseInt("750", 8)
        }
}





Discover More
How to bundle a jvm in a Gradle application targeting Windows, Linux or Macos

The gradle application plugin does not give the possibility to embed a jvm. This page shows how to do with a minimal knowledge of Gradle code



Share this page:
Follow us:
Task Runner