Examples of FileTree


Examples of org.gradle.api.file.FileTree

    @Test
    public void toFileTreeReturnsSingletonTreeForEachFileInCollection() {
        File file = new File("f1");

        TestFileCollection collection = new TestFileCollection(file);
        FileTree tree = collection.getAsFileTree();
        assertThat(tree, instanceOf(CompositeFileTree.class));
        CompositeFileTree compositeTree = (CompositeFileTree) tree;
        assertThat(compositeTree.getSourceCollections(), hasItems((Matcher) instanceOf(SingletonFileTree.class)));
    }
View Full Code Here

Examples of org.gradle.api.file.FileTree

        assertThat(task.getSource(), sameInstance(task.defaultSource));
    }

    @Test
    public void doesNotUseDefaultSourceWhenSourceHasBeenSpecifiedOnSpec() {
        final FileTree source = context.mock(FileTree.class, "source");
        context.checking(new Expectations(){{
            one(task.action).hasSource();
            will(returnValue(true));
            one(task.action).getAllSource();
            will(returnValue(source));
View Full Code Here

Examples of org.gradle.api.file.FileTree

        };

        TestClassProcessor processor = new MaxNParallelTestClassProcessor(testTask.getMaxParallelForks(),
                reforkingProcessorFactory, actorFactor);

        final FileTree testClassFiles = testTask.getCandidateClassFiles();

        Runnable detector;
        if (testTask.isScanForTestClasses()) {
            TestFrameworkDetector testFrameworkDetector = testTask.getTestFramework().getDetector();
            detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor);
View Full Code Here

Examples of org.gradle.api.file.FileTree

    public void testScansForTestClassesInTheTestClassesDir() {
        configureTask();
        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

Examples of org.gradle.api.file.FileTree

                    if (!f.canExecute())
                    {
                        boolean worked = f.setExecutable(true);
                        project.getLogger().info("Setting file +X "+worked + " : "+f.getPath());
                    }
                    FileTree tree = delayedFileTree(DevConstants.LAUNCH4J_DIR + "/bin").call();
                    tree.visit(new FileVisitor()
                    {
                        @Override public void visitDir(FileVisitDetails dirDetails){}
                        @Override
                        public void visitFile(FileVisitDetails fileDetails)
                        {
View Full Code Here

Examples of org.gradle.api.file.FileTree

        if (!outDir.exists())
            outDir.mkdirs();

        for (File inDir : inDirs)
        {
            FileTree tree = getProject().fileTree(inDir);

            for (File file : tree)
            {
                String text = Files.toString(file, Charsets.UTF_8);
                text = processFile(text);
View Full Code Here

Examples of org.gradle.api.file.FileTree

            else
                dir = dir.getCanonicalFile();

            // this could be written as .matching(source), but it doesn't actually work
            // because later on gradle casts it directly to PatternSet and crashes
            FileTree tree = getProject().fileTree(dir).matching(source.getFilter()).matching(patterns);

            for (File file : tree)
            {
                File dest = getDest(file, dir, out);
                dest.getParentFile().mkdirs();
View Full Code Here

Examples of org.gradle.api.file.FileTree

    }

    private void removeOld(File dir) throws IOException
    {
        final ArrayList<File> directories = new ArrayList<File>();
        FileTree tree = getProject().fileTree(dir);

        tree.visit(new FileVisitor()
        {
            @Override
            public void visitDir(FileVisitDetails dir)
            {
                directories.add(dir.getFile());
View Full Code Here

Examples of org.gradle.api.file.FileTree

    public void testScansForTestClassesInTheTestClassesDir() {
        configureTask();
        test.include("include");
        test.exclude("exclude");

        FileTree classFiles = test.getCandidateClassFiles();
        assertIsDirectoryTree(classFiles, toSet("include"), toSet("exclude"));
    }
View Full Code Here

Examples of org.gradle.api.file.FileTree

    @Test
    public void getAsFileTreeDelegatesToEachSet() {
        final File file1 = new File("dir1");
        final File file2 = new File("dir2");

        FileTree fileTree = collection.getAsFileTree();
        assertThat(fileTree, instanceOf(CompositeFileTree.class));

        context.checking(new Expectations() {{
            one(source1).getFiles();
            will(returnValue(toSet(file1)));
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.