Package org.netbeans.gradle.project.java.model

Examples of org.netbeans.gradle.project.java.model.NbJavaModel


                LOGGER.log(Level.INFO,
                        "Disabling the Java extension because there are no sources: {0}",
                        module.getProperties().getProjectDir());
            }
            else {
                NbJavaModel model = createUnreliableModel(module, outputDirToProject);
                result.put(module.getModuleDir(), model);
            }
        }
        return result;
    }
View Full Code Here


        Collection<NbJavaModule> modules = JavaParsingUtils.parseModules(retrievedModels);
        Map<File, JavaProjectDependency> moduleDependencies = JavaParsingUtils.asDependencies(modules);

        Map<File, NbJavaModel> result = CollectionUtils.newHashMap(modules.size());
        for (NbJavaModule module: modules) {
            NbJavaModel model = createReliableModel(module, moduleDependencies);
            result.put(module.getModuleDir(), model);
        }

        for (File projectDir: retrievedModels.getEvaluatedProjectsModel().keySet()) {
            if (!result.containsKey(projectDir)) {
View Full Code Here

        Map<File, NbJavaModel> result = ideaProject != null
                ? parseFromIdeaProject(retrievedModels.getMainProjectDir(), ideaProject)
                : parseFromNewModels(retrievedModels);

        NbJavaModel mainModule = result.get(retrievedModels.getMainProjectDir());
        return new ParsedModel<>(mainModule, result);
    }
View Full Code Here

            }
        }
    }

    private void updateAllSources() {
        NbJavaModel currentModel = javaExt.getCurrentModel();
        NbJavaModule mainModule = currentModel.getMainModule();

        List<File> sources = new LinkedList<>();
        addSourcesOfModule(mainModule, sources);

        for (JavaProjectReference projectRef: currentModel.getAllDependencies()) {
            NbJavaModule module = projectRef.tryGetModule();
            if (module != null) {
                addSourcesOfModule(module, sources);
            }
        }
View Full Code Here

    public ClassPath findClassPath(FileObject file, String type) {
        if (GradleFilesClassPathProvider.isGradleFile(file)) {
            return null;
        }

        NbJavaModel projectModel = javaExt.getCurrentModel();
        ClassPathKey classPathKey = getClassPathType(projectModel, file, type);
        if (classPathKey == null) {
            // We don't really know if we will know the classpath of this file
            // or not so we should return ClassPath which returns the classpaths
            // as soon as they become known. However, this means that we never
View Full Code Here

                return getRoots().length > 0;
            }

            @Override
            public FileObject[] getRoots() {
                NbJavaModel projectModel = javaExt.getCurrentModel();
                NbJavaModule mainModule = projectModel.getMainModule();

                return getSourceRoots(mainModule, binaryRoot);
            }

            @Override
View Full Code Here

            return result;
        }

        private void readKeys(List<SingleNodeFactory> toPopulate) throws DataObjectNotFoundException {
            NbJavaModel currentModel = javaExt.getCurrentModel();
            NbJavaModule mainModule = currentModel.getMainModule();

            Map<String, Set<String>> dependencyGraph = sourceSetDependencyGraph(mainModule);

            for (JavaSourceSet sourceSet: mainModule.getSources()) {
                JavaClassPaths classpaths = sourceSet.getClasspaths();
View Full Code Here

            result.addAll(Arrays.asList(roots));
        }
    }

    private ClassPath getSources() {
        NbJavaModel currentModel = javaExt.getCurrentModel();

        NbJavaModule mainModule = currentModel.getMainModule();
        Set<FileObject> srcRoots = new LinkedHashSet<>();
        Set<File> runtimeDependencies = new HashSet<>(100);

        addSourcesOfModule(mainModule, srcRoots);
        getBinaryRuntimeDependencies(mainModule, runtimeDependencies);

        for (JavaProjectReference projectRef: currentModel.getAllDependencies()) {
            NbJavaModule module = projectRef.tryGetModule();
            if (module != null) {
                addSourcesOfModule(module, srcRoots);
                getBinaryRuntimeDependencies(module, runtimeDependencies);
            }
View Full Code Here

        return urlsFromSourceSets(module.getTestSourceSets());
    }

    @Override
    public URL[] findUnitTests(FileObject source) {
        NbJavaModel projectModel = javaExt.getCurrentModel();

        NbJavaModule mainModule = projectModel.getMainModule();
        if (hasSource(mainModule, source)) {
            return getTestRoots(mainModule);
        }

        return null;
View Full Code Here

        return null;
    }

    @Override
    public URL[] findSources(FileObject unitTest) {
        NbJavaModel projectModel = javaExt.getCurrentModel();

        NbJavaModule mainModule = projectModel.getMainModule();
        if (!hasSource(mainModule, unitTest)) {
            return getSourceRoots(mainModule);
        }

        return null;
View Full Code Here

TOP

Related Classes of org.netbeans.gradle.project.java.model.NbJavaModel

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.