private void generatePom(File file, String type) throws ScriptException, IOException { this.tmpPom.getParentFile().mkdirs(); URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); this.factory.newScript("$LOAD_PATH << '" + url.toString().replace("maven/tools/pom.rb", "")+"';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + file.getAbsolutePath() + "').to_s") .execute(tmpPom); }
final Script script = installer.factory.newScript(installer.config.binScriptFile("rails")) .addArg("_" + railsVersion + "_") .addArg("new");
private void generatePom(File file, String type) throws ScriptException, IOException { this.tmpPom.getParentFile().mkdirs(); URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); this.factory.newScript("$LOAD_PATH << '" + url.toString().replace("maven/tools/pom.rb", "")+"';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + file.getAbsolutePath() + "').to_s") .execute(tmpPom); }
private void generatePom(File source, File target) throws ScriptException, IOException { URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); String baseUrl = url.toExternalForm().replace("/maven/tools/pom.rb", ""); // this assumes to get an url JRuby understands !! this.factory.newScript("def warn(*args);end;$LOAD_PATH << '" + baseUrl + "';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + source.getAbsolutePath() + "').to_s") .executeIn(launchDirectory(), target); }
private void generatePom(File source, File target) throws ScriptException, IOException { URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); String baseUrl = url.toExternalForm().replace("/maven/tools/pom.rb", ""); // this assumes to get an url JRuby understands !! this.factory.newScript("def warn(*args);end;$LOAD_PATH << '" + baseUrl + "';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + source.getAbsolutePath() + "').to_s") .executeIn(launchDirectory(), target); }
private void processNestedDiretories(DirectoryScanner scanner) throws IOException, ScriptException { String[] directories = scanner.getIncludedDirectories(); if (directories.length > 0) { StringBuilder script = new StringBuilder("require 'jruby/commands';"); for( String dir: directories) { if (!dir.contains("/")) { script.append("JRuby::Commands.generate_dir_info('" + new File( project.getBuild().getOutputDirectory(), dir ).getAbsolutePath() + "', false) if JRuby::Commands.respond_to? :generate_dir_info;" ); } } Script s = this.factory.newScript(script.toString()); s.execute(); } }
private void processNestedDiretories(DirectoryScanner scanner) throws IOException, ScriptException { String[] directories = scanner.getIncludedDirectories(); if (directories.length > 0) { StringBuilder script = new StringBuilder("require 'jruby/commands';"); for( String dir: directories) { if (!dir.contains("/")) { script.append("JRuby::Commands.generate_dir_info('" + new File( project.getBuild().getOutputDirectory(), dir ).getAbsolutePath() + "', false) if JRuby::Commands.respond_to? :generate_dir_info;" ); } } Script s = this.factory.newScript(script.toString()); s.execute(); } }
public void generate(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String generator, final String... args) throws IOException, ScriptException, GemException, RailsException { final Script script = installer.factory.newScript(new File(new File(launchDirectory, "script"), "rails")) .addArg("generate") .addArg(generator); for (final String arg : args) { script.addArg(arg); } script.executeIn(launchDirectory); }
scriptFactory.setSourceDir( specsDir ); final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.rspecArgs != null) { script.addArgs(this.rspecArgs);
protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); outputfile.delete(); if(runitDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(runitDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), runitDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.runitArgs != null) { script.addArgs(this.runitArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); }
protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); if(minitestDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(minitestDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), minitestDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.minitestArgs != null) { script.addArgs(this.minitestArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); }
this.factory.newScript( "require 'jruby/commands'; JRuby::Commands.generate_dir_info '" + this.config.getGemHome() + "' if JRuby::Commands.respond_to? :generate_dir_info" ).execute();
protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); if(minispecDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(minispecDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), minispecDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.minispecArgs != null) { script.addArgs(this.minispecArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running specs", e); } return resultManager.generateReports(mode, version, outputfile); }
final Script script = this.factory.newScript( "\nrequire 'jruby/jrubyc'\n" + "status = JRubyCompiler::compile_argv(ARGV)\n"
final Script script = this.factory.newScript( "\nrequire 'jruby/jrubyc'\n" + "status = JRubyCompiler::compile_argv(ARGV)\n"
@Override protected Result runIt(ScriptFactory factory, Mode mode, final JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setSourceDir(new File(".")); scriptFactory.emit(); final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.cucumberArgs != null) { script.addArgs(this.cucumberArgs); } if (this.args != null) { script.addArgs(this.args); } if (this.cucumberDirectory != null) { script.addArg(this.cucumberDirectory); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); } }