Package org.apache.tools.ant.types.Environment

Examples of org.apache.tools.ant.types.Environment.Variable


      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(CHILDVM_SYSPROP_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here


                    + TABLE_PREFIX_KEY + " > " + SQL_FILE_KEY + LINE_SEPARATOR + "psql -d " + DATABASE_KEY + " -U " + PGUSER_KEY + " -h " + HOST_KEY + " -p " + PORT_KEY + " -f " + SQL_FILE_KEY;
                    final ExecTask task = new ExecTask();
                    task.setExecutable(RASTER2PGSQL_COMMAND);
                    task.setDir(dir);
                    task.createArg().setValue("-G");
                    Variable variable = new Variable();
                    variable.setKey("PATH");
                    variable.setValue(PATH);
                    task.addEnv(variable);

                    // Logging to a temporary file to avoid logging on system out 
                    file = File.createTempFile("r2pg", ".tmp");
                    task.setOutput(file);
View Full Code Here

        ExecTask task = new ExecTask();
        task.setExecutable(scriptFile.getAbsolutePath());
        task.setDir(dataDir);
        // Setting Postgres password to authenticate DB Import
        Variable variable = new Variable();
        variable.setKey("PGPASSWORD");
        variable.setValue(password);
        task.addEnv(variable);

        // Setting PATH variable
        Variable varPath = new Variable();
        varPath.setKey("PATH");
        varPath.setValue(PATH);
        task.addEnv(variable);
        task.execute();
    }
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(CHILDVM_SYSPROP_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_COUNT);
      v.setValue(Integer.toString(slaveInfo.slaves));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_COUNT);
      v.setValue(Integer.toString(slaveInfo.slaves));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(CHILDVM_SYSPROP_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(CHILDVM_SYSPROP_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
View Full Code Here

        java.setFork(true);
        java.setDir(launchDirectory);

        for (final Map.Entry<String, String> entry : this.factory.environment().entrySet()) {
            final Variable v = new Variable();
            v.setKey(entry.getKey());
            v.setValue(entry.getValue());
            java.addEnv(v);
        }
        // TODO add isDebugable to the logger and log only when debug is needed
        this.logger.debug("java classpath  : "
                + this.project.getReference(MAVEN_CLASSPATH));
        if (this.factory.environment().size() > 0) {
            this.logger.debug("environment     :");
            for (final Map.Entry<String, String> entry : this.factory.environment().entrySet()) {
                this.logger.debug("\t\t" + entry.getKey() + " => "
                        + entry.getValue());
            }
        }

        for (final String arg : factory.switches.list) {
            java.createArg().setValue(arg);
        }
        for (final String arg : args) {
            java.createArg().setValue(arg);
        }

        java.createJvmarg().setValue("-cp");
        java.createJvmarg()
                .setPath((Path) this.project.getReference(MAVEN_CLASSPATH));

        if (!factory.jvmArgs.matches("(-client|-server)")) {
          java.createJvmarg().setValue("-client")
        }
       
        if (!factory.jvmArgs.matches("-Xmx\\d+m")) {
          java.createJvmarg().setValue(DEFAULT_XMX)
        }
       
        for (String arg : factory.jvmArgs.list) {
          java.createJvmarg().setValue(arg)
        }
       
        // hack to avoid jruby-core in bootclassloader where as the dependent jars are in system classloader
        if (this.factory.jrubyJar != null && this.factory.jrubyJar.equals(this.factory.jrubyStdlibJar)){
            java.createJvmarg().setValue("-Xbootclasspath/a:"
                + this.factory.jrubyJar.getAbsolutePath());
        }
        if ( this.factory.jrubyJar  == null && System.getProperty( "jruby.home" ) != null ){
            final Variable v = new Variable();
            v.setKey( "jruby.home" );
            v.setValue( System.getProperty( "jruby.home" ) );
            java.addSysproperty( v );
            File lib =  System.getProperty("jruby.lib") != null ? new File( System.getProperty("jruby.lib") ) :
                new File( System.getProperty("jruby.home"), "lib" );
            File jrubyJar = new File( lib, "jruby.jar" );
            java.createJvmarg().setValue("-Xbootclasspath/a:"
View Full Code Here

     * @param theFile The file the variable should point to
     * @return The created environment variable
     */
    protected final Variable createSysProperty(String theKey, File theFile)
    {
        Variable var = new Variable();
        var.setKey(theKey);
        var.setFile(theFile);
        return var;
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.Environment.Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.