本文整理汇总了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);
}
}
示例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 );
}
示例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 );
}
示例4: addConfiguredProperty
import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
public void addConfiguredProperty(Environment.Variable property) {
properties.put(property.getKey(), property.getValue());
}
示例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);
}
示例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);
}
}
示例7: addEnv
import org.apache.tools.ant.types.Environment; //导入方法依赖的package包/类
public void addEnv(Environment.Variable var) {
this.env.add(var);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}