mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.7.x' into 3.0.x
This commit is contained in:
commit
b1eb08faba
@ -46,7 +46,6 @@ import org.gradle.api.internal.file.copy.CopyAction;
|
||||
import org.gradle.api.internal.file.copy.CopyActionProcessingStream;
|
||||
import org.gradle.api.java.archives.Attributes;
|
||||
import org.gradle.api.java.archives.Manifest;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.specs.Spec;
|
||||
import org.gradle.api.tasks.WorkResult;
|
||||
import org.gradle.api.tasks.WorkResults;
|
||||
@ -460,15 +459,11 @@ class BootZipCopyAction implements CopyAction {
|
||||
: UnixStat.FILE_FLAG | getPermissions(details);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private int getPermissions(FileCopyDetails details) {
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("8.3")) >= 0) {
|
||||
try {
|
||||
Object permissions = ((Provider<Object>) details.getClass()
|
||||
.getMethod("getPermissions")
|
||||
.invoke(details)).get();
|
||||
return ((Provider<Integer>) permissions.getClass().getMethod("toUnixNumeric").invoke(permissions))
|
||||
.get();
|
||||
Object permissions = details.getClass().getMethod("getPermissions").invoke(details);
|
||||
return (int) permissions.getClass().getMethod("toUnixNumeric").invoke(permissions);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new GradleException("Failed to get permissions", ex);
|
||||
|
Loading…
Reference in New Issue
Block a user