@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); 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()); } })); }); }
@Override protected CopySpecInternal createRootSpec() { Instantiator instantiator = getInstantiator(); FileResolver fileResolver = getFileResolver(); return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec()); }
@Override protected CopySpecInternal createRootSpec() { Instantiator instantiator = getServices().get(Instantiator.class); FileResolver fileResolver = getServices().get(FileResolver.class); return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec()); }
/** * A location for dependency libraries to include in the 'lib' directory of the EAR archive. */ @Internal public CopySpec getLib() { return ((CopySpecInternal) lib).addChild(); }
protected CopySpecInternal createRootSpec() { Instantiator instantiator = getInstantiator(); FileResolver fileResolver = getFileResolver(); return instantiator.newInstance(DefaultCopySpec.class, fileResolver, instantiator); }
@Internal public CopySpecInternal getRootSpec() { return rootSpec; }
@Internal protected CopySpecInternal getMainSpec() { return mainSpec; }
private static CopySpecInternal pagesCopySpec(Project project) { val githubPages = githubPages(project.getRootProject()); if (githubPages == null) throw new IllegalStateException("No GithubPagesPluginExtension"); return (CopySpecInternal)githubPages.getPages(); }