From 09cdc6326704d6d7f68d785964d3a332670faf20 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 12 Apr 2023 16:48:48 +0200 Subject: [PATCH] gradle: allow to define TeaVM properties from gradle command line --- .../main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 ad243d0ca..655c2558a 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java @@ -103,13 +103,14 @@ class TeaVMBaseExtensionImpl implements TeaVMBaseExtension { @Override public Provider property(String name) { - return properties.map(p -> { + var gradleName = "teavm." + name; + return project.getProviders().systemProperty(gradleName).orElse(properties.map(p -> { var result = p.getProperty(name); if (result != null) { return result; } - return project.getProviders().gradleProperty("teavm." + name).getOrElse(null); - }); + return project.getRootProject().getProviders().gradleProperty(gradleName).getOrElse(null); + })); } @Override