make includes globally active

This commit is contained in:
Jonathan Shook 2020-05-05 01:53:29 -05:00
parent 8dca4b5630
commit d535279055
3 changed files with 11 additions and 2 deletions

View File

@ -23,7 +23,8 @@ public class StdoutActivityType implements ActivityType<StdoutActivity> {
// sanity check that we have a yaml parameter, which contains our statements and bindings
if (!yaml.isPresent()) {
throw new RuntimeException("Currently, the stdout activity type requires yaml activity parameter.");
throw new RuntimeException("Currently, the stdout activity type requires yaml/workload activity parameter" +
".");
}
// allow shortcut: yaml parameter provide the default alias name

View File

@ -77,6 +77,8 @@ public class NBCLI {
}
NBCLIOptions options = new NBCLIOptions(args);
NBIO.addGlobalIncludes(options.wantsIncludes());
ConsoleLogging.enableConsoleLogging(options.wantsConsoleLogLevel(), options.getConsoleLoggingPattern());
if (options.wantsBasicHelp()) {

View File

@ -26,11 +26,17 @@ import java.util.stream.Collectors;
*/
public class NBIO implements NBPathsAPI.Facets {
private static String[] globalIncludes = new String[0];
public synchronized static void addGlobalIncludes(String[] globalIncludes) {
NBIO.globalIncludes = globalIncludes;
}
private URIResolver resolver;
private List<String> names = new ArrayList<>();
private List<String> extensions = new ArrayList<>();
private List<String> prefixes = new ArrayList<>();
private List<String> prefixes = Arrays.asList(globalIncludes);
private NBIO() {
}