protected void easyantPropertyStarted()

in src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java [507:556]


        protected void easyantPropertyStarted(Attributes attributes) throws SAXException {
            String conf = getSettings().substitute(attributes.getValue("conf"));
            // if property tag is a subelement and
            // no build configuration was defined looked at plugin build
            // configurations
            if (EasyAntState.PLUGIN == easyAntState && conf == null) {
                conf = currentPluginDescriptor.getBuildConfigurations();
            }

            if (attributes.getValue("file") != null) {
                String fileName = getSettings().substitute(attributes.getValue("file"));
                File file = new File(fileName);
                if (!file.exists()) {
                    throw new SAXException(fileName + " doesn't exists !");
                }
                PropertiesFile props = new PropertiesFile(file, "project properties");
                Enumeration<?> enumeration = props.propertyNames();
                while (enumeration.hasMoreElements()) {
                    String key = (String) enumeration.nextElement();
                    String value = getSettings().substitute(props.getProperty(key));

                    // put this variable on the context
                    IvyContext.getContext().getSettings().getVariableContainer().setVariable(key, value, true);
                    PropertyDescriptor property = new PropertyDescriptor(key);
                    property.setValue(value);
                    property.setBuildConfigurations(conf);

                    applyInheritableItemAttributesFromParentNode(property);
                    // override with explicit inherited scope attributes
                    handleInheritedScopeAttribute(attributes, property);

                    easyAntModuleDescriptor.getProperties().put(key, property);
                }
            } else if (attributes.getValue("name") != null) {
                String propertyName = getSettings().substitute(attributes.getValue("name"));
                String value = getSettings().substitute(attributes.getValue("value"));

                // put this variable on the context
                IvyContext.getContext().getSettings().getVariableContainer().setVariable(propertyName, value, true);
                PropertyDescriptor property = new PropertyDescriptor(propertyName, getMd().getModuleRevisionId());
                property.setValue(value);
                property.setBuildConfigurations(conf);

                applyInheritableItemAttributesFromParentNode(property);
                // override with explicit inherited scope attributes
                handleInheritedScopeAttribute(attributes, property);

                easyAntModuleDescriptor.getProperties().put(propertyName, property);
            }
        }