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 { if (gemHome != null && !gemUseSystem){ factory.addEnv("GEM_HOME", this.gemHome); factory.addEnv("GEM_PATH", this.gemPath); s = this.factory.newScript(this.script); } else if (this.file != null) { s = this.factory.newScript(this.file); } else if (this.filename != null) { s = this.factory.newScriptFromSearchPath( this.filename ); } else { s = this.factory.newArguments();
@Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException { getLog().warn( "DEPRECATED: just do not use that anymore. use gem:exec instead" ); this.factory.newScriptFromJRubyJar("gem") .addArgs(this.gemArgs) .addArgs(this.args) .execute(); } }
protected final void cli(Iterable<String> args) throws IOException, ScriptException { factory.addEnv("VAGRANT_HOME", vagrantHome); factory.addEnv("VAGRANT_RC", vagrantRc); final Script script = factory.newScriptFromSearchPath("vagrant"); for (String arg : args) if (isNotBlank(arg)) script.addArg(arg); script.execute(); } }
final ScriptFactory factory = artifact == null ? new ScriptFactory(this.logger, this.classRealm, null, this.jrubyFork): (JRUBY_CORE.equals(artifact.getArtifactId()) ? new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), getProjectClasspath(), this.jrubyFork) : new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), factory.addSwitch("-I", libDirectory.getAbsolutePath()); factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath());
Script s; if (this.script != null && this.script.length() > 0) { s = this.factory.newScript(this.script); s = this.factory.newScript(this.file); s = this.factory.newScriptFromSearchPath( this.filename ); s = this.factory.newArguments();
@Override public Script newScriptFromSearchPath(final String scriptName) throws IOException { final File script = new File(gemsConfig.getBinDirectory(), scriptName); if (script.exists()) { Script s = new Script(this); s.add(script.getAbsolutePath()); return s; } else { return super.newScriptFromSearchPath(scriptName); } } }
final Script script = installer.factory.newScript(installer.config.binScriptFile("rails")) .addArg("_" + railsVersion + "_") .addArg("new"); installer.factory.newScriptFromResource("maven/tools/pom_generator.rb") .addArg("rails") .addArg("Gemfile")
this.factory = newScriptFactory(); this.factory.addEnv("JBUNDLE_SKIP", "true"); this.factory.addEnv("JARS_SKIP", "true"); this.factory.addJvmArgs(this.jrubyJvmArgs); this.factory.addSwitches(this.jrubySwitches);
@Deprecated private void setupGemfile(final GemsInstaller installer, final File launchDirectory) { final File gemfile = new File(launchDirectory, "Gemfile.maven"); if (gemfile.exists()) { installer.factory.addEnv("BUNDLE_GEMFILE", gemfile); } }
Script s; if (this.script != null && this.script.length() > 0) { s = this.factory.newScript(this.script); s = this.factory.newScript(this.file); s = this.factory.newScriptFromSearchPath( this.filename ); s = this.factory.newArguments();
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); }
this.factory = newScriptFactory(); this.factory.addEnv("JBUNDLE_SKIP", "true"); this.factory.addEnv("JARS_SKIP", "true"); this.factory.addJvmArgs(this.jrubyJvmArgs); this.factory.addSwitches(this.jrubySwitches);
private ScriptFactory newScriptFactory() throws MojoExecutionException { ScriptFactory factory = createScriptFactory(); if( env != null ){ for( Map.Entry<String, String> entry: env.entrySet() ){ factory.addEnv( entry.getKey(), entry.getValue() ); } } return factory; }
final ScriptFactory factory = artifact == null ? new ScriptFactory(this.logger, this.classRealm, null, this.jrubyFork): (JRUBY_CORE.equals(artifact.getArtifactId()) ? new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), getProjectClasspath(), this.jrubyFork) : new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), factory.addSwitch("-I", libDirectory.getAbsolutePath()); factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath());
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 { if (gemHome != null && !gemUseSystem){ factory.addEnv("GEM_HOME", this.gemHome); factory.addEnv("GEM_PATH", this.gemPath); s = this.factory.newScript(this.script); } else if (this.file != null) { s = this.factory.newScript(this.file); } else if (this.filename != null) { s = this.factory.newScriptFromSearchPath( this.filename ); } else { s = this.factory.newArguments();
@Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException { this.factory.newScriptFromJRubyJar(this.swing ? "jirb_swing" : "jirb") .addArgs(this.irbArgs) .addArgs(this.args) .execute(); } }