Skip to content

Commit

Permalink
Fix for failing checkExtraction and checkLicense tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Poojita Raj <poojiraj@amazon.com>
  • Loading branch information
Poojita-Raj committed Oct 26, 2022
1 parent 515f84b commit 8597073
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ public void apply(Project project) {
.create("distributionArchiveCheck", DistributionArchiveCheckExtension.class);

File archiveExtractionDir = calculateArchiveExtractionDir(project);

// sanity checks if archives can be extracted
TaskProvider<Copy> checkExtraction = registerCheckExtractionTask(project, buildDistTask, archiveExtractionDir);
checkExtraction.configure(InternalDistributionArchiveSetupPlugin.configure(buildTaskName));
TaskProvider<Task> checkLicense = registerCheckLicenseTask(project, checkExtraction);
checkLicense.configure(InternalDistributionArchiveSetupPlugin.configure(buildTaskName));

TaskProvider<Task> checkNotice = registerCheckNoticeTask(project, checkExtraction);
checkNotice.configure(InternalDistributionArchiveSetupPlugin.configure(buildTaskName));
TaskProvider<Task> checkTask = project.getTasks().named("check");
checkTask.configure(task -> {
task.dependsOn(checkExtraction);
Expand Down Expand Up @@ -118,7 +120,7 @@ public void execute(Task task) {
}

private TaskProvider<Task> registerCheckLicenseTask(Project project, TaskProvider<Copy> checkExtraction) {
TaskProvider<Task> checkLicense = project.getTasks().register("checkLicense", task -> {
return project.getTasks().register("checkLicense", task -> {
task.dependsOn(checkExtraction);
task.doLast(new Action<Task>() {
@Override
Expand All @@ -138,7 +140,6 @@ public void execute(Task task) {
}
});
});
return checkLicense;
}

private TaskProvider<Copy> registerCheckExtractionTask(Project project, TaskProvider<Task> buildDistTask, File archiveExtractionDir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void apply(Project project) {
configureTarDefaults(project);
}

private Action<Task> configure(String name) {
static Action<Task> configure(String name) {
return (Task task) -> task.onlyIf(s -> {
if (OperatingSystem.current().isWindows()) {
// On Windows, include only Windows distributions and integTestZip
Expand Down

0 comments on commit 8597073

Please sign in to comment.