Examples of PatternSet


Examples of org.apache.tools.ant.types.PatternSet

    /**
     * Include files
     */
    public PatternSet createIncludes() {
        includes=new PatternSet(); //Path(project);
        return includes;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.PatternSet

        // for each sourcePath entry, add a directoryset with includes
        // taken from packagenames attribute and nested package
        // elements and excludes taken from excludepackages attribute
        // and nested excludepackage elements
        if (sourcePath != null && packageNames.size() > 0) {
            PatternSet ps = new PatternSet();
            Enumeration e = packageNames.elements();
            while (e.hasMoreElements()) {
                PackageName p = (PackageName) e.nextElement();
                String pkg = p.getName().replace('.', '/');
                if (pkg.endsWith("*")) {
                    pkg += "*";
                }
                ps.createInclude().setName(pkg);
            }

            e = excludePackageNames.elements();
            while (e.hasMoreElements()) {
                PackageName p = (PackageName) e.nextElement();
                String pkg = p.getName().replace('.', '/');
                if (pkg.endsWith("*")) {
                    pkg += "*";
                }
                ps.createExclude().setName(pkg);
            }


            String[] pathElements = sourcePath.list();
            for (int i = 0; i < pathElements.length; i++) {
View Full Code Here

Examples of org.apache.tools.ant.types.PatternSet

        // for each sourcePath entry, add a directoryset with includes
        // taken from packagenames attribute and nested package
        // elements and excludes taken from excludepackages attribute
        // and nested excludepackage elements
        if (sourcePath != null) {
            PatternSet ps = new PatternSet();
            ps.setProject(getProject());
            if (packageNames.size() > 0) {
                Enumeration e = packageNames.elements();
                while (e.hasMoreElements()) {
                    PackageName p = (PackageName) e.nextElement();
                    String pkg = p.getName().replace('.', '/');
                    if (pkg.endsWith("*")) {
                        pkg += "*";
                    }
                    ps.createInclude().setName(pkg);
                }
            } else {
                ps.createInclude().setName("**");
            }

            Enumeration e = excludePackageNames.elements();
            while (e.hasMoreElements()) {
                PackageName p = (PackageName) e.nextElement();
                String pkg = p.getName().replace('.', '/');
                if (pkg.endsWith("*")) {
                    pkg += "*";
                }
                ps.createExclude().setName(pkg);
            }


            String[] pathElements = sourcePath.list();
            for (int i = 0; i < pathElements.length; i++) {
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

    public String getDisplayName() {
        return String.format("file set '%s'", dir);
    }

    public FileTree matching(PatternFilterable patterns) {
        PatternSet patternSet = this.patternSet.intersect();
        patternSet.copyFrom(patterns);
        DefaultConfigurableFileTree filtered = new DefaultConfigurableFileTree(getDir(), resolver, taskResolver);
        filtered.setPatternSet(patternSet);
        return filtered;
    }
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

        assertThat(toList(filteredCompositeSet.getSourceCollections()), equalTo(toList(filtered1, filtered2)));
    }

    @Test
    public void matchingWithPatternSetReturnsUnionOfFilteredSets() {
        final PatternSet patternSet = new PatternSet();
        final FileTree filtered1 = context.mock(FileTree.class, "filtered1");
        final FileTree filtered2 = context.mock(FileTree.class, "filtered2");

        context.checking(new Expectations() {{
            one(source1).matching(patternSet);
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

     * @return The candidate class files.
     */
    @InputFiles
    @Input // Also marked as input to force tests to run when the set of candidate class files changes
    public FileTree getCandidateClassFiles() {
        PatternSet patterns = new PatternSet();
        patterns.copyFrom(patternSet);
        if (!isScanForTestClasses()) {
            if (patterns.getIncludes().isEmpty()) {
                patterns.include("**/*Tests.class", "**/*Test.class");
            }
            if (patterns.getExcludes().isEmpty()) {
                patterns.exclude("**/Abstract*.class");
            }
        }
        return getProject().fileTree(getTestClassesDir()).matching(patterns);
    }
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

    }

    public WorkResult execute() {
        scalaCompiler.execute();

        PatternFilterable patternSet = new PatternSet();
        patternSet.include("**/*.java");
        FileTree javaSource = source.getAsFileTree().matching(patternSet);
        if (!javaSource.isEmpty()) {
            javaCompiler.setSource(javaSource);
            javaCompiler.execute();
        }
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

        walker.start(root.getMock());
    }

    @Test public void testUsesSpecFromPatternSetToMatchFilesAndDirs() {
        final PatternSet patternSet = context.mock(PatternSet.class);
        final Spec spec = context.mock(Spec.class);

        context.checking(new Expectations(){{
            one(patternSet).getAsSpec();
            will(returnValue(spec));
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

        });
        return !found.get();
    }

    public FileTree matching(Closure filterConfigClosure) {
        PatternSet patternSet = new PatternSet();
        ConfigureUtil.configure(filterConfigClosure, patternSet);
        return matching(patternSet);
    }
View Full Code Here

Examples of org.gradle.api.tasks.util.PatternSet

        ConfigureUtil.configure(filterConfigClosure, patternSet);
        return matching(patternSet);
    }

    public FileTree matching(PatternFilterable patterns) {
        PatternSet patternSet = new PatternSet();
        patternSet.copyFrom(patterns);
        return new FilteredFileTree(this, patternSet.getAsSpec());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.