@Override public void configure(Binder binder) { BQCoreModule.extend(binder) .initAllExtensions() .addValueObjectsDescriptors(createValueObjectsDescriptorsMap()) .addOption(createConfigOption()) .addCommand(HelpConfigCommand.class); // bind instances binder.bind(BootLogger.class).toInstance(Objects.requireNonNull(bootLogger)); binder.bind(ShutdownManager.class).toInstance(Objects.requireNonNull(shutdownManager)); binder.bind(String[].class).annotatedWith(Args.class).toInstance(Objects.requireNonNull(args)); // too much code to create config factory.. extracting it in a provider // class... binder.bind(ConfigurationFactory.class).toProvider(JsonNodeConfigurationFactoryProvider.class).in(Singleton.class); }
@Override protected void configure() { VariableDecls.extend(binder()).declareVar(OUTPUT_PATH_NAME); extend(binder()).addOption(OptionMetadata.builder( Constants.SARL_OUTPUT_DIRECTORY_OPTION, MessageFormat.format(Messages.SarlcConfigModule_0, Constants.PROGRAM_NAME, extend(binder()).addOption(OptionMetadata.builder( Constants.JAVA_OUTPUT_DIRECTORY_OPTION, MessageFormat.format(Messages.SarlcConfigModule_6, Constants.PROGRAM_NAME, extend(binder()).addOption(OptionMetadata.builder( "workingdir", Messages.SarlcConfigModule_2) //$NON-NLS-1$ .configPath(WORKING_PATH_NAME) extend(binder()).addOption(OptionMetadata.builder( "bootclasspath", //$NON-NLS-1$ MessageFormat.format(Messages.SarlcConfigModule_5, File.pathSeparator)) extend(binder()).addOption(OptionMetadata.builder( "generator", //$NON-NLS-1$ MessageFormat.format(Messages.SarlcConfigModule_7,
@Override public void configure(Binder binder) { BQCoreModule.extend(binder) .initAllExtensions() .addOption(createConfigOption()) .addCommand(HelpConfigCommand.class); // bind instances binder.bind(BootLogger.class).toInstance(Objects.requireNonNull(bootLogger)); binder.bind(ShutdownManager.class).toInstance(Objects.requireNonNull(shutdownManager)); binder.bind(String[].class).annotatedWith(Args.class).toInstance(Objects.requireNonNull(args)); // deprecated, kept for those users who may have injected this in their own code binder.bind(Duration.class).annotatedWith(ShutdownTimeout.class) .toInstance(Objects.requireNonNull(Duration.ofMillis(10000L))); // too much code to create config factory.. extracting it in a provider // class... binder.bind(ConfigurationFactory.class).toProvider(JsonNodeConfigurationFactoryProvider.class).in(Singleton.class); }
@Override protected void configure() { // Binding a dummy class to trigger eager init of Log4j as // @Provides below can not be invoked eagerly. binder().bind(LogInitTrigger.class).asEagerSingleton(); VariableDecls.extend(binder()).declareVar(LEVEL); extend(binder()).addOption(OptionMetadata.builder( "log", //$NON-NLS-1$ Locale.getString("LOG_OPT", Level.getLabels())) //$NON-NLS-1$ .configPath(LEVEL) .valueRequired(Locale.getString("LEVEL")) //$NON-NLS-1$ .build()); }
@Override protected void configure() { VariableDecls.extend(binder()).declareVar(IGNORE_WARNINGS_NAME); extend(binder()).addOption(OptionMetadata.builder( "nowarn", Messages.ValidatorConfigModule_0) //$NON-NLS-1$ .configPath(IGNORE_WARNINGS_NAME) .build()); VariableDecls.extend(binder()).declareVar(ALL_WARNINGS_NAME); extend(binder()).addOption(OptionMetadata.builder( "wall", Messages.ValidatorConfigModule_2) //$NON-NLS-1$ .configPath(ALL_WARNINGS_NAME) .build()); VariableDecls.extend(binder()).declareVar(ALL_ERRORS_NAME); extend(binder()).addOption(OptionMetadata.builder( "werror", Messages.ValidatorConfigModule_1) //$NON-NLS-1$ .configPath(ALL_ERRORS_NAME) .build()); }
@Override protected void configure() { extend(binder()) .addOption(OptionMetadata.builder( CompilerCommand.PROGRESS_OPTION_NAME, Messages.CompilerCommandModule_0) .configPath(ProgressBarConfig.ENABLE) .defaultValue(Boolean.TRUE.toString()) .build()); extend(binder()).addCommand(CompilerCommand.class); binder().bindListener(new BindingMatcher(), new LoggerProvisionListener( binder().getProvider(ProgressBarConfig.class))); }
@Override protected void configure() { VariableDecls.extend(binder()).declareVar(FILE_ENCODING_NAME); extend(binder()).addOption(OptionMetadata.builder( ENCODING_OPTION, MessageFormat.format(Messages.CompilerConfigModule_0, ENCODING_OPTION)) extend(binder()).addOption(OptionMetadata.builder( "javasource", //$NON-NLS-1$ Messages.CompilerConfigModule_2) extend(binder()).addOption(OptionMetadata.builder( "javacompiler", //$NON-NLS-1$ MessageFormat.format(Messages.CompilerConfigModule_4, JavaCompiler.getDefault().toJsonString())) Boolean.TRUE.toString(), Boolean.FALSE.toString()); VariableDecls.extend(binder()).declareVar(OUTPUT_TRACES_NAME); extend(binder()).addOption(OptionMetadata.builder( "writetraces", //$NON-NLS-1$ MessageFormat.format(Messages.CompilerConfigModule_6, Boolean.TRUE)) extend(binder()).addOption(OptionMetadata.builder( "writestorages", //$NON-NLS-1$ MessageFormat.format(Messages.CompilerConfigModule_7, Boolean.TRUE)) extend(binder()).addOption(OptionMetadata.builder( "generateinlines", //$NON-NLS-1$ MessageFormat.format(Messages.CompilerConfigModule_8, extend(binder()).addOption(OptionMetadata.builder(