Jar task does not seem to apply fileMode property?

The Jar task has a documented fileMode property which when I use it seems not to do anything:

jar {

// We’re making a runnable jar

fileMode = 0755

// …

}

I’m using gradle 1.9. I see there was a similar bug fixed on the Copy task in version 1.0 (GRADLE-971). Is this a bug or by design?

Thanks

How do you tell that it’s not doing anything? Are you aware that this is supposed to set file permissions for the files inside the Jar?

Ah, I see. From the documentation’s use of “target files” I expected it to make the jar executable; now I see the reason for the plural “files” and the symmetry with Copy tasks.

An explicit doLast { file(jar.archivePath).setExecutable(true, false) } is the way to do this, I guess?

Yes, that should do it.