From 4587a94fcf821f9d772eab44e69e8c25f2ae100f Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 2 Nov 2015 10:44:51 -0500 Subject: [PATCH] generate complete eclipse configuration from 'gradle eclipse' --- build.gradle | 6 ++++++ .../org.eclipse.core.resources.prefs | 6 ++++++ .../org.eclipse.jdt.core.prefs | 19 +++++++++++++++++++ .../eclipse.settings/org.eclipse.jdt.ui.prefs | 6 ++++++ 4 files changed, 37 insertions(+) create mode 100644 buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs create mode 100644 buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.core.prefs create mode 100644 buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.ui.prefs diff --git a/build.gradle b/build.gradle index 93406d4965e..9adb3aeb0eb 100644 --- a/build.gradle +++ b/build.gradle @@ -181,10 +181,16 @@ allprojects { task cleanEclipseSettings(type: Delete) { delete '.settings' } + task copyEclipseSettings(type: Copy) { + // TODO: "package this up" for external builds + from new File(project.rootDir, 'buildSrc/src/main/resources/eclipse.settings') + into '.settings' + } // otherwise .settings is not nuked entirely tasks.cleanEclipse.dependsOn(cleanEclipseSettings) // otherwise the eclipse merging is *super confusing* tasks.eclipse.dependsOn(cleanEclipse) + tasks.eclipse.dependsOn(copyEclipseSettings) } diff --git a/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..6fd0a9aab13 --- /dev/null +++ b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 \ No newline at end of file diff --git a/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.core.prefs b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f9b349c46d1 --- /dev/null +++ b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,19 @@ +eclipse.preferences.version=1 + +# previous configuration from maven build +# this is merged with gradle's generated properties during 'gradle eclipse' + +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.formatter.lineSplit=140 +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 diff --git a/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.ui.prefs b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..a42667f8698 --- /dev/null +++ b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +formatter_settings_version=12 +# Intellij IDEA import order +org.eclipse.jdt.ui.importorder=;com;org;java;javax;\#; +# License header +org.eclipse.jdt.ui.text.custom_code_templates= \ No newline at end of file