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); }
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); }
public void rake(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String environment, final String task, final String... args) throws IOException, ScriptException, GemException, RailsException { final Script script = installer.factory.newScriptFromSearchPath("rake"); script.addArgs(task); for (final String arg : args) { script.addArg(arg); } if(environment != null && environment.trim().length() > 0){ script.addArg("RAILS_ENV=" + environment); } script.executeIn(launchDirectory); }
script.addArg(gem); script.executeIn(launchDirectory());
script.executeIn(launchDirectory()); } catch (Exception e) { error = e;
script.addArg(gem); script.executeIn(launchDirectory());
@Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { final Script script = this.factory.newScriptFromSearchPath("bundle"); script.addArg("update"); if (this.bundlerArgs != null) { script.addArgs(this.bundlerArgs); } if (this.args != null) { script.addArgs(this.args); } script.executeIn(launchDirectory()); } }
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(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); }
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); }
@Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { final Script script = this.factory.newScriptFromJRubyJar("rake"); if (this.rakefile != null){ script.addArg("-f", this.rakefile); } if (this.rakeArgs != null) { script.addArgs(this.rakeArgs); } if (this.args != null) { script.addArgs(this.args); } script.executeIn(launchDirectory()); } }
script.executeIn(this.rubyDirectory == null? this.rubySourceDirectory : this.rubyDirectory);
script.executeIn(this.rubyDirectory == null? this.rubySourceDirectory : this.rubyDirectory);
script.executeIn(launchDirectory());
@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); } }