X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=build.gradle;h=e6a9c34edab94d622727c04243dd02c706f4abfd;hb=a3b8fa7024e7034866f6fe6c18c53177fa31c414;hp=519096814b2cffb4c4b653e390fb4fe6b267c534;hpb=b077bc05cf37860f39b16665dfe3140e470b188b;p=jalview.git diff --git a/build.gradle b/build.gradle index 5190968..e6a9c34 100644 --- a/build.gradle +++ b/build.gradle @@ -528,6 +528,7 @@ eclipse { javaRuntimeName = eclipse_java_runtime_name // add in jalview project specific properties/preferences into eclipse core preferences + // and also the codestyle XML file file { withProperties { props -> def jalview_prefs = new Properties() @@ -539,6 +540,22 @@ eclipse { props.putAt(t, v) } } + // codestyle file -- overrides previous formatter prefs + def csFile = file("${jalviewDirAbsolutePath}/${eclipse_codestyle_file}") + if (csFile.exists()) { + XmlParser parser = new XmlParser() + def profiles = parser.parse(csFile) + def profile = profiles.'profile'.find { p -> (p.'@kind' == "CodeFormatterProfile" && p.'@name' == "Jalview") } + if (profile != null) { + profile.'setting'.each { s -> + def id = s.'@id' + def value = s.'@value' + if (id != null && value != null) { + props.putAt(id, value) + } + } + } + } } }