Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3438

Add eclipse java code formatting as a (command line) gradle task

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.11.0, 2.11.1
    • Fix Version/s: 2.11.2, 2.11.2.0
    • Component/s: Dev and Dep
    • Labels:
      None

      Description

      Our eclipse configured formatting of java code can be added as a gradle task using the gradle "spotless" plugin.

      Since our formatting configuration for eclipse is already separated out into
      .settings/org.eclipse.jdt.core.jalview.prefs
      (so it can always be merged into a freshly made settings file by the gradle eclipse plugin) this formatting can be configured in build.gradle very straightforwardly:

      plugin {
        id 'com.diffplug.gradle.spotless' version '3.24.2'
      }
      spotless {
        java {
          eclipse("4.12.0").configFile eclipse_extra_jdt_prefs_file
        }
      }
      // ("4.12.0" refers to the version number for Eclipse 2019-06)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              soares Ben Soares
              Reporter:
              soares Ben Soares
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: