protected void setUp() throws Exception { File dir = new File("target/test-generated-classes"); dir.mkdirs(); Map options = new HashMap(); options.put("stubDir", dir); CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setTargetDirectory(dir); configuration.setVerbose(dumpClass); configuration.setJointCompilationOptions(options); compiler = new FileSystemCompiler(configuration); }
if (text != null && text.equalsIgnoreCase("true")) setVerbose(true);
setTargetDirectory((File) null); setClasspath(""); setVerbose(false); setDebug(false); setParameters(getSystemPropertySafe("groovy.parameters") != null);
setTargetDirectory(configuration.getTargetDirectory()); setClasspathList(new LinkedList<String>(configuration.getClasspath())); setVerbose(configuration.getVerbose()); setDebug(configuration.getDebug()); setParameters(configuration.getParameters());
init.setVerbose(false); init.setTolerance(720); init.setMinimumRecompilationInterval(234);
init.setVerbose(true); init.setTolerance(55); init.setMinimumRecompilationInterval(975);
/** * Enable verbose compiling which will display which files * are being compiled */ public void setVerbose(boolean verbose) { configuration.setVerbose( verbose ); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { try { groovyScriptEngine = new GroovyScriptEngine( new URL[] { getScriptSynchronizer().getFileSystemRoot().toURI().toURL() }); groovyScriptEngine.getConfig().setVerbose(isVerbose()); groovyScriptEngine.getConfig().setDebug(isDebug()); } catch (MalformedURLException e) { throw new SiteWhereException("Unable to create Groovy script engine.", e); } }
/** * <p>Configures the compiler by building its configuration object.</p> * * @param sourcePath the path to the source directory * @param targetPath the path to the target directory * @param classLoader the class loader to use to determine the classpath * @return the compiler configuration */ protected CompilerConfiguration buildCompilerConfiguration(File sourcePath, File targetPath, ClassLoader classLoader) { CompilerConfiguration configuration = new CompilerConfiguration(); // Set the destination / target directory for the compiled .class files. configuration.setTargetDirectory(targetPath.getAbsoluteFile()); // Specify the classpath of the given class loader. This enables the user to write new Java // "scripts" that depend on classes that have already been loaded previously. Otherwise he // wouldn't be able to use for example classes that are available in a library. configuration.setClasspath(ClassLoaderUtils.buildClasspath(classLoader)); // Enable verbose output. configuration.setVerbose(true); // Generate debugging information. configuration.setDebug(true); return configuration; }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { resourceConnector = new GlobalResourceConnector(); groovyScriptEngine = new GroovyScriptEngine(resourceConnector); groovyScriptEngine.getConfig().setVerbose(isVerbose()); groovyScriptEngine.getConfig().setDebug(isDebug()); LOGGER.info( "Global Groovy script engine configured with (verbose:" + isVerbose() + ") (debug:" + isDebug() + ")."); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { resourceConnector = new TenantResourceConnector(getTenant().getId()); groovyScriptEngine = new GroovyScriptEngine(resourceConnector); groovyScriptEngine.getConfig().setVerbose(isVerbose()); groovyScriptEngine.getConfig().setDebug(isDebug()); LOGGER.info( "Tenant Groovy script engine configured with (verbose:" + isVerbose() + ") (debug:" + isDebug() + ")."); }
private ClassCompilerImpl() throws Exception { super(ClassCompilerFeature.this); cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } }
private void configure() { cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(TARGET_BYTECODE)) { cc.setTargetBytecode(config.get(TARGET_BYTECODE, (String)null)); } if (config.contains(INVOKE_DYNAMIC) && (Boolean)config.get(INVOKE_DYNAMIC, false)) { cc.getOptimizationOptions().put("indy", true); cc.getOptimizationOptions().put("int", false); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } if (config.contains(WARNING_LEVEL)) { cc.setTolerance(config.get(WARNING_LEVEL, 0)); } if (config.contains(SOURCE_ENCODING)) { cc.setSourceEncoding(config.get(SOURCE_ENCODING, (String)null)); } }
setTargetDirectory(configuration.getTargetDirectory()); setClasspathList(new LinkedList(configuration.getClasspath())); setVerbose(configuration.getVerbose()); setDebug(configuration.getDebug()); setTolerance(configuration.getTolerance());
setTargetDirectory(configuration.getTargetDirectory()); setClasspathList(new LinkedList(configuration.getClasspath())); setVerbose(configuration.getVerbose()); setDebug(configuration.getDebug()); setTolerance(configuration.getTolerance());
setTargetDirectory(configuration.getTargetDirectory()); setClasspathList(new LinkedList<String>(configuration.getClasspath())); setVerbose(configuration.getVerbose()); setDebug(configuration.getDebug()); setTolerance(configuration.getTolerance());
private void configure() { cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(TARGET_BYTECODE)) { cc.setTargetBytecode(config.get(TARGET_BYTECODE, (String)null)); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } if (config.contains(WARNING_LEVEL)) { cc.setTolerance(config.get(WARNING_LEVEL, 0)); } if (config.contains(SOURCE_ENCODING)) { cc.setSourceEncoding(config.get(SOURCE_ENCODING, (String)null)); } }
private ClassCompilerImpl() throws Exception { super(ClassCompilerFeature.this); cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(TARGET_BYTECODE)) { cc.setTargetBytecode(config.get(TARGET_BYTECODE, (String)null)); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } if (config.contains(WARNING_LEVEL)) { cc.setTolerance(config.get(WARNING_LEVEL, 0)); } if (config.contains(SOURCE_ENCODING)) { cc.setSourceEncoding(config.get(SOURCE_ENCODING, (String)null)); } }
private void configure() { cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(TARGET_BYTECODE)) { cc.setTargetBytecode(config.get(TARGET_BYTECODE, (String)null)); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } if (config.contains(WARNING_LEVEL)) { cc.setTolerance(config.get(WARNING_LEVEL, 0)); } if (config.contains(SOURCE_ENCODING)) { cc.setSourceEncoding(config.get(SOURCE_ENCODING, (String)null)); } }
private void configure() { cc.setVerbose(config.get(VERBOSE, false)); cc.setDebug(config.get(DEBUG, false)); if (config.contains(TOLERANCE)) { cc.setTolerance(config.get(TOLERANCE, 0)); } if (config.contains(TARGET_BYTECODE)) { cc.setTargetBytecode(config.get(TARGET_BYTECODE, (String)null)); } if (config.contains(SCRIPT_BASE_CLASSNAME)) { cc.setScriptBaseClass(config.get(SCRIPT_BASE_CLASSNAME, (String)null)); } if (config.contains(DEFAULT_SCRIPT_EXTENSION)) { cc.setDefaultScriptExtension(config.get(DEFAULT_SCRIPT_EXTENSION, (String)null)); } if (config.contains(WARNING_LEVEL)) { cc.setTolerance(config.get(WARNING_LEVEL, 0)); } if (config.contains(SOURCE_ENCODING)) { cc.setSourceEncoding(config.get(SOURCE_ENCODING, (String)null)); } }