Actual method executed by phing.

@throws BuildException
514786
public function main()
    {
        if ($this->propertyName === null) {
            throw new BuildException("You must specify a value for propertyName attribute.");
        }

        if ($this->message === "") {
            throw new BuildException("You must specify a message for input task.");
        }

        if ($this->validargs !== null) {
            $accept = preg_split('/[\s,]+/', $this->validargs);

            // is it a boolean (yes/no) inputrequest?
            $yesno = false;
            if (count($accept) == 2) {
                $yesno = true;
                foreach ($accept as $ans) {
                    if (!StringHelper::isBoolean($ans)) {
                        $yesno = false;
                        break;
                    }
                }
            }
            if ($yesno) {
                $request = new YesNoInputRequest($this->message, $accept);
            } else {
                $request = new MultipleChoiceInputRequest($this->message, $accept);
            }
        } else {
            $request = new InputRequest($this->message);
        }

        // default default is curr prop value
        $request->setDefaultValue($this->project->getProperty($this->propertyName));
        $request->setPromptChar($this->promptChar);
        $request->setHidden($this->hidden);

        // unless overridden...
        if ($this->defaultValue !== null) {
            $request->setDefaultValue($this->defaultValue);
        }

        $this->project->getInputHandler()->handleInput($request);

        $value = $request->getInput();

        if ($value !== null) {
            $this->project->setUserProperty($this->propertyName, $value);
        }
    }
915316
public function main()
    {
        $failCount = 0;
        $taskNo = 0;
        if (count($this->taskList) === 0) {
            throw new BuildException('No tasks specified for <relentless>.');
        }
        $this->log('Relentlessly executing: ' . $this->getDescription());
        foreach ($this->taskList as $t) {
            $taskNo++;
            $desc = $t->getDescription();
            if ($desc === null) {
                $desc = 'task ' . $taskNo;
            }
            if (!$this->terse) {
                $this->log('Executing: ' . $desc);
            }
            try {
                $t->perform();
            } catch (BuildException $x) {
                $this->log('Task ' . $desc . ' failed: ' . $x->getMessage());
                $failCount++;
            }
        }
        if ($failCount > 0) {
            throw new BuildException(
                'Relentless execution: ' . $failCount . ' of ' . count($this->taskList) . ' tasks failed.'
            );
        }

        $this->log('All tasks completed successfully.');
    }
9975
public function execute()
    {
        if (!$this->isBucketAvailable()) {
            if (!$this->getCreateBuckets()) {
                throw new BuildException('Bucket doesn\'t exist and createBuckets not specified');
            }

            if (!$this->createBucket()) {
                throw new BuildException('Bucket cannot be created');
            }
        }

        // Filesets take precedence
        if (!empty($this->_filesets)) {
            $objects = [];

            foreach ($this->_filesets as $fs) {
                if (!($fs instanceof FileSet)) {
                    continue;
                }

                $ds = $fs->getDirectoryScanner($this->getProject());
                $objects = array_merge($objects, $ds->getIncludedFiles());
            }

            $fromDir = $fs->getDir($this->getProject())->getAbsolutePath();

            if ($this->_fileNameOnly) {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(basename($object), $fromDir . DIRECTORY_SEPARATOR . $object);
                }
            } else {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(
                        str_replace('\\', '/', $object),
                        $fromDir . DIRECTORY_SEPARATOR . $object
                    );
                }
            }

            return;
        }

        $this->saveObject($this->getObject(), $this->getSource());
    }
163564
public function main()
    {
        switch ($this->getAction()) {
            case "start":
                $this->start();
                break;
            case "stop":
                $this->stop();
                break;
            case "lap":
                $this->lap();
                break;
            default:
                throw new BuildException('action should be one of start, stop, lap.');
        }
    }
1234381
public function main()
    {
        if (isset($this->schema) && !file_exists($this->schema->getPath())) {
            throw new BuildException("Schema file not found: " . $this->schema->getPath());
        }
        if (!isset($this->file) and count($this->filesets) == 0) {
            throw new BuildException("Missing either a nested fileset or attribute 'file' set");
        }

        set_error_handler([$this, 'errorHandler']);
        if ($this->file instanceof PhingFile) {
            $this->lint($this->file->getPath());
        } else { // process filesets
            $project = $this->getProject();
            foreach ($this->filesets as $fs) {
                $ds = $fs->getDirectoryScanner($project);
                $files = $ds->getIncludedFiles();
                $dir = $fs->getDir($this->project)->getPath();
                foreach ($files as $file) {
                    $this->lint($dir . DIRECTORY_SEPARATOR . $file);
                }
            }
        }
        restore_error_handler();
    }
