EclipseWtpFacet

API 文件EclipseWtpFacet

啟用微調 Eclipse 外掛的 wtp facet 詳細資訊

在 beforeMerged 和 whenMerged 之前的高階組態閉包接收 WtpFacet 物件作為參數。

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
        }
      }
    }
  }
}

屬性

屬性描述
facets

要新增為元素的 facets。

file

請參閱 EclipseWtpFacet.file(org.gradle.api.Action)

方法

方法描述
facet(args)

新增一個 facet。

file(action)

啟用高階組態,例如修改輸出 XML 或影響現有的 wtp facet 檔案內容與 gradle 建置資訊合併的方式。

腳本區塊

區塊描述
file

啟用高階組態,例如修改輸出 XML 或影響現有的 wtp facet 檔案內容與 gradle 建置資訊合併的方式

屬性詳細資訊

List<Facet> facets

要新增為元素的 facets。

範例請參閱 EclipseWtpFacet 的文件

使用 eclipsewar 外掛的預設值
Java 和 web facets。

方法詳細資訊

void facet(Map<String, ?> args)

新增一個 facet。

如果具有給定名稱的 facet 已存在,則其版本將會更新。

若是 "jst.ejb" facet,它也會被新增為固定的 facet。

範例請參閱 EclipseWtpFacet 的文件

void file(Action<? super XmlFileContentMerger> action)

啟用高階組態,例如修改輸出 XML 或影響現有的 wtp facet 檔案內容與 gradle 建置資訊合併的方式。

範例請參閱 EclipseWtpFacet 的文件

腳本區塊詳細資訊

file { }

啟用高階組態,例如修改輸出 XML 或影響現有的 wtp facet 檔案內容與 gradle 建置資訊合併的方式

傳遞給 whenMerged{} 和 beforeMerged{} 閉包的物件類型為 WtpFacet

範例請參閱 EclipseWtpFacet 的文件