Package org.gradle.api.plugins

Examples of org.gradle.api.plugins.ExtraPropertiesExtension$UnknownPropertyException


            try {
                Integer index = token == null ? null : Integer.valueOf(token);
                access = new IndexedAccess(type, index);
                validationContext.setCurrentIndex(index);
            } catch (NumberFormatException e) {
                throw new UnknownPropertyException(String.format("Cannot parse %s as an array/iterable index", token),
                    e);
            }
        } else if (KeyedAccess.getJavaElementType(type) != null) {
            access = new KeyedAccess(type, token);
            validationContext.setCurrentKey(token);
        } else {
            throw new UnknownPropertyException(String.format("Cannot determine index/key type for %s", type));
        }
        Object value = validationContext.getBean();
        Object child = value == null ? null : access.get(value);
        setType(child == null ? access.getJavaType() : child.getClass());
        validationContext.setBean(child,
View Full Code Here


            PropertyAccess access = new PropertyAccess(rawType, token);
            if (access.isKnown()) {
                // add heretofore unknown, but valid, property on the fly:
                mp = Jsr303MetaBeanFactory.addMetaProperty(metaBean, access);
            } else {
                throw new UnknownPropertyException("unknown property '" + token + "' in " + metaBean.getId());
            }
        }
        validationContext.setMetaProperty(mp);
        setType(mp.getType());
    }
View Full Code Here

     */
    public void moveDownIfNecessary() {
        MetaProperty mp = validationContext.getMetaProperty();
        if (mp != null) {
            if (mp.getMetaBean() == null) {
                throw new UnknownPropertyException(String.format("Property %s.%s is not cascaded", mp
                    .getParentMetaBean().getId(), mp.getName()));
            }
            validationContext.moveDown(mp, new NullSafePropertyAccess(validationContext.getMetaBean().getBeanClass(),
                mp.getName()));
        }
View Full Code Here

        } else {
            LOGGER.debug("project property file does not exists. We continue!");
        }
       
        Map<String, String> mergedProperties = propertiesLoader.mergeProperties(new HashMap(projectProperties));
        ExtraPropertiesExtension extraProperties = new DslObject(project).getExtensions().getExtraProperties();
        for (Map.Entry<String, String> entry: mergedProperties.entrySet()) {
            try {
                project.setProperty(entry.getKey(), entry.getValue());
            } catch (MissingPropertyException e) {
                if (!entry.getKey().equals(e.getProperty())) {
                    throw e;
                }
                // Ignore and define as an extra property
                extraProperties.set(entry.getKey(), entry.getValue());
            }
        }
    }
View Full Code Here

        }
    }

    @SuppressWarnings("unchecked")
    private Map<File, File> getOrCreateGlobalAnalysisMap() {
        ExtraPropertiesExtension extraProperties = getProject().getRootProject().getExtensions().getExtraProperties();
        Map<File, File> analysisMap;

        if (extraProperties.has("scalaCompileAnalysisMap")) {
            analysisMap = (Map) extraProperties.get("scalaCompileAnalysisMap");
        } else {
            analysisMap = Maps.newHashMap();
            for (Project project : getProject().getRootProject().getAllprojects()) {
                for (ScalaCompile task : project.getTasks().withType(ScalaCompile.class)) {
                    if (task.getScalaCompileOptions().isUseAnt()) { continue; }
                    File publishedCode = task.getScalaCompileOptions().getIncrementalOptions().getPublishedCode();
                    File analysisFile = task.getScalaCompileOptions().getIncrementalOptions().getAnalysisFile();
                    analysisMap.put(publishedCode, analysisFile);
                }
            }
            extraProperties.set("scalaCompileAnalysisMap", Collections.unmodifiableMap(analysisMap));
        }
        return analysisMap;
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.plugins.ExtraPropertiesExtension$UnknownPropertyException

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.