Package org.apache.easyant.core.descriptor

Examples of org.apache.easyant.core.descriptor.PluginDescriptor


                    getOwningTarget().addTask(importTask);
                    initTask(importTask).execute();
                }
            }
            for (Iterator<?> iterator = md.getPlugins().iterator(); iterator.hasNext();) {
                PluginDescriptor plugin = (PluginDescriptor) iterator.next();

                if (canInherit(plugin, currentModule)) {
                    Import importTask = new Import();
                    importTask.setMrid(plugin.getMrid());
                    importTask.setMode(plugin.getMode());
                    importTask.setAs(plugin.getAs());
                    importTask.setMandatory(plugin.isMandatory());
                    importTask.setBuildConfigurations(plugin.getBuildConfigurations());
                    importTask.setDependencies(plugin.getDependencies());
                    importTask.setConflicts(plugin.getConflicts());
                    importTask.setExcludes(plugin.getExcludes());
                    importTask.setTaskType("antlib:org.apache.easyant:import");
                    getOwningTarget().addTask(importTask);
                    initTask(importTask).execute();
                }
            }
View Full Code Here


                if (attributes.getValue("file") != null && !attributes.getValue("file").equals("")) {
                    easyAntConfiguration.setEasyantIvySettingsFile(attributes.getValue("file"));
                }
            }
            if ("easyant-config/system-plugins/plugin".equals(getContext())) {
                PluginDescriptor pluginDescriptor = new PluginDescriptor();
                String org = attributes.getValue("org") != null ? attributes.getValue("org") : attributes
                        .getValue("organisation");
                pluginDescriptor.setOrganisation(org);
                pluginDescriptor.setModule(attributes.getValue("module"));
                String rev = attributes.getValue("rev") != null ? attributes.getValue("rev") : attributes
                        .getValue("revision");
                pluginDescriptor.setRevision(rev);
                pluginDescriptor.setMrid(attributes.getValue("mrid"));
                pluginDescriptor.setAs(attributes.getValue("as"));
                boolean mandatory = false;
                if (attributes.getValue("mandatory") != null && "true".equals(attributes.getValue("mandatory"))) {
                    mandatory = true;
                }
                pluginDescriptor.setMandatory(mandatory);
                if (attributes.getValue("inherit-scope") != null) {
                    InheritableScope scope = InheritableScope.valueOf(attributes.getValue("inherit-scope")
                            .toUpperCase());
                    pluginDescriptor.setInheritScope(scope);
                }
                if (attributes.getValue("inheritable") != null && "true".equals(attributes.getValue("inheritable"))) {
                    pluginDescriptor.setInheritable(true);
                }
                pluginDescriptor.setMode(attributes.getValue("mode"));
                easyAntConfiguration.addSystemPlugin(pluginDescriptor);
            }
            if ("easyant-config/properties/property".equals(getContext())) {
                if (attributes.getValue("file") != null || attributes.getValue("url") != null) {
                    Properties properties = new Properties();
View Full Code Here

         * @param attributes
         *            reprensents the plugins attributes
         */
        protected void pluginStarted(Attributes attributes) {
            easyAntState = EasyAntState.PLUGIN;
            PluginDescriptor plugin = handleCommonPluginDescriptorAttributes(attributes, PluginType.PLUGIN);
            // plugin specific attribute
            boolean mandatory = false;
            String mandatoryValue = getSettings().substitute(attributes.getValue("mandatory"));
            if (mandatoryValue != null && "true".equals(mandatoryValue)) {
                mandatory = true;
            }
            plugin.setMandatory(mandatory);
            handleInheritedScopeAttribute(attributes, plugin);

            currentPluginDescriptor = plugin;
            easyAntModuleDescriptor.addPlugin(plugin);
            handlePropertyAsAttribute(attributes, Arrays.asList(PLUGIN_REGULAR_ATTRIBUTES), plugin,
                    plugin.getBuildConfigurations());
        }
View Full Code Here

         * @param attributes
         *            reprensents the easyant attributes
         */
        protected void eaBuildStarted(Attributes attributes) {
            easyAntState = EasyAntState.BUILDTYPE;
            PluginDescriptor buildtype = handleCommonPluginDescriptorAttributes(attributes, PluginType.BUILDTYPE);
            // a build type cannot be skipped
            buildtype.setMandatory(true);
            easyAntModuleDescriptor.setBuildType(buildtype);
            handlePropertyAsAttribute(attributes, Arrays.asList(PLUGIN_REGULAR_ATTRIBUTES), buildtype,
                    buildtype.getBuildConfigurations());
        }
View Full Code Here

            handlePropertyAsAttribute(attributes, Arrays.asList(PLUGIN_REGULAR_ATTRIBUTES), buildtype,
                    buildtype.getBuildConfigurations());
        }

        private PluginDescriptor handleCommonPluginDescriptorAttributes(Attributes attributes, PluginType pluginType) {
            PluginDescriptor pluginDescriptor = new PluginDescriptor();
            String mrid = getSettings().substitute(attributes.getValue("mrid"));
            if (mrid != null) {
                if (!mrid.matches(".*#.*")) {
                    if (pluginType == PluginType.BUILDTYPE) {
                        Message.debug("No organisation specified for buildtype " + mrid + " using the default one");
                        mrid = EasyAntConstants.EASYANT_BUILDTYPES_ORGANISATION + "#" + mrid;
                    } else {
                        Message.debug("No organisation specified for plugin " + mrid + " using the default one");
                        mrid = EasyAntConstants.EASYANT_PLUGIN_ORGANISATION + "#" + mrid;
                    }
                }
                pluginDescriptor.setMrid(mrid);
            } else {
                String org = attributes.getValue("org") != null ? attributes.getValue("org") : attributes
                        .getValue("organisation");
                org = getSettings().substitute(org);
                if (org == null) {
                    if (pluginType == PluginType.BUILDTYPE) {
                        Message.debug("No organisation specified for buildtype " + mrid + " using the default one");
                        org = EasyAntConstants.EASYANT_BUILDTYPES_ORGANISATION;
                    } else {
                        Message.debug("No organisation specified for plugin " + mrid + " using the default one");
                        org = EasyAntConstants.EASYANT_PLUGIN_ORGANISATION;
                    }
                }
                String module = getSettings().substitute(attributes.getValue("module"));
                String revision = attributes.getValue("rev") != null ? attributes.getValue("rev") : attributes
                        .getValue("revision");
                revision = getSettings().substitute(revision);
                pluginDescriptor.setOrganisation(org);
                pluginDescriptor.setModule(module);
                pluginDescriptor.setRevision(revision);
            }

            String conf = getSettings().substitute(attributes.getValue("conf"));
            pluginDescriptor.setBuildConfigurations(conf);

            pluginDescriptor.setMode(getSettings().substitute(attributes.getValue("mode")));
            pluginDescriptor.setAs(getSettings().substitute(attributes.getValue("as")));
            return pluginDescriptor;
        }
View Full Code Here

TOP

Related Classes of org.apache.easyant.core.descriptor.PluginDescriptor

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.