本文整理汇总了Java中org.apache.tools.ant.ProjectComponent类的典型用法代码示例。如果您正苦于以下问题:Java ProjectComponent类的具体用法?Java ProjectComponent怎么用?Java ProjectComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectComponent类属于org.apache.tools.ant包,在下文中一共展示了ProjectComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFacade
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* Returns a facade which is associated with the supplied ant project.
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*
* @return A new facade. Not <code>null</code>.
*/
private static final SvnFacade getFacade( ProjectComponent component ) {
// in general I would prefer to use the key by it's own but the code might
// become invalid if the ant svn tasks are used in parallel for the same
// project (which is unlikely to happen), so here we're providing the necessary
// distinction.
if( component instanceof SvnCommand ) {
// if a command is passed we're using the task for reference
component = ((SvnCommand) component).getTask();
}
String key = KEY_FACADE + component.hashCode();
SvnFacade result = (SvnFacade) component.getProject().getReference( key );
if( result == null ) {
result = new SvnFacade();
component.getProject().addReference( key, result );
}
return result;
}
示例2: getRefidSetting
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
private static final SvnSetting getRefidSetting( ProjectComponent component ) {
SvnFacade facade = getFacade( component );
if( facade.refidsetting == null ) {
if( facade.refid != null ) {
Object obj = facade.refid.getReferencedObject( component.getProject() );
if( obj == null ) {
throw new BuildException( "The refid attribute value '" + facade.refid + "' doesn't refer to any object." );
}
if( !(obj instanceof SvnSetting) ) {
throw new BuildException( "The refid attribute value '" + facade.refid + "' has an unknown type [" + obj.getClass().getName() + "]." );
}
facade.refidsetting = (SvnSetting) obj;
} else {
facade.refidsetting = facade.setting;
}
}
return facade.refidsetting;
}
示例3: getDefaultProperties
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
protected Properties getDefaultProperties(ProjectComponent task) {
URL url = IvySettings.getDefaultPropertiesURL();
// this is copy of loadURL code from ant Property task (not available in 1.5.1)
Properties props = new Properties();
task.log("Loading " + url, Project.MSG_VERBOSE);
try {
InputStream is = url.openStream();
try {
props.load(is);
} finally {
if (is != null) {
is.close();
}
}
} catch (IOException ex) {
throw new BuildException(ex);
}
return props;
}
示例4: run
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected boolean run(Commandline cmd, ProjectComponent log)
throws BuildException {
ExecuteJava ej = new ExecuteJava();
Class<?> c = getN2aClass();
if (c == null) {
throw new BuildException(
"Couldn't load Kaffe's Native2Ascii class");
}
cmd.setExecutable(c.getName());
ej.setJavaCommand(cmd);
ej.execute(log.getProject());
// otherwise ExecuteJava has thrown an exception
return true;
}
示例5: getAdapter
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* Creates the Native2AsciiAdapter based on the user choice and
* potentially the VM vendor.
*
* @param choice the user choice (if any).
* @param log a ProjectComponent instance used to access Ant's
* logging system.
* @param classpath the classpath to use when looking up an
* adapter class
* @return The adapter to use.
* @throws BuildException if there was a problem.
* @since Ant 1.8.0
*/
public static Native2AsciiAdapter getAdapter(String choice,
ProjectComponent log,
Path classpath)
throws BuildException {
if ((shouldUseKaffee() && choice == null)
|| KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
return new KaffeNative2Ascii();
} else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
return new SunNative2Ascii();
} else if (BuiltinNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
return new BuiltinNative2Ascii();
} else if (choice != null) {
return resolveClassName(choice,
// Memory leak in line below
log.getProject()
.createClassLoader(classpath));
}
return new BuiltinNative2Ascii();
}
示例6: getConflictResolution
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* Returns the <code>ConflictResolution</code> specification used to handle conflicts.
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*
* @return The <code>ConflictResolution</code> specification used to handle conflicts.
*/
private static final ConflictResolution getConflictResolution( ProjectComponent component ) {
ConflictResolution result = getSetting( component ).getConflictResolution();
if( result == null ) {
result = getRefidSetting( component ).getConflictResolution();
}
return result;
}
示例7: getUsername
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getUsername()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final String getUsername( ProjectComponent component ) {
String result = getSetting( component ).getUsername();
if( result == null ) {
result = getRefidSetting( component ).getUsername();
}
return result;
}
示例8: getPassword
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getPassword()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final String getPassword( ProjectComponent component ) {
String result = getSetting( component ).getPassword();
if( result == null ) {
result = getRefidSetting( component ).getPassword();
}
return result;
}
示例9: getSSLPassword
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getSSLPassword()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final String getSSLPassword( ProjectComponent component ) {
String result = getSetting( component ).getSSLPassword();
if( result == null ) {
result = getRefidSetting( component ).getSSLPassword();
}
return result;
}
示例10: getSSLClientCertPath
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getSSLClientCertPath()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final File getSSLClientCertPath( ProjectComponent component ) {
File result = getSetting( component ).getSSLClientCertPath();
if( result == null ) {
result = getRefidSetting( component ).getSSLClientCertPath();
}
return result;
}
示例11: getSSHPort
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getSSHPort()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final Integer getSSHPort( ProjectComponent component ) {
Integer result = getSetting( component ).getSSHPort();
if( result == null ) {
result = getRefidSetting( component ).getSSHPort();
}
return result;
}
示例12: getSSHPassphrase
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getSSHPassphrase()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final String getSSHPassphrase( ProjectComponent component ) {
String result = getSetting( component ).getSSHPassphrase();
if( result == null ) {
result = getRefidSetting( component ).getSSHPassphrase();
}
return result;
}
示例13: getSSHKeyPath
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getSSHKeyPath()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final File getSSHKeyPath( ProjectComponent component ) {
File result = getSetting( component ).getSSHKeyPath();
if( result == null ) {
result = getRefidSetting( component ).getSSHKeyPath();
}
return result;
}
示例14: getConfigDirectory
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getConfigDirectory()
*/
private static final File getConfigDirectory( ProjectComponent component ) {
File result = getSetting( component ).getConfigDirectory();
if( result == null ) {
result = getRefidSetting( component ).getConfigDirectory();
}
return result;
}
示例15: getCertReject
import org.apache.tools.ant.ProjectComponent; //导入依赖的package包/类
/**
* @see SvnSetting#getCertReject()
*
* @param component The ant project component used to access the facade. Not <code>null</code>.
*/
private static final Boolean getCertReject( ProjectComponent component ) {
Boolean result = getSetting( component ).getCertReject();
if( result == null ) {
result = getRefidSetting( component ).getCertReject();
}
return result;
}