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


Java Echo.perform方法代码示例

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


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

示例1: execute

import org.apache.tools.ant.taskdefs.Echo; //导入方法依赖的package包/类
public void execute() {
    Project project = getProject();
    String buildoptions = project.getProperty("buildoptions");
    Pattern p = Pattern.compile("\\s");
    String[] commands = p.split(buildoptions);
    for(int i=0; i<commands.length; i++){
        project.setProperty("command"+i,commands[i]);
        Echo echo = (Echo) project.createTask("echo");
        echo.setMessage("command"+i+": "+commands[i]);
        echo.perform(); 	
    }
    project.setProperty("numberofcommands",""+commands.length);
}
 
开发者ID:webdsl,项目名称:webdsl,代码行数:14,代码来源:TaskBuildOptions.java

示例2: appendDeliveryList

import org.apache.tools.ant.taskdefs.Echo; //导入方法依赖的package包/类
private void appendDeliveryList(String msg) {
    Echo echo = (Echo) getProject().createTask("echo");
    echo.setOwningTarget(getOwningTarget());
    echo.init();
    echo.setFile(deliveryList);
    echo.setMessage(msg + "\n");
    echo.setAppend(true);
    echo.perform();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:10,代码来源:IvyDeliver.java

示例3: processReferencesAndOutput

import org.apache.tools.ant.taskdefs.Echo; //导入方法依赖的package包/类
/**
 * Processes a list of references, check references names and output to a file if requested.
 *
 * @param refList The list of references to process
 */
protected void processReferencesAndOutput(List<Ref> refList) {
        List<String> refNames = new ArrayList<String>(refList.size());

        for (Ref ref : refList) {
                refNames.add(GitTaskUtils.sanitizeRefName(ref.getName()));
        }

        if (!namesToCheck.isEmpty()) {
                if (!refNames.containsAll(namesToCheck)) {
                        List<String> namesCopy = new ArrayList<String>(namesToCheck);
                        namesCopy.removeAll(refNames);

                        throw new GitBuildException(String.format(MISSING_REFS_TEMPLATE, namesCopy.toString()));
                }
        }

        if (!GitTaskUtils.isNullOrBlankString(outputFilename)) {
                FileUtils fileUtils = FileUtils.getFileUtils();

                Echo echo = new Echo();
                echo.setProject(getProject());
                echo.setFile(fileUtils.resolveFile(getProject().getBaseDir(), outputFilename));

                for (int i = 0; i < refNames.size(); i++) {
                        String refName = refNames.get(i);
                        echo.addText(String.format(REF_NAME_TEMPLATE, refName));
                }

                echo.perform();
        }
}
 
开发者ID:rimerosolutions,项目名称:ant-git-tasks,代码行数:37,代码来源:TagListTask.java

示例4: execute

import org.apache.tools.ant.taskdefs.Echo; //导入方法依赖的package包/类
public void execute() {
    Project project = getProject();

    String currentdir = project.getProperty("currentdir");
    String generatedir = project.getProperty("generate-dir");
    String webcontentdir = project.getProperty("webcontentdir");

    StringBuilder classpathFile = new StringBuilder();
    classpathFile.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
    classpathFile.append("<classpath>\n");
    classpathFile.append("\t<classpathentry kind=\"src\" path=\".servletapp/src-template\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"src\" path=\".servletapp/src-generated\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"src\" path=\"nativejava\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"con\" path=\"org.eclipse.jst.j2ee.internal.web.container\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"con\" path=\"org.eclipse.jst.j2ee.internal.module.container\"/>\n");
    classpathFile.append("\t<classpathentry kind=\"output\" path=\"").append(generatedir).append("/WEB-INF/classes\"/>\n"); //must use relative path here

    String filedir = webcontentdir+"/WEB-INF/lib"; //must use absolute path here
    File appdir = new File(filedir);
    Echo echo = (Echo) project.createTask("echo");
    echo.setMessage(filedir);
    echo.perform();
    File[] libfiles = appdir.listFiles();
    for (int i = 0 ; i < libfiles.length ; i ++ ) {
        if ( libfiles[i].isFile ( ) ){
            classpathFile.append("\t<classpathentry kind=\"lib\" path=\"").append(generatedir).append("/WEB-INF/lib/").append(libfiles[i].getName()).append("\"/>\n"); //must use relative path here
        }
    }
    classpathFile.append("</classpath>\n");

    try {
        //write result
        FileWriter fw = new FileWriter(currentdir+"/.classpath");
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write(classpathFile.toString());
        bw.close();
        fw.close();
    } catch (Exception e) {
        Echo ec = (Echo) project.createTask("echo");
        ec.setMessage(e.getMessage());
        ec.perform();
    }
}
 
开发者ID:webdsl,项目名称:webdsl,代码行数:45,代码来源:TaskFixClasspath.java


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