From e1827880c9e712ce49af65d0fd58b152176c76bb Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 31 Jul 2023 15:13:02 +0200 Subject: [PATCH] Gradle: in no optimization mode, generate JS, which is friendly to Chrome debugger --- .../java/org/teavm/gradle/tasks/GenerateJavaScriptTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateJavaScriptTask.java b/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateJavaScriptTask.java index 2b0d005d8..7e8820a4c 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateJavaScriptTask.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateJavaScriptTask.java @@ -18,6 +18,7 @@ package org.teavm.gradle.tasks; import org.gradle.api.provider.Property; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Optional; +import org.teavm.gradle.api.OptimizationLevel; import org.teavm.tooling.TeaVMTargetType; import org.teavm.tooling.builder.BuildStrategy; @@ -52,5 +53,8 @@ public abstract class GenerateJavaScriptTask extends TeaVMTask { builder.setStrict(getStrict().get()); builder.setSourceMapsFileGenerated(getSourceMap().get()); builder.setEntryPointName(getEntryPointName().get()); + if (getOptimization().get() == OptimizationLevel.NONE) { + builder.setMaxTopLevelNames(1000); + } } }