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); }
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); }
ScriptException, IOException, MojoFailureException { final Script script = this.factory.newScriptFromJRubyJar("gem") .addArg("install"); script.addArg("-l", gemArtifact.getFile()); script.addArg("-l", this.gem); script.addArg((installRDoc ? "--" : "--no-") + "rdoc") .addArg((installRI ? "--" : "--no-") + "ri") .addArgs(this.installArgs) .addArgs(this.args) .execute();
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); }
.addArg("_" + railsVersion + "_") .addArg("new"); if (appPath != null) { script.addArg(appPath.getAbsolutePath()); script.addArg(arg); script.addArg("-d", database); System.setProperty("maven.rails.gwt", gwt.packageName); script.addArg("-m", templateFromResource("templates")); script.addArg("-m", templateFrom(orm, isOffline( repositorySystemSession ), railsVersion)); script.addArg("--skip-bundle"); script.execute(); .addArg("rails") .addArg("Gemfile") .executeIn(appPath, new File(appPath, "pom.xml"));
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 Script maybeAddArtifact(Script script, final Artifact artifact) throws IOException, GemException { if (artifact.getType().contains("gem")) { if (!exists(artifact)) { if (script == null) { script = this.factory.newScriptFromJRubyJar("gem") .addArg("install") .addArg("--ignore-dependencies") .addArg(booleanArg(this.config.isAddRdoc(), "rdoc")) .addArg(booleanArg(this.config.isAddRI(), "ri")) .addArg(booleanArg(this.config.isUserInstall(), "user-install")) .addArg(booleanArg(this.config.isVerbose(), "verbose")); } if (artifact.getFile() != null) { script.addArg(artifact.getFile()); } } } return script; }
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); }
ScriptException, IOException, MojoFailureException { final Script script = this.factory.newScriptFromJRubyJar("gem") .addArg("install"); script.addArg("-l", gemArtifact.getFile()); script.addArg("-l", this.gem); script.addArg((installRDoc ? "--" : "--no-") + "rdoc") .addArg((installRI ? "--" : "--no-") + "ri") .addArgs(this.installArgs) .addArgs(this.args) .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); }
public void updateMetadata(final List<String> remoteRepositoryIds, final String localRepositoryBasedir) throws ScriptException, IOException { for (final String id : remoteRepositoryIds) { if (id.startsWith("rubygems")) { this.log.info("updating metadata for " + id); this.factory.newScriptFromResource("update_metadata.rb") .addArg(id) .addArg(localRepositoryBasedir) .execute(); } } } }
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 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); }