Package com.alibaba.antx.config.descriptor

Examples of com.alibaba.antx.config.descriptor.ConfigGenerate


        for (ConfigDescriptor descriptor : configDescriptors) {
            String basename = FileUtil.normalizeUnixPath(descriptor.getName() + "/../");

            for (int j = 0; j < descriptor.getGenerates().length; j++) {
                ConfigGenerate generate = descriptor.getGenerates()[j];

                // ����template/destfile
                String template = generate.getTemplate();
                String destFile = generate.getDestfile();

                if (StringUtil.isBlank(template)) {
                    logger.warn("Missing template attribute in <generate>: file=" + descriptor.getURL());

                    descriptor.removeGenerate(generate);
                    continue;
                }

                if (StringUtil.isBlank(destFile)) {
                    destFile = template;
                }

                template = FileUtil.normalizeUnixPath("./" + template);
                destFile = FileUtil.normalizeUnixPath("./" + destFile);

                generate.setTemplateBase(basename);
                generate.setTemplate(template);
                generate.setDestfile(destFile);

                // ��ֹdestfile�ظ�
                if (generateDestFiles.containsKey(destFile)) {
                    ConfigGenerate originalGenerate = (ConfigGenerate) generateDestFiles.get(destFile);

                    if (originalGenerate.getConfigDescriptor() == descriptor) {
                        logger.info("Duplicated destfile " + destFile + "\n  in " + descriptor.getURL());
                    } else {
                        logger.info("Duplicated destfile " + destFile + "\n  in  " + descriptor.getURL() + "\n  and "
                                + originalGenerate.getConfigDescriptor().getURL());
                    }

                    descriptor.removeGenerate(generate);
                    continue;
                }
View Full Code Here


     * �鿴��û����©û�����ɵ�template��
     */
    public void checkNonprocessedTemplates() {
        for (String destfile : generator.generateDestFiles.keySet()) {
            if (!processedDestfiles.contains(destfile)) {
                ConfigGenerate generate = generator.generateDestFiles.get(destfile);
                String template = generate.getTemplate();

                throw new ConfigException("Could not find template file: " + template + " for descriptor: "
                        + generate.getConfigDescriptor().getURL());
            }
        }
    }
View Full Code Here

        for (ConfigDescriptor descriptor : configDescriptors) {
            String basename = FileUtil.normalizeUnixPath(descriptor.getName() + "/../");

            for (int j = 0; j < descriptor.getGenerates().length; j++) {
                ConfigGenerate generate = descriptor.getGenerates()[j];

                // 设置template/destfile
                String template = generate.getTemplate();
                String destFile = generate.getDestfile();

                if (StringUtil.isBlank(template)) {
                    logger.warn("Missing template attribute in <generate>: file=" + descriptor.getURL());

                    descriptor.removeGenerate(generate);
                    continue;
                }

                if (StringUtil.isBlank(destFile)) {
                    destFile = template;
                }

                template = FileUtil.normalizeUnixPath("./" + template);
                destFile = FileUtil.normalizeUnixPath("./" + destFile);

                generate.setTemplateBase(basename);
                generate.setTemplate(template);
                generate.setDestfile(destFile);

                // 防止destfile重复
                if (generateDestFiles.containsKey(destFile)) {
                    ConfigGenerate originalGenerate = generateDestFiles.get(destFile);

                    if (originalGenerate.getConfigDescriptor() == descriptor) {
                        logger.info("Duplicated destfile " + destFile + "\n  in " + descriptor.getURL());
                    } else {
                        logger.info("Duplicated destfile " + destFile + "\n  in  " + descriptor.getURL() + "\n  and "
                                    + originalGenerate.getConfigDescriptor().getURL());
                    }

                    descriptor.removeGenerate(generate);
                    continue;
                }
View Full Code Here

    /** 查看有没有遗漏没有生成的template。 */
    public void checkNonprocessedTemplates() {
        for (String destfile : generator.generateDestFiles.keySet()) {
            if (!processedDestfiles.contains(destfile)) {
                ConfigGenerate generate = generator.generateDestFiles.get(destfile);
                String template = generate.getTemplate();

                throw new ConfigException("Could not find template file: " + template + " for descriptor: "
                                          + generate.getConfigDescriptor().getURL());
            }
        }
    }
View Full Code Here

     * �鿴��û����©û�����ɵ�template��
     */
    public void checkNonprocessedTemplates() {
        for (String destfile : generator.generateDestFiles.keySet()) {
            if (!processedDestfiles.contains(destfile)) {
                ConfigGenerate generate = generator.generateDestFiles.get(destfile);
                String template = generate.getTemplate();

                throw new ConfigException("Could not find template file: " + template + " for descriptor: "
                        + generate.getConfigDescriptor().getURL());
            }
        }
    }
View Full Code Here

        for (ConfigDescriptor descriptor : configDescriptors) {
            String basename = FileUtil.normalizeUnixPath(descriptor.getName() + "/../");

            for (int j = 0; j < descriptor.getGenerates().length; j++) {
                ConfigGenerate generate = descriptor.getGenerates()[j];

                // ����template/destfile
                String template = generate.getTemplate();
                String destFile = generate.getDestfile();

                if (StringUtil.isBlank(template)) {
                    logger.warn("Missing template attribute in <generate>: file=" + descriptor.getURL());

                    descriptor.removeGenerate(generate);
                    continue;
                }

                if (StringUtil.isBlank(destFile)) {
                    destFile = template;
                }

                template = FileUtil.normalizeUnixPath("./" + template);
                destFile = FileUtil.normalizeUnixPath("./" + destFile);

                generate.setTemplateBase(basename);
                generate.setTemplate(template);
                generate.setDestfile(destFile);

                // ��ֹdestfile�ظ�
                if (generateDestFiles.containsKey(destFile)) {
                    ConfigGenerate originalGenerate = (ConfigGenerate) generateDestFiles.get(destFile);

                    if (originalGenerate.getConfigDescriptor() == descriptor) {
                        logger.info("Duplicated destfile " + destFile + "\n  in " + descriptor.getURL());
                    } else {
                        logger.info("Duplicated destfile " + destFile + "\n  in  " + descriptor.getURL() + "\n  and "
                                + originalGenerate.getConfigDescriptor().getURL());
                    }

                    descriptor.removeGenerate(generate);
                    continue;
                }
View Full Code Here

TOP

Related Classes of com.alibaba.antx.config.descriptor.ConfigGenerate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.