From b841a98e2057b591af881bda4f0f521947badf9a Mon Sep 17 00:00:00 2001 From: Marc Hermans Date: Mon, 17 Jun 2024 17:26:22 +0200 Subject: [PATCH] Address Scis review --- .../gradle/common/CommonProjectPlugin.java | 2 -- .../tasks/action/DownloadFileAction.java | 30 +++++++++++-------- .../extensions/DynamicProjectExtension.java | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/common/src/main/java/net/neoforged/gradle/common/CommonProjectPlugin.java b/common/src/main/java/net/neoforged/gradle/common/CommonProjectPlugin.java index 92993f620..9e9d64135 100644 --- a/common/src/main/java/net/neoforged/gradle/common/CommonProjectPlugin.java +++ b/common/src/main/java/net/neoforged/gradle/common/CommonProjectPlugin.java @@ -390,8 +390,6 @@ private void applyAfterEvaluate(final Project project) { } }); - - definitionSet.forEach((identifier, definition) -> { definition.configureRun(runImpl); }); diff --git a/common/src/main/java/net/neoforged/gradle/common/runtime/tasks/action/DownloadFileAction.java b/common/src/main/java/net/neoforged/gradle/common/runtime/tasks/action/DownloadFileAction.java index 70b1fbcce..4a6369ea9 100644 --- a/common/src/main/java/net/neoforged/gradle/common/runtime/tasks/action/DownloadFileAction.java +++ b/common/src/main/java/net/neoforged/gradle/common/runtime/tasks/action/DownloadFileAction.java @@ -109,22 +109,22 @@ public void execute() { private record Monitor(GradleInternalUtils.ProgressLoggerWrapper progress) implements CopyProgressListener { @Override - public void start(CopyProgressEvent evt) { - progress.started(); - progress.incrementDownloadProgress(evt.getReadBytes()); - } + public void start(CopyProgressEvent evt) { + progress.started(); + progress.incrementDownloadProgress(evt.getReadBytes()); + } - @Override - public void progress(CopyProgressEvent evt) { - progress.incrementDownloadProgress(evt.getReadBytes()); - } + @Override + public void progress(CopyProgressEvent evt) { + progress.incrementDownloadProgress(evt.getReadBytes()); + } - @Override - public void end(CopyProgressEvent evt) { - progress.incrementDownloadProgress(evt.getReadBytes()); - progress.completed(); - } + @Override + public void end(CopyProgressEvent evt) { + progress.incrementDownloadProgress(evt.getReadBytes()); + progress.completed(); } + } private static final class Timeout implements TimeoutConstraint { @@ -143,9 +143,13 @@ public int getReadTimeout() { public interface Params extends WorkParameters { Property getUrl(); + Property getSha1(); + Property getShouldValidateHash(); + RegularFileProperty getOutputFile(); + Property getIsOffline(); } } diff --git a/platform/src/main/java/net/neoforged/gradle/platform/extensions/DynamicProjectExtension.java b/platform/src/main/java/net/neoforged/gradle/platform/extensions/DynamicProjectExtension.java index 47b9dce5b..778e2e059 100644 --- a/platform/src/main/java/net/neoforged/gradle/platform/extensions/DynamicProjectExtension.java +++ b/platform/src/main/java/net/neoforged/gradle/platform/extensions/DynamicProjectExtension.java @@ -770,7 +770,7 @@ private void configureRunType(final Project project, final RunType runType, fina runType.getClasspath().from(runtimeClasspath); - Provider assetsDir = DownloadAssets.getAssetsDirectory(project, project.provider(runtimeDefinition::getVersionJson)).map(Directory::getAsFile).map(File::getAbsolutePath); // runtimeDefinition.getAssets().flatMap().map(Directory::getAsFile).map(File::getAbsolutePath); + Provider assetsDir = DownloadAssets.getAssetsDirectory(project, project.provider(runtimeDefinition::getVersionJson)).map(Directory::getAsFile).map(File::getAbsolutePath); Provider assetIndex = runtimeDefinition.getAssets().flatMap(DownloadAssets::getAssetIndex); runType.getRunAdapter().set(run -> {