API 文件 | EclipseJdt (Eclipse Jdt) |
---|
啟用 Eclipse 外掛的 jdt 詳細設定
plugins { id 'java' id 'eclipse' } eclipse { jdt { //if you want to alter the java versions (by default they are configured with gradle java plugin settings): sourceCompatibility = 1.6 targetCompatibility = 1.5 javaRuntimeName = "J2SE-1.5" file { //whenMerged closure is the highest voodoo //and probably should be used only to solve tricky edge cases. //the type passed to the closure is Jdt //closure executed after jdt file content is loaded from existing file //and after gradle build information is merged whenMerged { jdt //you can tinker with the Jdt here } //withProperties allows addition of properties not currently //modeled by Gradle withProperties { properties -> //you can tinker with the Properties here } } } }
屬性 | 描述 |
file | |
sourceCompatibility | 來源 Java 語言層級。 |
targetCompatibility | 產生 |
方法 | 描述 |
file(action) | 啟用進階設定,例如影響現有 jdt 檔案內容與 gradle 建置資訊合併的方式 |
區塊 | 描述 |
file | 啟用進階設定,例如影響現有 jdt 檔案內容與 gradle 建置資訊合併的方式 |
JavaVersion
sourceCompatibility
來源 Java 語言層級。
例如,請參閱 EclipseJdt
的文件
- 預設值與
eclipse
和java
外掛程式相同 project.sourceCompatibility
JavaVersion
targetCompatibility
產生 .class
檔案的目標 JVM。
例如,請參閱 EclipseJdt
的文件
- 預設值與
eclipse
和java
外掛程式相同 project.targetCompatibility
void
file
(Action
<? super PropertiesFileContentMerger
>
action)
Action
<? super PropertiesFileContentMerger
>啟用進階設定,例如影響現有 jdt 檔案內容與 gradle 建置資訊合併的方式
傳遞給 whenMerged{} 和 beforeMerged{} 動作的物件類型為 Jdt
傳遞給 withProperties{} 動作的物件類型為 Properties
例如,請參閱 EclipseJdt
的文件
啟用進階設定,例如影響現有 jdt 檔案內容與 gradle 建置資訊合併的方式
傳遞給 whenMerged{} 和 beforeMerged{} 閉包的物件類型為 Jdt
傳遞給 withProperties{} 閉包的物件類型為 Properties
例如,請參閱 EclipseJdt
的文件