当前位置: 首页>>代码示例>>Java>>正文


Java Environment.Variable方法代码示例

本文整理汇总了Java中org.apache.tools.ant.types.Environment.Variable方法的典型用法代码示例。如果您正苦于以下问题:Java Environment.Variable方法的具体用法?Java Environment.Variable怎么用?Java Environment.Variable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.types.Environment的用法示例。


在下文中一共展示了Environment.Variable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCommonOptions

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * these are options common to signing and verifying
 * @param cmd  command to configure
 */
protected void setCommonOptions(final ExecTask cmd) {
    if (maxMemory != null) {
        addValue(cmd, "-J-Xmx" + maxMemory);
    }

    if (verbose) {
        addValue(cmd, "-verbose");
    }

    if (strict) {
        addValue(cmd, "-strict");
    }

    //now patch in all system properties
    for (Environment.Variable variable : sysProperties.getVariablesVector()) {
        declareSysProperty(cmd, variable);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:23,代码来源:AbstractJarSignerTask.java

示例2: addSystemProperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Adds string type system property to Ant Java task.
 * 
 * @param java Ant Java task
 * @param propertyName system property name
 * @param propertyValue system property value
 */
protected void addSystemProperty( Java java, String propertyName, String propertyValue )
{
    Environment.Variable sysPropPlayHome = new Environment.Variable();
    sysPropPlayHome.setKey( propertyName );
    sysPropPlayHome.setValue( propertyValue );
    java.addSysproperty( sysPropPlayHome );
}
 
开发者ID:sbtrun-maven-plugin,项目名称:sbtrun-maven-plugin,代码行数:15,代码来源:AbstractAntJavaBasedMojo.java

示例3: addSystemProperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
protected void addSystemProperty( Java java, String propertyName, String propertyValue )
{
    Environment.Variable sysPropPlayHome = new Environment.Variable();
    sysPropPlayHome.setKey( propertyName );
    sysPropPlayHome.setValue( propertyValue );
    java.addSysproperty( sysPropPlayHome );
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:8,代码来源:AbstractAntJavaBasedPlayMojo.java

示例4: addConfiguredProperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
public void addConfiguredProperty(Environment.Variable property) {
    properties.put(property.getKey(), property.getValue());
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:4,代码来源:ExporterTask.java

示例5: addEnv

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Add an environment variable to the launched process.
 */
public void addEnv(Environment.Variable var) {
    compilerDef.addEnv(var);
    linkerDef.addEnv(var);
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:8,代码来源:CCTask.java

示例6: buildWebsphereJar

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Helper method invoked by execute() for each websphere jar to be built.
 * Encapsulates the logic of constructing a java task for calling
 * websphere.ejbdeploy and executing it.
 *
 * @param sourceJar java.io.File representing the source (EJB1.1) jarfile.
 * @param destJar java.io.File representing the destination, websphere
 *      jarfile.
 */
private void buildWebsphereJar(File sourceJar, File destJar) {
    try {
        if (ejbdeploy) {
            Java javaTask = new Java(getTask());
            // Set the JvmArgs
            javaTask.createJvmarg().setValue("-Xms64m");
            javaTask.createJvmarg().setValue("-Xmx128m");

            // Set the Environment variable
            Environment.Variable var = new Environment.Variable();

            var.setKey("websphere.lib.dir");
            File libdir = new File(websphereHome, "lib");
            var.setValue(libdir.getAbsolutePath());
            javaTask.addSysproperty(var);

            // Set the working directory
            javaTask.setDir(websphereHome);

            // Set the Java class name
            javaTask.setTaskName("ejbdeploy");
            javaTask.setClassname("com.ibm.etools.ejbdeploy.EJBDeploy");

            javaTask.createArg().setValue(sourceJar.getPath());
            javaTask.createArg().setValue(tempdir);
            javaTask.createArg().setValue(destJar.getPath());
            javaTask.createArg().setLine(getOptions());
            if (getCombinedClasspath() != null
                && getCombinedClasspath().toString().length() > 0) {
                javaTask.createArg().setValue("-cp");
                javaTask.createArg().setValue(getCombinedClasspath().toString());
            }

            Path classpath = wasClasspath;

            if (classpath == null) {
                classpath = getCombinedClasspath();
            }

            javaTask.setFork(true);
            if (classpath != null) {
                javaTask.setClasspath(classpath);
            }

            log("Calling websphere.ejbdeploy for " + sourceJar.toString(),
                Project.MSG_VERBOSE);

            javaTask.execute();
        }
    } catch (Exception e) {
        // Have to catch this because of the semantics of calling main()
        throw new BuildException(
            "Exception while calling ejbdeploy. Details: " + e.toString(),
            e);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:66,代码来源:WebsphereDeploymentTool.java

示例7: addEnv

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
public void addEnv(Environment.Variable var) {
	this.env.add(var);
}
 
开发者ID:kwhat,项目名称:jnitasks,代码行数:4,代码来源:PkgConfigTask.java

示例8: addConfiguredSysproperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Adds a system property that tests can access.
 * This might be useful to transfer Ant properties to the
 * testcases when JVM forking is not enabled.
 *
 * @param sysp new environment variable to add
 * @since Ant 1.6
 */
public void addConfiguredSysproperty(final Environment.Variable sysp) {
    // get a build exception if there is a missing key or value
    // see bugzilla report 21684
    final String testString = sysp.getContent();
    getProject().log("sysproperty added : " + testString, Project.MSG_DEBUG);
    getCommandline().addSysproperty(sysp);
}
 
开发者ID:apache,项目名称:ant,代码行数:16,代码来源:JUnitTask.java

示例9: addEnv

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Add an environment variable.
 *
 * @param var new environment variable
 */
public void addEnv(final Environment.Variable var) {
   env.addVariable(var);
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:9,代码来源:DebugDef.java

示例10: addEnv

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Add an environment variable to the launched process.
 *
 * @param var new environment variable.
 */
public void addEnv(Environment.Variable var) {
    env.addVariable(var);
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:ExecTask.java

示例11: addSysproperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Adds a system property that tests can access.
 * This might be useful to transfer Ant properties to the
 * testcases when JVM forking is not enabled.
 *
 * @since Ant 1.3
 * @deprecated since Ant 1.6
 * @param sysp environment variable to add
 */
@Deprecated
public void addSysproperty(final Environment.Variable sysp) {

    getCommandline().addSysproperty(sysp);
}
 
开发者ID:apache,项目名称:ant,代码行数:15,代码来源:JUnitTask.java

示例12: addEnv

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Adds an environment variable; used when forking.
 *
 * <p>Will be ignored if we are not forking a new VM.</p>
 *
 * @param var environment variable to be added
 * @since Ant 1.5
 */
public void addEnv(final Environment.Variable var) {
    env.addVariable(var);
}
 
开发者ID:apache,项目名称:ant,代码行数:12,代码来源:JUnitTask.java

示例13: addSysproperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Add a nested sysproperty element.
 * @param sysp the element to add.
 */
public void addSysproperty(Environment.Variable sysp) {
    sysprops.add(sysp);
}
 
开发者ID:apache,项目名称:ant,代码行数:8,代码来源:WeblogicDeploymentTool.java

示例14: addSysproperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 * Add a system property.
 *
 * @param sysp system property.
 */
public void addSysproperty(Environment.Variable sysp) {
    sysProperties.addVariable(sysp);
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:AbstractJarSignerTask.java

示例15: declareSysProperty

import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
/**
 *
 * @param cmd command to configure
 * @param property property to set
 * @throws BuildException if the property is not correctly defined.
 */
protected void declareSysProperty(
    ExecTask cmd, Environment.Variable property) throws BuildException {
    addValue(cmd, "-J-D" + property.getContent());
}
 
开发者ID:apache,项目名称:ant,代码行数:11,代码来源:AbstractJarSignerTask.java


注:本文中的org.apache.tools.ant.types.Environment.Variable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。