/** * Set the project. * @param project the project that this task belongs to. */ public void setProject(Project project) { super.setProject(project); helper.setProjectComponent(this); }
/** {@inheritDoc}. */ @Override public void setProject(Project project) { super.setProject(project); fileset.setProject(project); }
private void configureTask(Task helper) { helper.setProject(getProject()); helper.setTaskName(getTaskName()); helper.setOwningTarget(getOwningTarget()); helper.init(); }
/** * Bind a task to another; use this when configuring a newly created * task to do work on behalf of another. * Project, OwningTarget, TaskName, Location and Description are all copied * * Important: this method does not call {@link Task#init()}. * If you are creating a task to delegate work to, call {@link Task#init()} * to initialize it. * * @param owner owning target * @since Ant1.7 */ public final void bindToOwner(Task owner) { setProject(owner.getProject()); setOwningTarget(owner.getOwningTarget()); setTaskName(owner.getTaskName()); setDescription(owner.getDescription()); setLocation(owner.getLocation()); setTaskType(owner.getTaskType()); } }
task.setProject(helperImpl.project);
public void setProject(Project project) { super.setProject(project); toAdd = new Path(project); }
@Override public void setProject(@Nullable Project project) { this.jsonAsProperties.setProject(project); super.setProject(project); }
/** * Method setProject. * @param project Project * @see org.apache.tools.ant.ProjectComponent#setProject(org.apache.tools.ant.Project) */ @Override public final void setProject(final Project project) { super.setProject(project); AntLog.setCurrentProject(project); AntLog.setCurrentTask(this); }
/** * Sets the project. */ @Override public void setProject(final Project project) { super.setProject(project); this.compilerDef.setProject(project); this.linkerDef.setProject(project); }
/** * Configure the given task by setting name, project root, etc. * @param srcTask source task * @param dstTask destination task */ public static void configure(final Task srcTask, final Task dstTask) { dstTask.setTaskName(srcTask.getTaskName()); dstTask.setProject(srcTask.getProject()); }
public void execute() throws BuildException { //Leave XJC2 in the publicly visible place // and then isolate XJC1 in a child class loader, // then use a MaskingClassLoader // so that the XJC2 classes in the parent class loader // won't interfere with loading XJC1 classes in a child class loader ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { ClassLoader cl = createClassLoader(); Class driver = cl.loadClass(getCoreClassName()); Task t = (Task)driver.newInstance(); t.setProject(getProject()); t.setTaskName(getTaskName()); root.configure(t); Thread.currentThread().setContextClassLoader(cl); t.execute(); } catch (UnsupportedClassVersionError e) { throw new BuildException("Requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/"); } catch (ClassNotFoundException e) { throw new BuildException(e); } catch (InstantiationException e) { throw new BuildException(e); } catch (IllegalAccessException e) { throw new BuildException(e); } catch (IOException e) { throw new BuildException(e); } finally { Thread.currentThread().setContextClassLoader(ccl); } }
t.setProject(getProject()); t.setTaskName(getTaskName()); root.configure(t); t.setProject(null); t = null; } catch (UnsupportedClassVersionError e) {
t.setProject(getProject()); t.setTaskName(getTaskName()); root.configure(t); t.setProject(null); t = null; } catch (UnsupportedClassVersionError e) {
/** * Add tasks to the Sequential to set threadlocal values for the node name and username * * @param nodeentry node entry * @param project ant Project * @param seq Sequential */ public static void addNodeContextTasks(final INodeEntry nodeentry, final Project project, final Sequential seq) { //set thread local node name final Task nodenamelocal = genSetThreadLocalRefValue(NODE_NAME_LOCAL_REF_ID, nodeentry.getNodename()); nodenamelocal.setProject(project); seq.addTask(nodenamelocal); if (null != nodeentry.extractUserName()) { //set thread local username final Task userlocal = genSetThreadLocalRefValue(NODE_USER_LOCAL_REF_ID, nodeentry.extractUserName()); userlocal.setProject(project); seq.addTask(userlocal); } }
@Override public void setProject(Project project) { super.setProject(project); this.resources.setProject(project); this.classpath = new org.apache.tools.ant.types.Path(getProject()); this.bootclasspath = new org.apache.tools.ant.types.Path(getProject()); }
@Override public void setProject(Project project) { super.setProject(project); this.resources.setProject(project); this.classpath = new org.apache.tools.ant.types.Path(getProject()); this.bootclasspath = new org.apache.tools.ant.types.Path(getProject()); }
@Override public Object handleCall(Object ctx, Object... args) { try { // see ComponentHelper.createComponent(UnknownElement, String, String) IntrospectionHelper helper = IntrospectionHelper.getHelper(_taskClass); Task taskInstance = (Task) _taskClass.newInstance(); taskInstance.setProject(Aardvark.getProject()); taskInstance.setTaskName(_taskName); taskInstance.init(); for (int i = 0; i < args.length; i++) { if (args[i] != null) { _taskMethods[i].invoke(taskInstance, args[i], helper); } } taskInstance.execute(); return taskInstance; } catch (IllegalAccessException e) { // should never happen throw GosuExceptionUtil.forceThrow(e); } catch (InstantiationException e) { // should not happen - we know we can instantiate the task throw GosuExceptionUtil.forceThrow(e); } } }