Only realise the gradle property being queried.

Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
This commit is contained in:
modmuss50
2022-07-02 23:38:49 +01:00
parent 97927f913a
commit b25e5cd5a6

View File

@@ -157,17 +157,13 @@ public class RemapTaskConfiguration {
}
private static boolean getBooleanProperty(Project project, String key) {
boolean result = false;
Object value = project.getProperties().get(key);
if (value instanceof String) {
return project.getProviders().gradleProperty(key).map(string -> {
try {
result = Boolean.parseBoolean((String) value);
} catch (IllegalArgumentException ignored) {
// False
return Boolean.parseBoolean(string);
} catch (final IllegalArgumentException ex) {
return false;
}
}
return result;
})
.getOrElse(false);
}
}