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 f877352cc..3a98012dc 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java @@ -21,6 +21,7 @@ import org.gradle.api.Action; import org.gradle.api.Project; import org.gradle.api.model.ObjectFactory; import org.teavm.gradle.api.OptimizationLevel; +import org.teavm.gradle.api.SourceFilePolicy; import org.teavm.gradle.api.TeaVMCConfiguration; import org.teavm.gradle.api.TeaVMCommonConfiguration; import org.teavm.gradle.api.TeaVMExtension; @@ -67,6 +68,9 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio js.getAddedToWebApp().convention(property("js.addedToWebApp").map(Boolean::parseBoolean).orElse(false)); js.getOptimization().convention(property("js.optimization").map(OptimizationLevel::valueOf) .orElse(OptimizationLevel.BALANCED)); + js.getSourceFilePolicy().convention(property("js.sourceFilePolicy") + .map(SourceFilePolicy::valueOf) + .orElse(SourceFilePolicy.DO_NOTHING)); } private void setupWasmDefaults() { 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 8169badc3..726554813 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java @@ -157,7 +157,9 @@ public class TeaVMPlugin implements Plugin { )); var tmpConfig = project.getConfigurations().detachedConfiguration(sourcesDep); tmpConfig.setTransitive(false); - result.addAll(tmpConfig.getFiles()); + if (!tmpConfig.getResolvedConfiguration().hasError()) { + result.addAll(tmpConfig.getResolvedConfiguration().getLenientConfiguration().getFiles()); + } } } return result;