From 528a39247e63e3670d7d83ec7e3a4d90e60f689b Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 24 Mar 2023 15:31:24 +0100 Subject: [PATCH] gradle: replace all Closure occurrences with Closure to avoid Groovy warning in IDE --- .../java/org/teavm/gradle/TeaVMBaseExtensionImpl.java | 2 +- .../main/java/org/teavm/gradle/TeaVMExtensionImpl.java | 10 +++++----- .../src/main/java/org/teavm/gradle/TeaVMPlugin.java | 8 -------- .../src/main/java/org/teavm/gradle/TeaVMTestsImpl.java | 4 ++-- .../java/org/teavm/gradle/api/TeaVMBaseExtension.java | 2 +- .../main/java/org/teavm/gradle/api/TeaVMExtension.java | 10 +++++----- .../src/main/java/org/teavm/gradle/api/TeaVMTests.java | 4 ++-- 7 files changed, 16 insertions(+), 24 deletions(-) diff --git a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java index fe5eb7b96..ad243d0ca 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java @@ -123,7 +123,7 @@ class TeaVMBaseExtensionImpl implements TeaVMBaseExtension { } @Override - public void tests(Closure config) { + public void tests(Closure config) { config.rehydrate(getTests(), config.getOwner(), config.getThisObject()).call(); } } diff --git a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java index 7cd019a5e..208d2c32e 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java @@ -119,7 +119,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio } @Override - public void js(Closure action) { + public void js(Closure action) { action.rehydrate(getJs(), action.getOwner(), action.getThisObject()).call(); } @@ -134,7 +134,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio } @Override - public void wasm(Closure action) { + public void wasm(Closure action) { action.rehydrate(getWasm(), action.getOwner(), action.getThisObject()).call(); } @@ -149,7 +149,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio } @Override - public void wasi(Closure action) { + public void wasi(Closure action) { action.rehydrate(getWasi(), action.getOwner(), action.getThisObject()).call(); } @@ -164,7 +164,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio } @Override - public void c(Closure action) { + public void c(Closure action) { action.rehydrate(getC(), action.getOwner(), action.getThisObject()).call(); } @@ -179,7 +179,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio } @Override - public void all(Closure action) { + public void all(Closure action) { action.rehydrate(getAll(), action.getOwner(), action.getThisObject()).call(); } diff --git a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java index 119e86dbd..d97e2440c 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java @@ -187,14 +187,6 @@ public class TeaVMPlugin implements Plugin { }); } - private static String joinPath(String first, String second) { - if (first.endsWith("/") || first.isEmpty()) { - return first + second; - } else { - return first + "/" + second; - } - } - private void applyToTask(TeaVMConfiguration configuration, TeaVMTask task, Configuration toolsConfiguration) { task.getMainClass().convention(configuration.getMainClass()); task.getClasspath().from(task.getProject().getConfigurations().getByName(CLASSPATH_CONFIGURATION_NAME)); diff --git a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMTestsImpl.java b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMTestsImpl.java index 80f71f00a..7bd3ea6d1 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMTestsImpl.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMTestsImpl.java @@ -42,7 +42,7 @@ class TeaVMTestsImpl implements TeaVMTests { } @Override - public void js(Closure config) { + public void js(Closure config) { config.rehydrate(getJs(), config.getOwner(), config.getThisObject()).call(); } @@ -57,7 +57,7 @@ class TeaVMTestsImpl implements TeaVMTests { } @Override - public void wasm(Closure config) { + public void wasm(Closure config) { config.rehydrate(getWasm(), config.getOwner(), config.getThisObject()).call(); } diff --git a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMBaseExtension.java b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMBaseExtension.java index 5d7fecd89..406a2f279 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMBaseExtension.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMBaseExtension.java @@ -29,5 +29,5 @@ public interface TeaVMBaseExtension { void tests(Action config); - void tests(@DelegatesTo(TeaVMTests.class) Closure config); + void tests(@DelegatesTo(TeaVMTests.class) Closure config); } diff --git a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMExtension.java b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMExtension.java index 4a50ddf21..dc4a13efb 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMExtension.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMExtension.java @@ -24,29 +24,29 @@ public interface TeaVMExtension extends TeaVMBaseExtension { void js(Action action); - void js(@DelegatesTo(TeaVMJSConfiguration.class) Closure action); + void js(@DelegatesTo(TeaVMJSConfiguration.class) Closure action); TeaVMWasmConfiguration getWasm(); void wasm(Action action); - void wasm(@DelegatesTo(TeaVMWasmConfiguration.class) Closure action); + void wasm(@DelegatesTo(TeaVMWasmConfiguration.class) Closure action); TeaVMWasiConfiguration getWasi(); void wasi(Action action); - void wasi(@DelegatesTo(TeaVMWasiConfiguration.class) Closure action); + void wasi(@DelegatesTo(TeaVMWasiConfiguration.class) Closure action); TeaVMCConfiguration getC(); void c(Action action); - void c(@DelegatesTo(TeaVMCConfiguration.class) Closure action); + void c(@DelegatesTo(TeaVMCConfiguration.class) Closure action); TeaVMCommonConfiguration getAll(); void all(Action action); - void all(@DelegatesTo(TeaVMCommonConfiguration.class) Closure action); + void all(@DelegatesTo(TeaVMCommonConfiguration.class) Closure action); } diff --git a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMTests.java b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMTests.java index 11990c338..003c160b8 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMTests.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/api/TeaVMTests.java @@ -24,11 +24,11 @@ public interface TeaVMTests { void js(Action config); - void js(@DelegatesTo(TeaVMJSTests.class) Closure config); + void js(@DelegatesTo(TeaVMJSTests.class) Closure config); TeaVMWasmTests getWasm(); void wasm(Action config); - void wasm(@DelegatesTo(TeaVMWasmTests.class) Closure config); + void wasm(@DelegatesTo(TeaVMWasmTests.class) Closure config); }