Package org.netbeans.gradle.model.java

Examples of org.netbeans.gradle.model.java.JavaSourceSet


    private ClassPathKey getClassPathType(NbJavaModel projectModel, FileObject fileObj, String type) {
        if (type == null) {
            return null;
        }

        JavaSourceSet sourceSet = findAssociatedSourceSet(projectModel, fileObj);
        if (sourceSet == null) {
            return null;
        }

        if (ClassPath.BOOT.equals(type)) {
            return SpecialClassPath.BOOT;
        }

        String name = sourceSet.getName();

        switch (type) {
            case ClassPath.SOURCE:
                return new SourceSetClassPathType(name, ClassPathType.SOURCES);
            case JavaClassPathConstants.PROCESSOR_PATH: /* falls through */
 
View Full Code Here


                return true;
            }

            Map<String, JavaSourceSet> sources2 = getSourceSetMap(module2);
            for (JavaSourceSet sourceSet1: module1.getSources()) {
                JavaSourceSet sourceSet2 = sources2.get(sourceSet1.getName());
                if (sourceSet2 == null) {
                    return true;
                }

                if (!isClassPathSame(sourceSet1, sourceSet2)) {
View Full Code Here

            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());
                    classpaths.removeAll(inherited.getOutputDirs().getOtherDirs());
                }
            }

            List<SingleNodeFactory> dependencyNodes = filesToNodes(currentModel, classpaths);
            dependencyNodes = sortDependencyNodes(dependencyNodes);
View Full Code Here

        return emptySourceSet(name);
    }

    public JavaSourceSet getMainSourceSet() {
        JavaSourceSet result = mainSourceSetRef.get();
        if (result == null) {
            mainSourceSetRef.set(findByNameOrEmpty(JavaSourceSet.NAME_MAIN));
            result = mainSourceSetRef.get();
        }
        return result;
View Full Code Here

        }
        return result;
    }

    public JavaSourceSet getTestSourceSet() {
        JavaSourceSet result = testSourceSetRef.get();
        if (result == null) {
            testSourceSetRef.set(findByNameOrEmpty(JavaSourceSet.NAME_TEST));
            result = testSourceSetRef.get();
        }
        return result;
View Full Code Here

            JavaSourcesModel actual) {

        Map<String, JavaSourceSet> expectedMap = sourceSetMap(expected);

        for (JavaSourceSet sourceSet: actual.getSourceSets()) {
            JavaSourceSet expectedSourceSet = expectedMap.get(sourceSet.getName());
            expectedMap.remove(sourceSet.getName());

            if (expectedSourceSet == null) {
                fail("Unexpected source set: " + sourceSet.getName());
            }
View Full Code Here

                }
            }
            return null;
        }
        else {
            JavaSourceSet bestMatch = null;
            for (JavaSourceSet sourceSet: sources.getSourceSets()) {
                String sourceSetName = sourceSet.getName().toLowerCase(Locale.ROOT);
                if (taskName.contains(sourceSetName)) {
                    if (bestMatch == null || bestMatch.getName().length() < sourceSetName.length()) {
                        bestMatch = sourceSet;
                    }
                }
            }
            return bestMatch;
View Full Code Here

            return bestMatch;
        }
    }

    private static File tryGetBuildDirSourceForJar(JarOutput jar, JavaSourcesModel sources) {
        JavaSourceSet result = tryGetSourceSetForJar(jar, sources);
        return result != null ? result.getOutputDirs().getClassesDir() : null;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.gradle.model.java.JavaSourceSet

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.