Support "log" property in MCP executor

This commit is contained in:
Juuz
2022-09-06 15:56:41 +03:00
parent 5d642fce83
commit 68bf76f328
2 changed files with 6 additions and 0 deletions

View File

@@ -39,6 +39,10 @@ public sealed interface ConfigValue {
String OUTPUT = "output";
String PREVIOUS_OUTPUT_SUFFIX = "Output";
String SRG_MAPPINGS_NAME = "mappings";
/**
* A special config value that is the path to a log file if absent.
*/
String LOG = "log";
<R> R fold(Function<? super Constant, ? extends R> constant, Function<? super Variable, ? extends R> variable);

View File

@@ -102,6 +102,8 @@ public final class McpExecutor {
return LoomGradleExtension.get(project).getSrgProvider().getSrg().toAbsolutePath().toString();
} else if (extraConfig.containsKey(name)) {
return extraConfig.get(name);
} else if (name.equals(ConfigValue.LOG)) {
return cache.resolve("log.log").toAbsolutePath().toString();
}
throw new IllegalArgumentException("Unknown MCP config variable: " + name);