Package org.gradle.api.file

Examples of org.gradle.api.file.FileCollection


    public <T extends Dependency> T createDependency(Class<T> type, Object userDependencyDescription)
            throws IllegalDependencyNotation {
        if (userDependencyDescription instanceof DependencyFactory.ClassPathNotation) {
            DependencyFactory.ClassPathNotation classPathNotation
                    = (DependencyFactory.ClassPathNotation) userDependencyDescription;
            FileCollection files = fileResolver.resolveFiles(classPathRegistry.getClassPathFiles(classPathNotation.name()));
            return type.cast(classGenerator.newInstance(DefaultSelfResolvingDependency.class, files));
        }
       
        throw new IllegalDependencyNotation();
    }
View Full Code Here


        expectTaskStateCreated();

        TaskArtifactState state = repository.getStateFor(task);
        assertNotNull(state);

        final FileCollection outputFiles = context.mock(FileCollection.class);

        context.checking(new Expectations() {{
            one(taskArtifactState).getOutputFiles();
            will(returnValue(outputFiles));
            one(taskArtifactState).update();
View Full Code Here

    @Test public void testDeclaresConfigurationArtifactsAsInputFiles() {
        assertThat(upload.getArtifacts(), nullValue());

        upload.setConfiguration(configurationMock);

        final FileCollection files = context.mock(FileCollection.class);
        context.checking(new Expectations(){{
            one(configurationMock).getAllArtifactFiles();
            will(returnValue(files));
        }});
View Full Code Here

    private final JUnit4Mockery context = new JUnit4Mockery();
    private final SelfResolvingDependencyFactory factory = new SelfResolvingDependencyFactory(new AsmBackedClassGenerator());

    @Test
    public void createsADependencyFromAFileCollectionNotation() {
        FileCollection collection = context.mock(FileCollection.class);

        Dependency dependency = factory.createDependency(Dependency.class, collection);
        assertThat(dependency, instanceOf(DefaultSelfResolvingDependency.class));
        DefaultSelfResolvingDependency selfResolvingDependency = (DefaultSelfResolvingDependency) dependency;
        assertThat(selfResolvingDependency.getSource(), sameInstance(collection));
View Full Code Here

        osgiManifest.setVersion(null);
        osgiManifest.getEffectiveManifest();
    }

    private void setUpOsgiManifest() throws IOException {
        final FileCollection fileCollection = context.mock(FileCollection.class);
        context.checking(new Expectations() {{
            allowing(fileCollection).getFiles();
            will(returnValue(WrapUtil.toSet(new File("someFile"))));
        }});
        osgiManifest.setSymbolicName("symbolic");
View Full Code Here

        }});

        configuration.addArtifact(artifact);
        configuration.setExtendsFrom(toSet(otherConfiguration));

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

    @Test
    public void addsDependencyOnInputFiles() {
        final TaskInternal task = context.mock(TaskInternal.class);
        final ProjectInternal project = context.mock(ProjectInternal.class);
        final TaskInputs taskInputs = context.mock(TaskInputs.class);
        final FileCollection inputFiles = context.mock(FileCollection.class);

        context.checking(new Expectations() {{
            one(delegate).createTask(project, map());
            will(returnValue(task));
            allowing(task).getInputs();
View Full Code Here

        ResolvedConfiguration actualResolvedConfiguration = resolver.resolve(this.configuration, ivy, moduleDescriptor);
        assertThat(actualResolvedConfiguration, not(sameInstance(resolvedConfiguration)));

        final File configFile = new File("from config");
        final File depFile = new File("from dep");
        final FileCollection depFiles = context.mock(FileCollection.class);

        final boolean transitive = true;
        context.checking(new Expectations() {{
            allowing(configuration);
            will(returnValue(transitive));
View Full Code Here

    {
        List<File> ins = getIn();
        File out = getOut();
        File rangemap = getRangeMap();
        File rangelog = File.createTempFile("rangelog", ".txt", this.getTemporaryDir());
        FileCollection srg = getSrgs();
        FileCollection exc = getExcs();
       
        InputSupplier inSup;
       
        if (ins.size() == 0)
            return; // no input.
View Full Code Here

    }

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

        for (ResourceHolder holder : stages)
            if (col == null)
                col = holder.getPatchFiles();
            else
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.