581501
@Override
    public void execute() throws BuildException {
        logger = new DITAOTAntLogger(getProject());
        final MessageBean msgBean = MessageUtils.getMessage(id, readParamValues());
        if (msgBean != null) {
            final String type = msgBean.getType();
            if (ERROR.equals(type)) {
                logger.error(msgBean.toString());
            } else if (WARN.equals(type)) {
                logger.warn(msgBean.toString());
            } else if (INFO.equals(type)) {
                logger.info(msgBean.toString());
            } else if (DEBUG.equals(type)) {
                logger.debug(msgBean.toString());
            }
        }
    }
535461
public function main()
    {
        if ($this->property === '') {
            throw new BuildException('no property specified');
        }
        if ($this->destDir === null) {
            $this->destDir = $this->getProject()->resolveFile('.');
        }
        $fu = new FileUtils;
        $tmpFile = $fu->createTempFile(
            $this->prefix,
            $this->suffix,
            $this->destDir,
            $this->deleteOnExit,
            $this->createFile
        );
        $this->getProject()->setNewProperty($this->property, (string) $tmpFile);
    }
262720
public function main()
    {
        if (!isset($this->url)) {
            throw new BuildException("Required attribute 'url' is missing");
        }

        try {
            $this->processResponse($this->createRequest()->send());
        } catch (HTTP_Request2_MessageException $e) {
            throw new BuildException($e);
        }
    }
1258862
public void execute() throws BuildException
   {
      try
      {
         if (isLocal())
         {
            if (!isCommandAvailable("local-list"))
               throw new BuildException("Unable to ping " + getHost() + ":" + getPort());
         }
         else
         {
            if (!isCommandAvailable("remote-list"))
               throw new BuildException("Unable to ping " + getHost() + ":" + getPort());
         }
      }
      catch (Throwable t)
      {
         throw new BuildException("Unable to ping " + getHost() + ":" + getPort() + " (" + t.getMessage() + ")", t);
      }
   }
926495
public function main()
    {
        if (empty($this->file)) {
            throw new BuildException("Attribute 'file' required", $this->getLocation());
        }

        if (empty($this->property)) {
            throw new BuildException("Attribute 'property' required", $this->getLocation());
        }
        if ($this->quiet && $this->failOnError) {
            throw new BuildException("quiet and failonerror cannot both be set to true");
        }

        try {
            if (is_string($this->file)) {
                $this->file = new PhingFile($this->file);
            }
            if (!$this->file->exists()) {
                $message = (string) $this->file . ' doesn\'t exist';
                if ($this->failOnError) {
                    throw new BuildException($message);
                } else {
                    $this->log($message, $this->quiet ? Project::MSG_WARN : Project::MSG_ERR);
                    return;
                }
            }

            $this->log("loading " . (string) $this->file . " into property " . $this->property, Project::MSG_VERBOSE);
            // read file (through filterchains)
            $contents = "";

            if ($this->file->length() > 0) {
                $reader = FileUtils::getChainedReader(new FileReader($this->file), $this->filterChains, $this->project);
                while (-1 !== ($buffer = $reader->read())) {
                    $contents .= $buffer;
                }
                $reader->close();
            } else {
                $this->log(
                    "Do not set property " . $this->property . " as its length is 0.",
                    $this->quiet ? Project::MSG_VERBOSE : Project::MSG_INFO
                );
            }

            // publish as property
            if ($contents !== '') {
                $this->project->setNewProperty($this->property, $contents);
                $this->log("loaded " . strlen($contents) . " characters", Project::MSG_VERBOSE);
                $this->log($this->property . " := " . $contents, Project::MSG_DEBUG);
            }
        } catch (IOException $ioe) {
            $message = "Unable to load resource: " . $ioe->getMessage();
            if ($this->failOnError) {
                throw new BuildException($message, $ioe, $this->getLocation());
            } else {
                $this->log($message, $this->quiet ? Project::MSG_VERBOSE : Project::MSG_ERR);
            }
        } catch (BuildException $be) {
            if ($this->failOnError) {
                throw $be;
            } else {
                $this->log($be->getMessage(), $this->quiet ? Project::MSG_VERBOSE : Project::MSG_ERR);
            }
        }
    }
733650
public function main()
    {
        // check supplied attributes
        $this->checkReleasetype();
        $this->checkFile();
        $this->checkProperty();

        // read file (or use fallback value if file is empty)
        try {
            if ($this->propFile) {
                $properties = $this->loadProperties();
                $content = $properties->getProperty($this->property);
            } else {
                $content = trim($this->file->contents());
            }
            if (empty($content)) {
                $content = $this->startingVersion;
            }
        } catch (Exception $e) {
            throw new BuildException($e);
        }

        // get new version
        $this->log("Old version: $content", Project::MSG_INFO);
        $newVersion = $this->getVersion($content);
        $this->log("New version: $newVersion", Project::MSG_INFO);

        if ($this->propFile) {
            $properties->put($this->property, $newVersion);
            try {
                $header = "Build Number for PHING. Do not edit!";
                $properties->store($this->file, $header);
            } catch (IOException $ioe) {
                $message = "Error while writing " . $this->file;
                throw new BuildException($message, $ioe);
            }
        } else {
            // write new Version to file
            file_put_contents($this->file, $newVersion . $this->getProject()->getProperty('line.separator'));
        }

        //Finally set the property
        $this->getProject()->setNewProperty($this->property, $newVersion);
    }
