Skip to content

Commit

Permalink
use new file permissions API
Browse files Browse the repository at this point in the history
  • Loading branch information
esword committed Dec 6, 2024
1 parent 9d0cd80 commit 7f16381
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.api.tasks.bundling.Tar;

@SuppressWarnings("deprecation") // for the setFileMode calls
final class DistTarTask {
static final String SCRIPTS_DIST_LOCATION = "service/bin";

Expand All @@ -54,7 +53,7 @@ static void configure(

root.from("service/bin", t -> {
t.into("service/bin");
t.setFileMode(0755);
t.filePermissions(filePerms -> filePerms.unix(0755));
});

// We do this trick of iterating through every java version and making a from with a lazy value to be lazy
Expand Down Expand Up @@ -89,17 +88,17 @@ static void configure(

root.into(SCRIPTS_DIST_LOCATION, t -> {
t.from(project.getLayout().getBuildDirectory().dir("scripts"));
t.setFileMode(0755);
t.filePermissions(filePerms -> filePerms.unix(0755));
});

root.into("service/monitoring/bin", t -> {
t.from(project.getLayout().getBuildDirectory().dir("monitoring"));
t.setFileMode(0755);
t.filePermissions(filePerms -> filePerms.unix(0755));
});

root.into("service/lib/linux-x86-64", t -> {
t.from(project.getLayout().getBuildDirectory().dir("libs/linux-x86-64"));
t.setFileMode(0755);
t.filePermissions(filePerms -> filePerms.unix(0755));
});

DeploymentDirInclusion.includeFromDeploymentDirs(
Expand Down

0 comments on commit 7f16381

Please sign in to comment.