Package org.gradle.api.file

Examples of org.gradle.api.file.ConfigurableFileTree


            }
        }

        if (scanTargetPatterns != null) {
            for (ScanTargetPattern scanTargetPattern : scanTargetPatterns) {
                ConfigurableFileTree files = getProject().fileTree(scanTargetPattern.getDirectory());
                files.include(scanTargetPattern.getIncludes());
                files.exclude(scanTargetPattern.getExcludes());
                List<File> currentTargets = getExtraScanTargets();
                if (currentTargets != null && !currentTargets.isEmpty()) {
                    currentTargets.addAll(files.getFiles());
                } else {
                    setExtraScanTargets((List) files.asType(List.class));
                }
            }
        }
    }
View Full Code Here


        test.include("include");
        test.exclude("exclude");

        FileTree classFiles = test.getCandidateClassFiles();
        assertThat(classFiles, instanceOf(ConfigurableFileTree.class));
        ConfigurableFileTree files = (ConfigurableFileTree) classFiles;
        assertThat(files.getDir(), equalTo(classesDir));
        assertThat(files.getIncludes(), equalTo(toSet("include")));
        assertThat(files.getExcludes(), equalTo(toSet("exclude")));
    }
View Full Code Here

    @org.junit.Test
    public void testAddsDefaultIncludeAndExcludePatternsWhenTestScanningIsOff() {
        configureTask();
        test.setScanForTestClasses(false);

        ConfigurableFileTree files = (ConfigurableFileTree) test.getCandidateClassFiles();
        assertThat(files.getDir(), equalTo(classesDir));
        assertThat(files.getIncludes(), equalTo(toSet("**/*Tests.class", "**/*Test.class")));
        assertThat(files.getExcludes(), equalTo(toSet("**/Abstract*.class")));
    }
View Full Code Here

  public FileCollection getSources() {
    if (this.classesDir == null) {
      return this.getProject().files();
    }

    ConfigurableFileTree result = this.getProject().fileTree(this.classesDir);
    result.include("**/*.class");

    return result;
  }
View Full Code Here

            }
        }

        if (scanTargetPatterns != null) {
            for (ScanTargetPattern scanTargetPattern : scanTargetPatterns) {
                ConfigurableFileTree files = getProject().fileTree(scanTargetPattern.getDirectory());
                files.include(scanTargetPattern.getIncludes());
                files.exclude(scanTargetPattern.getExcludes());
                Set<File> currentTargets = getExtraScanTargets();
                if (currentTargets != null && !currentTargets.isEmpty()) {
                    currentTargets.addAll(files.getFiles());
                } else {
                    setExtraScanTargets(files.getFiles());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.file.ConfigurableFileTree

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.