EclipseJdt

API 文档EclipseJdt

允许微调 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

请参阅 EclipseJdt.file(org.gradle.api.Action)

sourceCompatibility

源 Java 语言级别。

targetCompatibility

生成 .class 文件的目标 JVM。

方法

方法描述
file(action)

允许高级配置,例如影响现有 jdt 文件内容与 Gradle 构建信息合并的方式

脚本块

描述
file

允许高级配置,例如影响现有 jdt 文件内容与 Gradle 构建信息合并的方式

属性详情

JavaVersion sourceCompatibility

源 Java 语言级别。

例如,请参阅 EclipseJdt 的文档

默认使用 eclipsejava 插件
project.sourceCompatibility

JavaVersion targetCompatibility

生成 .class 文件的目标 JVM。

例如,请参阅 EclipseJdt 的文档

默认使用 eclipsejava 插件
project.targetCompatibility

方法详情

void file(Action<? super PropertiesFileContentMerger> action)

允许高级配置,例如影响现有 jdt 文件内容与 Gradle 构建信息合并的方式

当传入 whenMerged{} 和 beforeMerged{} 动作的对象类型为 Jdt

传入 withProperties{} 动作的对象类型为 Properties

例如,请参阅 EclipseJdt 的文档

脚本块详情

file { }

允许高级配置,例如影响现有 jdt 文件内容与 Gradle 构建信息合并的方式

当传入 whenMerged{} 和 beforeMerged{} 闭包的对象类型为 Jdt

传入 withProperties{} 闭包的对象类型为 Properties

例如,请参阅 EclipseJdt 的文档

委托给
来自 filePropertiesFileContentMerger