Class EclipseWtpFacet
- java.lang.Object
-
- org.gradle.plugins.ide.eclipse.model.EclipseWtpFacet
-
public abstract class EclipseWtpFacet extends java.lang.Object
Enables fine-tuning wtp facet details of the Eclipse pluginAdvanced configuration closures beforeMerged and whenMerged receive
WtpFacet
object as parameter.plugins { id 'war' // or 'ear' or 'java' id 'eclipse-wtp' } eclipse { wtp { facet { //you can add some extra wtp facets or update existing ones; mandatory keys: 'name', 'version': facet name: 'someCoolFacet', version: '1.3' file { //if you want to mess with the resulting XML in whatever way you fancy withXml { def node = it.asNode() node.appendNode('xml', 'is what I love') } //beforeMerged and whenMerged closures are the highest voodoo for the tricky edge cases. //the type passed to the closures is
WtpFacet
//closure executed after wtp facet file content is loaded from existing file //but before gradle build information is merged beforeMerged { wtpFacet -> //tinker withWtpFacet
here } //closure executed after wtp facet file content is loaded from existing file //and after gradle build information is merged whenMerged { wtpFacet -> //you can tinker with theWtpFacet
here } } } } }
-
-
Constructor Summary
Constructors Constructor Description EclipseWtpFacet(XmlFileContentMerger file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
facet(java.util.Map<java.lang.String,?> args)
Adds a facet.void
file(Closure closure)
Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build informationvoid
file(Action<? super XmlFileContentMerger> action)
Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information.java.util.List<Facet>
getFacets()
The facets to be added as elements.XmlFileContentMerger
getFile()
Seefile(Action)
void
mergeXmlFacet(WtpFacet xmlFacet)
void
setFacets(java.util.List<Facet> facets)
-
-
-
Constructor Detail
-
EclipseWtpFacet
@Inject public EclipseWtpFacet(XmlFileContentMerger file)
-
-
Method Detail
-
getFile
public XmlFileContentMerger getFile()
Seefile(Action)
-
file
public void file(@DelegatesTo(XmlFileContentMerger.class) Closure closure)
Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build informationThe object passed to whenMerged{} and beforeMerged{} closures is of type
WtpFacet
For example see docs for
EclipseWtpFacet
-
file
public void file(Action<? super XmlFileContentMerger> action)
Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information.For example see docs for
EclipseWtpFacet
- Since:
- 3.5
-
getFacets
public java.util.List<Facet> getFacets()
The facets to be added as elements.For examples see docs for
EclipseWtpFacet
-
setFacets
public void setFacets(java.util.List<Facet> facets)
-
facet
public void facet(java.util.Map<java.lang.String,?> args)
Adds a facet.If a facet already exists with the given name then its version will be updated.
In the case of a "jst.ejb" facet, it will also be added as a fixed facet.
For examples see docs for
EclipseWtpFacet
- Parameters:
args
- A map that must contain a 'name' and 'version' key with corresponding values.
-
mergeXmlFacet
public void mergeXmlFacet(WtpFacet xmlFacet)
-
-