mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Merge remote-tracking branch 'upstream/dev/1.3' into dev/1.3
This commit is contained in:
@@ -72,10 +72,17 @@ public final class GradleUtils {
|
||||
}
|
||||
|
||||
public static Provider<Boolean> getBooleanPropertyProvider(Project project, String key) {
|
||||
return project.getProviders().gradleProperty(key).map(string -> {
|
||||
try {
|
||||
return Boolean.parseBoolean(string);
|
||||
} catch (final IllegalArgumentException ex) {
|
||||
// Works around https://github.com/gradle/gradle/issues/23572
|
||||
return project.provider(() -> {
|
||||
final Object value = project.findProperty(key);
|
||||
|
||||
if (value instanceof String str) {
|
||||
try {
|
||||
return Boolean.parseBoolean(str);
|
||||
} catch (final IllegalArgumentException ex) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user