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

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


        String level = AbstractProjectProperties.getSourceLevelFromPlatform(JavaPlatform.getDefault());

        GenericProjectProperties properties = new GenericProjectProperties(name, name, projectDir);
        JavaCompatibilityModel compatibilityModel = new JavaCompatibilityModel(level, level);

        NbJavaModule result = new NbJavaModule(
                properties,
                compatibilityModel,
                Collections.<JavaSourceSet>emptyList(),
                Collections.<NbListedDir>emptyList(),
                JavaTestModel.getDefaulTestModel(projectDir)
View Full Code Here


        JavaCompatibilityModel compatibilityModel = new JavaCompatibilityModel(sourceLevel, targetLevel);

        List<NbListedDir> listedDirs = lookupListedDirs(sourceSets);
        JavaTestModel testModel = JavaTestModel.getDefaulTestModel(moduleDir);

        return new NbJavaModule(properties, compatibilityModel, sourceSets, listedDirs, testModel);
    }
View Full Code Here

        Map<String, IdeaDependencyBuilder> cache = CollectionUtils.newHashMap(modulesCount);

        Map<File, NbJavaModule> parsedModules = CollectionUtils.newHashMap(modulesCount);
        for (IdeaModule module: modules) {
            NbJavaModule parsedModule = tryParseModule(module, cache);
            if (parsedModule != null) {
                parsedModules.put(parsedModule.getModuleDir(), parsedModule);
            }
        }

        if (!parsedModules.containsKey(projectDir)) {
            throw new IOException("Unable to parse the main project from the model.");
View Full Code Here

        });
    }

    @Override
    public void onModelChange() {
        NbJavaModule newModule = javaExt.getCurrentModel().getMainModule();

        boolean hasChanged;
        NodesDescription currentNodes;
        do {
            currentNodes = lastDisplayed.get();
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

                getPathResources(classPaths, new HashSet<File>()));
    }

    private static void removeOtherBuildOutputDirs(NbJavaModel projectModel, Set<File> classPaths) {
        for (JavaProjectReference dependency: projectModel.getAllDependencies()) {
            NbJavaModule module = dependency.tryGetModule();
            if (module != null) {
                for (JavaSourceSet sourceSet: module.getSources()) {
                    classPaths.remove(sourceSet.getOutputDirs().getClassesDir());
                }
            }
        }
    }
View Full Code Here

        for (JavaSourceSet sourceSet: projectModel.getMainModule().getSources()) {
            classPaths.add(sourceSet.getOutputDirs().getClassesDir());
        }

        for (JavaProjectReference dependency: projectModel.getAllDependencies()) {
            NbJavaModule module = dependency.tryGetModule();
            if (module != null) {
                for (JavaSourceSet sourceSet: module.getSources()) {
                    classPaths.add(sourceSet.getOutputDirs().getClassesDir());
                }
            }
        }
View Full Code Here

        // TODO: This method must be called whenever any of the dependent projects
        //   is reloaded.

        Set<File> missing = new HashSet<>();

        NbJavaModule mainModule = projectModel.getMainModule();
        for (JavaSourceSet sourceSet: mainModule.getSources()) {
            loadPathResources(sourceSet, missing);
        }

        loadBootClassPath();
        loadAllRuntimeClassPath(mainModule);
View Full Code Here

        });
    }

    @Override
    protected Result tryFindSourceRoot(final File binaryRoot) {
        NbJavaModule mainModule = javaExt.getCurrentModel().getMainModule();
        if (tryGetSourceRoots(mainModule, binaryRoot) == null) {
            return null;
        }

        return new SourceForBinaryQueryImplementation2.Result() {
            @Override
            public boolean preferSources() {
                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

        final FileObject sourceRootObj = FileUtil.toFileObject(sourceRoot);
        if (sourceRootObj == null) {
            return null;
        }

        NbJavaModule mainModule = javaExt.getCurrentModel().getMainModule();
        if (tryGetOutputDir(mainModule, sourceRootObj) == null) {
            return null;
        }

        return new BinaryForSourceQuery.Result() {
            @Override
            public URL[] getRoots() {
                NbJavaModule mainModule = javaExt.getCurrentModel().getMainModule();

                return getRootsAsURLs(mainModule, sourceRootObj);
            }

            @Override
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.