Package org.gradle.api.file

Examples of org.gradle.api.file.FileCollection


    }

    @InputFiles
    public FileCollection getAllInjects()
    {
        FileCollection col = null;

        for (ResourceHolder holder : stages)
            if (col == null)
                col = holder.getInjects();
            else
View Full Code Here


        excludeCalls.add(c);
    }
   
    public FileCollection getSourcePaths()
    {
        FileCollection collection = getProject().files(new Object[] {});
       
        for (DelayedFile file : sourcePaths)
            collection = collection.plus(getProject().files(file));
               
        return collection;
    }
View Full Code Here

                File dir = (File) input.getValue(instance);
                hashes.addAll(Constants.hashAll(dir));
            }
            else if (m.isAnnotationPresent(InputFiles.class))
            {
                FileCollection files = (FileCollection) input.getValue(instance);
                for (File file : files.getFiles())
                {
                    String hash = Constants.hash(file);
                    hashes.add(hash);
                    getLogger().info(hash + " " + input.getValue(instance));
                }
View Full Code Here

    public void doStuffBefore() throws Throwable
    {
        readCsvs();

        // check directory and stuff...
        FileCollection in = getInFiles();
        File out = getOutFile();

        if (in.getFiles().size() == 1 && in.getSingleFile().getName().endsWith("jar"))
            jarMode(in.getSingleFile(), out);
        else
            dirMode(in.getFiles(), out);
    }
View Full Code Here

        this.fieldsCsv = fieldsCsv;
    }

    public FileCollection getInFiles()
    {
        FileCollection collection = getProject().files(new Object[] {});
       
        for (DelayedFile file : inFiles)
            collection = collection.plus(getProject().files(file));
               
        return collection;
    }
View Full Code Here

        candidateFormats.add("ClassPathNotation, e.g. gradleApi().");
    }

    public void convert(DependencyFactory.ClassPathNotation notation, NotationConvertResult<? super SelfResolvingDependency> result) throws TypeConversionException {
        Collection<File> classpath = classPathRegistry.getClassPath(notation.name()).getAsFiles();
        FileCollection files = fileResolver.resolveFiles(classpath);
        result.converted(instantiator.newInstance(DefaultSelfResolvingDependency.class, files));
    }
View Full Code Here

        }

        JavaExecHandleBuilder javaExec = new JavaExecHandleBuilder(getFileResolver());
        getForkOptions().copyTo(javaExec);

        FileCollection sonarRunnerConfiguration = getProject().getConfigurations().getAt(SonarRunnerExtension.SONAR_RUNNER_CONFIGURATION_NAME);

        Properties propertiesObject = new Properties();
        propertiesObject.putAll(properties);
        File propertyFile = new File(getTemporaryDir(), "sonar-project.properties");
        GUtil.saveProperties(propertiesObject, propertyFile);
View Full Code Here

    }

    void setUpMocksAndAttributes(GroovyCompile compile, final boolean groovyClasspathEmpty) {
        super.setUpMocksAndAttributes(compile);

        final FileCollection groovyClasspathCollection = context.mock(FileCollection.class);
        context.checking(new Expectations(){{
            allowing(groovyClasspathCollection).isEmpty();
            will(returnValue(groovyClasspathEmpty));
        }});
View Full Code Here

        }});

        configuration.getArtifacts().add(artifact);
        configuration.setExtendsFrom(toSet(otherConfiguration));

        FileCollection files = configuration.getAllArtifacts().getFiles();
        assertThat(files.getFiles(), equalTo(toSet(artifactFile1, artifactFile2)));
        assertThat(files.getBuildDependencies().getDependencies(null), equalTo((Set) toSet(otherConfTaskMock, artifactTaskMock)));
    }
View Full Code Here

        ((CompositeFileTree) fileTree).getSourceCollections();
    }

    @Test
    public void filterDelegatesToEachSet() {
        final FileCollection filtered1 = context.mock(FileCollection.class);
        final FileCollection filtered2 = context.mock(FileCollection.class);
        @SuppressWarnings("unchecked")
        final Spec<File> spec = context.mock(Spec.class);

        FileCollection filtered = collection.filter(spec);
        assertThat(filtered, instanceOf(CompositeFileCollection.class));

        context.checking(new Expectations() {{
            one(source1).filter(spec);
            will(returnValue(filtered1));
View Full Code Here

TOP

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

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.