EclipseWtpFacet

abstract class EclipseWtpFacet(source)

Enables fine-tuning wtp facet details of the Eclipse plugin

Advanced 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 with WtpFacet 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 the WtpFacet here
        }
      }
    }
  }
}

Constructors

Link copied to clipboard
@Inject
constructor(file: XmlFileContentMerger)

Properties

Link copied to clipboard
open var facets: List<Facet>
Link copied to clipboard

Functions

Link copied to clipboard
open fun facet(args: Map<String, out Any>)
Adds a facet.
Link copied to clipboard
inline fun EclipseWtpFacet.facet(vararg args: Pair<String, Any?>)

Kotlin extension function for org.gradle.plugins.ide.eclipse.model.EclipseWtpFacet.facet.

Link copied to clipboard
open fun file(@DelegatesTo(value = 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 information The object passed to whenMerged{} and beforeMerged{} closures is of type WtpFacet For example see docs for EclipseWtpFacet
open fun file(action: Action<in XmlFileContentMerger>)
Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information.
Link copied to clipboard
open fun mergeXmlFacet(xmlFacet: WtpFacet)