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

要为其生成文件的目标 JVM .class

方法

方法描述
file(action)

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

脚本块

堵塞描述
file

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

物业详情

JavaVersion sourceCompatibility

源Java语言级别。

例如,请参阅文档EclipseJdt

默认带有eclipsejava插件:
project.sourceCompatibility

JavaVersion targetCompatibility

要为其生成文件的目标 JVM .class

例如,请参阅文档EclipseJdt

默认带有eclipsejava插件:
project.targetCompatibility

方法详情

void file(行动)Action<? super PropertiesFileContentMerger>

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

传递给whenMerged{}和beforeMerged{}操作的对象是类型Jdt

传递给 withProperties{} 操作的对象的类型Properties

例如,请参阅文档EclipseJdt

脚本块详细信息

file{ }

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

传递给whenMerged{}和beforeMerged{}闭包的对象是类型Jdt

传递给 withProperties{} 闭包的对象的类型Properties

例如,请参阅文档EclipseJdt