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

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


            this.lastModule = new AtomicReference<>(null);
        }

        @Override
        public void stateChanged(ChangeEvent e) {
            NbJavaModule newModule = javaExt.getCurrentModel().getMainModule();
            NbJavaModule prevModule = lastModule.getAndSet(newModule);

            if (hasRelevantDifferences(newModule, prevModule)) {
                refresh(false);
            }
        }
View Full Code Here


                return NbStrings.getSourceSetInherits(baseName, listToString(dependencies));
            }
        }

        private static int compareProjectDependencyNodes(ProjectDependencyFactory node1, ProjectDependencyFactory node2) {
            NbJavaModule module1 = node1.projectDep.tryGetModule();
            NbJavaModule module2 = node2.projectDep.tryGetModule();

            if (module1 == module2) {
                return 0;
            }

            if (module1 == null) {
                return 1;
            }
            if (module2 == null) {
                return -1;
            }

            return STR_CMP.compare(module1.getShortName(), module2.getShortName());
        }
View Full Code Here

                String nodeGroupName,
                Collection<String> sourceSetDependencies,
                Set<File> classpaths, // IN/OUT
                List<SingleNodeFactory> toPopulate) {

            NbJavaModule mainModule = currentModel.getMainModule();
            classpaths.removeAll(mainModule.getAllBuildOutputs());

            for (String inheritedName: sourceSetDependencies) {
                JavaSourceSet inherited = mainModule.tryGetSourceSetByName(inheritedName);
                if (inherited != null) {
                    classpaths.removeAll(inherited.getClasspaths().getCompileClasspaths());
                    classpaths.removeAll(inherited.getClasspaths().getRuntimeClasspaths());
                    classpaths.remove(inherited.getOutputDirs().getClassesDir());
                    classpaths.remove(inherited.getOutputDirs().getResourcesDir());
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();

                Set<File> providedClassPaths = new HashSet<>(classpaths.getCompileClasspaths());
                Set<File> runtimeClassPaths = new HashSet<>(classpaths.getRuntimeClasspaths());
                Set<File> compileClassPaths = splitSets(providedClassPaths, runtimeClassPaths);
View Full Code Here

                    return getIcon(type);
                }

                @Override
                public String getDisplayName() {
                    NbJavaModule module = projectDep.tryGetModule();
                    return module != null
                            ? module.getShortName()
                            : super.getDisplayName();
                }
            };
        }
View Full Code Here

    }

    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

    @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

    @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

        return result;
    }

    private Map<String, SourceGroup[]> findSourceGroups(JavaExtension javaExt) {
        NbJavaModel projectModel = javaExt.getCurrentModel();
        NbJavaModule mainModule = projectModel.getMainModule();

        Map<String, List<SourceGroup>> moduleSources = findSourceGroupsOfModule(mainModule);

        Map<String, SourceGroup[]> result = CollectionUtils.newHashMap(moduleSources.size());
        for (Map.Entry<String, List<SourceGroup>> entry: moduleSources.entrySet()) {
View Full Code Here

TOP

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

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.