org.gradle.api.internal.file.copy.CopySpecInternal Java Examples

The following examples show how to use org.gradle.api.internal.file.copy.CopySpecInternal. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Copy.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getInstantiator();
    FileResolver fileResolver = getFileResolver();

    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}
 
Example #2
Source File: Copy.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getServices().get(Instantiator.class);
    FileResolver fileResolver = getServices().get(FileResolver.class);

    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}
 
Example #3
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 5 votes vote down vote up
@Override
public void apply(Project project) {
    this.project = project;
    project.getPluginManager().apply(WarPlugin.class);

    project.getTasks().withType(War.class, warTask -> {
        NamedDomainObjectContainer<WarOverlay> warOverlays = project.container(WarOverlay.class, name -> new WarOverlay(name, warTask));
        warTask.getExtensions().add("overlays", warOverlays);

        Configuration warOverlayClasspath = project.getConfigurations().create(warTask.getName() + "OverlayClasspath");
        warTask.getExtensions().add("overlayClasspath", warOverlayClasspath);

        if (warTask.getName().equals(WarPlugin.WAR_TASK_NAME)) {
            project.getConfigurations().getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(warOverlayClasspath);
            project.getConfigurations().getByName(TEST_IMPLEMENTATION_CONFIGURATION_NAME).extendsFrom(warOverlayClasspath);
        }

        project.afterEvaluate(p -> warOverlays.all(overlay -> {

            if (overlay.isEnabled()) {
                configureOverlay(overlay);
            } else {
                Collection<CopySpecInternal> children = (Collection<CopySpecInternal>) overlay.getWarTask().getRootSpec().getChildren();
                children.remove(overlay.getWarCopySpec());
            }

        }));
    });

}
 
Example #4
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 5 votes vote down vote up
@Override
public void apply(Project project) {
    this.project = project;
    project.getPluginManager().apply(WarPlugin.class);

    project.getTasks().withType(War.class, warTask -> {
        NamedDomainObjectContainer<WarOverlay> warOverlays = project.container(WarOverlay.class, name -> new WarOverlay(name, warTask));
        warTask.getExtensions().add("overlays", warOverlays);

        Configuration warOverlayClasspath = project.getConfigurations().create(warTask.getName() + "OverlayClasspath");
        warTask.getExtensions().add("overlayClasspath", warOverlayClasspath);

        if (warTask.getName().equals(WarPlugin.WAR_TASK_NAME)) {
            project.getConfigurations().getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(warOverlayClasspath);
            project.getConfigurations().getByName(TEST_IMPLEMENTATION_CONFIGURATION_NAME).extendsFrom(warOverlayClasspath);
        }

        project.afterEvaluate(p -> warOverlays.all(overlay -> {

            if (overlay.isEnabled()) {
                configureOverlay(overlay);
            } else {
                Collection<CopySpecInternal> children = (Collection<CopySpecInternal>) overlay.getWarTask().getRootSpec().getChildren();
                children.remove(overlay.getWarCopySpec());
            }

        }));
    });

}
 
Example #5
Source File: Copy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getInstantiator();
    FileResolver fileResolver = getFileResolver();

    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}
 
Example #6
Source File: Copy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getServices().get(Instantiator.class);
    FileResolver fileResolver = getServices().get(FileResolver.class);

    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}