@Override protected int run() { // this allows the caller to manipulate the JVM state, so require the admin privilege. Jenkins.getActiveInstance().checkPermission(Jenkins.RUN_SCRIPTS); // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); TerminalFactory.reset(); StringBuilder commandLine = new StringBuilder(); for (String arg : args) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append(arg); } Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(commandLine.toString()); }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run() throws Exception { Groovysh shell = new Groovysh(io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public static void main(final String[] args) { Binding binding = new Binding(); // Configure your bindings here. Groovysh shell = new Groovysh(binding, new IO()); shell.run(args); }
public void run() throws GroovyShellException { try { final Groovysh shell = createShell(); shell.run((String) null); } catch (Exception e) { throw new GroovyShellException(e); } }
@Override public int main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) { // this allows the caller to manipulate the JVM state, so require the admin privilege. Hudson.getInstance().checkPermission(Hudson.ADMINISTER); // TODO: ^as this class overrides main() (which has authentication stuff), // how to get ADMIN permission for this command? // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); Terminal.resetTerminal(); Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(args.toArray(new String[args.size()])); }
public void run() throws GroovyShellException { try { final Groovysh shell = createShell(); shell.run((String) null); } catch (Exception e) { throw new GroovyShellException(e); } }
@Override public int main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) { // this allows the caller to manipulate the JVM state, so require the admin privilege. Hudson.getInstance().checkPermission(Hudson.ADMINISTER); // TODO: ^as this class overrides main() (which has authentication stuff), // how to get ADMIN permission for this command? // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); Terminal.resetTerminal(); Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(args.toArray(new String[args.size()])); }
@Override public int main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) { // this allows the caller to manipulate the JVM state, so require the admin privilege. Hudson.getInstance().checkPermission(Hudson.ADMINISTER); // TODO: ^as this class overrides main() (which has authentication stuff), // how to get ADMIN permission for this command? // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); Terminal.resetTerminal(); Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(args.toArray(new String[args.size()])); }
public static void main( String... args ) throws IOException { PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) ); if( args.length > 0 ) { GroovyMain.main( args ); } else { Groovysh shell = new Groovysh(); for( String name : IMPORTS ) { shell.execute( "import " + name ); } shell.run( null ); } }
@Override protected int run() { // this allows the caller to manipulate the JVM state, so require the admin privilege. Jenkins.getActiveInstance().checkPermission(Jenkins.RUN_SCRIPTS); // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); TerminalFactory.reset(); StringBuilder commandLine = new StringBuilder(); for (String arg : args) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append(arg); } Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(commandLine.toString()); }
public static void main( String... args ) throws IOException { PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) ); if( args.length > 0 ) { GroovyMain.main( args ); } else { Groovysh shell = new Groovysh(); for( String name : IMPORTS ) { shell.execute( "import " + name ); } shell.run( null ); } }
groovy.run();
@Override public void run() { try { SshTerminal.registerEnvironment(env); shell.run(""); callback.onExit(0); } catch (RuntimeException e) { callback.onExit(-1, e.getMessage()); } catch (Error e) { callback.onExit(-1, e.getMessage()); } } }, session);
@Override public void run(final ClassLoader classLoader, final ResourceLoader resourceLoader, final Map<String, Object> context, final @Nullable Map<String, Object> options) throws Exception { checkNotNull(classLoader); checkNotNull(resourceLoader); checkNotNull(context); log.trace("Running; class-loader: {}, resource-loader: {}, context: {}", classLoader, resourceLoader, context); GroovyClassLoader gcl = runtime.createGroovyClassLoader(classLoader, resourceLoader); Binding binding = runtime.createBinding(context); Groovysh shell = new Groovysh(gcl, binding, new IO()); if (options != null) { configureOptions(shell, options); } try { shell.run(); } finally { gcl.clearCache(); } }
@Override public void run(final ClassLoader classLoader, final ResourceLoader resourceLoader, final Map<String, Object> context, final @Nullable Map<String, Object> options) throws Exception { checkNotNull(classLoader); checkNotNull(resourceLoader); checkNotNull(context); log.trace("Running; class-loader: {}, resource-loader: {}, context: {}", classLoader, resourceLoader, context); GroovyClassLoader gcl = runtime.createGroovyClassLoader(classLoader, resourceLoader); Binding binding = runtime.createBinding(context); Groovysh shell = new Groovysh(gcl, binding, new IO()); if (options != null) { configureOptions(shell, options); } try { shell.run(null); } finally { gcl.clearCache(); } }