20685
public function init()
    {
        $this->callee = $this->project->createTask("phing");
        $this->callee->setOwningTarget($this->getOwningTarget());
        $this->callee->setTaskName($this->getTaskName());
        $this->callee->setHaltOnFailure(true);
        $this->callee->setLocation($this->getLocation());
        $this->callee->init();
    }
878791
public void execute() throws BuildException {
        log.debug("execute()");

        command = command.trim();

        if (srcFile == null && command.length() == 0 && filesets.isEmpty()) {
            throw new BuildException("Source file does not exist!", getLocation());
        }

        if (srcFile != null && !srcFile.exists()) {
            throw new BuildException("Source file does not exist!", getLocation());
        }

        try {
            PrintStream out = System.out;
            try {
                if (output != null) {
                    log.verbose("Opening PrintStream to output file " + output);
                    out = new PrintStream(
                            new BufferedOutputStream(
                                    new FileOutputStream(output.getAbsolutePath(), append)));
                }

                // if there are no groovy statements between the enclosing Groovy tags
                // then read groovy statements in from a text file using the src attribute
                if (command == null || command.trim().length() == 0) {
                    createClasspath().add(new Path(getProject(), srcFile.getParentFile().getCanonicalPath()));
                    command = getText(new BufferedReader(new FileReader(srcFile)));
                }

                if (command != null) {
                    execGroovy(command, out);
                } else {
                    throw new BuildException("Source file does not exist!", getLocation());
                }

            } finally {
                if (out != null && out != System.out) {
                    out.close();
                }
            }
        } catch (IOException e) {
            throw new BuildException(e, getLocation());
        }

        log.verbose("statements executed successfully");
    }
496723
private function chmodFile(PhingFile $file, $mode)
    {
        if (!$file->exists()) {
            throw new BuildException("The file " . $file->__toString() . " does not exist");
        }

        try {
            $file->setMode($mode);
            if ($this->verbose) {
                $this->log("Changed file mode on '" . $file->__toString() . "' to " . vsprintf("%o", [$mode]));
            }
        } catch (Exception $e) {
            if ($this->failonerror) {
                throw $e;
            } else {
                $this->log($e->getMessage(), $this->quiet ? Project::MSG_VERBOSE : Project::MSG_WARN);
            }
        }
    }
1375034
public function main()
    {
        if ($this->remove) {
            if ($this->name === null || $this->name === "") {
                throw new BuildException("The 'name' attribute is required with 'unset'.");
            }
            $this->removeProperty($this->name);
            return;
        }
        if ($this->file === null) {
            // check for the required name attribute
            if ($this->name === null || $this->name === '') {
                throw new BuildException("The 'name' attribute is required.");
            }

            // adjust the property value if necessary -- is this necessary?
            // Doesn't Ant do this automatically?
            $this->value = $this->getProject()->replaceProperties($this->value);

            // set the property
            $this->forceProperty($this->name, $this->value);
        } else {
            if (!$this->file->exists()) {
                throw new BuildException($this->file->getAbsolutePath() . " does not exists.");
            }
            $this->loadFile($this->file);
        }
    }
793780
public void execute() throws BuildException {
        checkParameters();
        resetFileLists();
        loadRegisteredScriptExtensions();

        if (javac != null) jointCompilation = true;

        // scan source directories and dest directory to build up
        // compile lists
        String[] list = src.list();
        for (String filename : list) {
            File file = getProject().resolveFile(filename);
            if (!file.exists()) {
                throw new BuildException("srcdir \"" + file.getPath() + "\" does not exist!", getLocation());
            }
            DirectoryScanner ds = this.getDirectoryScanner(file);
            String[] files = ds.getIncludedFiles();
            scanDir(file, destDir != null ? destDir : file, files);
        }

        compile();
        if (updatedProperty != null
                && taskSuccess
                && compileList.length != 0) {
            getProject().setNewProperty(updatedProperty, "true");
        }
    }
958399
public function setFile(PhingFile $file)
    {
        // non-existing files are not allowed
        if (!$file->exists()) {
            throw new BuildException("File " . $file . " does not exist.");
        }

        $reader = null;
        try {
            if ($this->encoding == null) {
                $reader = new BufferedReader(new FileReader($file));
            } else {
                $reader = new BufferedReader(
                    new InputStreamReader(new FileInputStream($file))
                );
            }
            $this->value = $reader->read();
        } catch (IOException $ex) {
            $reader->close();
            throw new BuildException($ex);
        }
        $reader->close();
    }