867a5762798f8073d008117335146d15f851d026
[jalview.git] / utils / debian / build_gradle.patch
1 --- a/build.gradle      2021-09-20 17:46:04.088152106 +0100
2 +++ b/build.gradle      2021-09-20 17:46:09.180302062 +0100
3 @@ -2,16 +2,6 @@
4   * For properties set within build.gradle, use camelCaseNoSpace.
5   */
6  import org.apache.tools.ant.filters.ReplaceTokens
7 -import org.gradle.internal.os.OperatingSystem
8 -import org.gradle.plugins.ide.internal.generator.PropertiesPersistableConfigurationObject
9 -import org.gradle.api.internal.PropertiesTransformer
10 -import org.gradle.util.ConfigureUtil
11 -import org.gradle.plugins.ide.eclipse.model.Output
12 -import org.gradle.plugins.ide.eclipse.model.Library
13 -import java.security.MessageDigest
14 -import groovy.transform.ExternalizeMethods
15 -import groovy.util.XmlParser
16 -import groovy.xml.XmlUtil
17  import com.vladsch.flexmark.util.ast.Node
18  import com.vladsch.flexmark.html.HtmlRenderer
19  import com.vladsch.flexmark.parser.Parser
20 @@ -24,34 +14,17 @@
21  import com.vladsch.flexmark.ext.toc.TocExtension
22  
23  buildscript {
24 -  repositories {
25 -    mavenCentral()
26 -    mavenLocal()
27 -  }
28    dependencies {
29      classpath "com.vladsch.flexmark:flexmark-all:0.62.0"
30    }
31  }
32  
33 -
34  plugins {
35    id 'java'
36    id 'application'
37 -  id 'eclipse'
38 -  id "com.diffplug.gradle.spotless" version "3.28.0"
39 -  id 'com.github.johnrengelman.shadow' version '4.0.3'
40 -  id 'com.install4j.gradle' version '8.0.10'
41 -  id 'com.dorongold.task-tree' version '1.5' // only needed to display task dependency tree with  gradle task1 [task2 ...] taskTree
42    id 'com.palantir.git-version' version '0.12.3'
43  }
44  
45 -repositories {
46 -  jcenter()
47 -  mavenCentral()
48 -  mavenLocal()
49 -}
50 -
51 -
52  // in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use
53  def string(Object o) {
54    return o == null ? "" : o.toString()
55 @@ -96,19 +69,11 @@
56    jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
57    jalviewDirRelativePath = jalviewDir
58  
59 -  getdownChannelName = CHANNEL.toLowerCase()
60 -  // default to "default". Currently only has different cosmetics for "develop", "release", "default"
61 -  propertiesChannelName = ["develop", "release", "test-release", "jalviewjs", "jalviewjs-release" ].contains(getdownChannelName) ? getdownChannelName : "default"
62 -  // Import channel_properties
63 +  propertiesChannelName = "release"
64    channelDir = string("${jalviewDir}/${channel_properties_dir}/${propertiesChannelName}")
65    channelGradleProperties = string("${channelDir}/channel_gradle.properties")
66    overrideProperties(channelGradleProperties, false)
67 -  // local build environment properties
68 -  // can be "projectDir/local.properties"
69 -  overrideProperties("${projectDir}/local.properties", true)
70 -  // or "../projectDir_local.properties"
71 -  overrideProperties(projectDir.getParent() + "/" + projectDir.getName() + "_local.properties", true)
72 -
73 +  
74    ////  
75    // Import releaseProps from the RELEASE file
76    // or a file specified via JALVIEW_RELEASE_FILE if defined
77 @@ -128,41 +93,6 @@
78    if (findProperty("JALVIEW_VERSION")==null || "".equals(JALVIEW_VERSION)) {
79      JALVIEW_VERSION = releaseProps.get("jalview.version")
80    }
81 -  
82 -  // this property set when running Eclipse headlessly
83 -  j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
84 -  // this property set by Eclipse
85 -  eclipseApplicationProperty = string("eclipse.application")
86 -  // CHECK IF RUNNING FROM WITHIN ECLIPSE
87 -  def eclipseApplicationPropertyVal = System.properties[eclipseApplicationProperty]
88 -  IN_ECLIPSE = eclipseApplicationPropertyVal != null && eclipseApplicationPropertyVal.startsWith("org.eclipse.ui.")
89 -  // BUT WITHOUT THE HEADLESS BUILD PROPERTY SET
90 -  if (System.properties[j2sHeadlessBuildProperty].equals("true")) {
91 -    println("Setting IN_ECLIPSE to ${IN_ECLIPSE} as System.properties['${j2sHeadlessBuildProperty}'] == '${System.properties[j2sHeadlessBuildProperty]}'")
92 -    IN_ECLIPSE = false
93 -  }
94 -  if (IN_ECLIPSE) {
95 -    println("WITHIN ECLIPSE IDE")
96 -  } else {
97 -    println("HEADLESS BUILD")
98 -  }
99 -  
100 -  J2S_ENABLED = (project.hasProperty('j2s.compiler.status') && project['j2s.compiler.status'] != null && project['j2s.compiler.status'] == "enable")
101 -  if (J2S_ENABLED) {
102 -    println("J2S ENABLED")
103 -  } 
104 -  /* *-/
105 -  System.properties.sort { it.key }.each {
106 -    key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
107 -  }
108 -  /-* *-/
109 -  if (false && IN_ECLIPSE) {
110 -    jalviewDir = jalviewDirAbsolutePath
111 -  }
112 -  */
113 -
114 -  // datestamp
115 -  buildDate = new Date().format("yyyyMMdd")
116  
117    // essentials
118    bareSourceDir = string(source_dir)
119 @@ -173,214 +103,18 @@
120  
121    classesDir = string("${jalviewDir}/${classes_dir}")
122  
123 -  // clover
124 -  useClover = clover.equals("true")
125 -  cloverBuildDir = "${buildDir}/clover"
126 -  cloverInstrDir = file("${cloverBuildDir}/clover-instr")
127 -  cloverClassesDir = file("${cloverBuildDir}/clover-classes")
128 -  cloverReportDir = file("${buildDir}/reports/clover")
129 -  cloverTestInstrDir = file("${cloverBuildDir}/clover-test-instr")
130 -  cloverTestClassesDir = file("${cloverBuildDir}/clover-test-classes")
131 -  //cloverTestClassesDir = cloverClassesDir
132 -  cloverDb = string("${cloverBuildDir}/clover.db")
133 -
134 -  testSourceDir = useClover ? cloverTestInstrDir : testDir
135 -  testClassesDir = useClover ? cloverTestClassesDir : "${jalviewDir}/${test_output_dir}"
136 -
137 -  getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
138 -  buildDist = true
139 -  buildProperties = null
140 -
141 -  // the following values might be overridden by the CHANNEL switch
142 -  getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
143 -  getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
144 -  getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
145 -  getdownAppDistDir = getdown_app_dir_alt
146 -  getdownImagesDir = string("${jalviewDir}/${getdown_images_dir}")
147 +  useClover = false
148 +
149 +  resourceClassesDir = classesDir
150 +
151 +  testSourceDir = testDir
152 +  testClassesDir = "${jalviewDir}/${test_output_dir}"
153 +
154 +  buildProperties = string("${classesDir}/${build_properties_file}")
155    getdownSetAppBaseProperty = false // whether to pass the appbase and appdistdir to the application
156 -  reportRsyncCommand = false
157 -  jvlChannelName = CHANNEL.toLowerCase()
158 -  install4jSuffix = CHANNEL.substring(0, 1).toUpperCase() + CHANNEL.substring(1).toLowerCase(); // BUILD -> Build
159 -  install4jDMGDSStore = "${install4j_images_dir}/${install4j_dmg_ds_store}"
160 -  install4jDMGBackgroundImage = "${install4j_images_dir}/${install4j_dmg_background}"
161 -  install4jInstallerName = "${jalview_name} Non-Release Installer"
162 -  install4jExecutableName = install4j_executable_name
163 -  install4jExtraScheme = "jalviewx"
164 -  install4jMacIconsFile = string("${install4j_images_dir}/${install4j_mac_icons_file}")
165 -  install4jWindowsIconsFile = string("${install4j_images_dir}/${install4j_windows_icons_file}")
166 -  install4jPngIconFile = string("${install4j_images_dir}/${install4j_png_icon_file}")
167 -  install4jBackground = string("${install4j_images_dir}/${install4j_background}")
168 -  switch (CHANNEL) {
169 -
170 -    case "BUILD":
171 -    // TODO: get bamboo build artifact URL for getdown artifacts
172 -    getdown_channel_base = bamboo_channelbase
173 -    getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}")
174 -    getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
175 -    jvlChannelName += "_${getdownChannelName}"
176 -    // automatically add the test group Not-bamboo for exclusion 
177 -    if ("".equals(testng_excluded_groups)) { 
178 -      testng_excluded_groups = "Not-bamboo"
179 -    }
180 -    install4jExtraScheme = "jalviewb"
181 -    break
182  
183 -    case [ "RELEASE", "JALVIEWJS-RELEASE" ]:
184 -    getdownAppDistDir = getdown_app_dir_release
185 -    reportRsyncCommand = true
186 -    install4jSuffix = ""
187 -    install4jInstallerName = "${jalview_name} Installer"
188 -    break
189 -
190 -    case "ARCHIVE":
191 -    getdownChannelName = CHANNEL.toLowerCase()+"/${JALVIEW_VERSION}"
192 -    getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
193 -    getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
194 -    if (!file("${ARCHIVEDIR}/${package_dir}").exists()) {
195 -      throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
196 -    } else {
197 -      package_dir = string("${ARCHIVEDIR}/${package_dir}")
198 -      buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
199 -      buildDist = false
200 -    }
201 -    reportRsyncCommand = true
202 -    install4jExtraScheme = "jalviewa"
203 -    break
204 -
205 -    case "ARCHIVELOCAL":
206 -    getdownChannelName = string("archive/${JALVIEW_VERSION}")
207 -    getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
208 -    getdownAppBase = file(getdownWebsiteDir).toURI().toString()
209 -    if (!file("${ARCHIVEDIR}/${package_dir}").exists()) {
210 -      throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
211 -    } else {
212 -      package_dir = string("${ARCHIVEDIR}/${package_dir}")
213 -      buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
214 -      buildDist = false
215 -    }
216 -    reportRsyncCommand = true
217 -    getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
218 -    install4jSuffix = "Archive"
219 -    install4jExtraScheme = "jalviewa"
220 -    break
221 -
222 -    case "DEVELOP":
223 -    reportRsyncCommand = true
224 -    getdownSetAppBaseProperty = true
225 -    // DEVELOP-RELEASE is usually associated with a Jalview release series so set the version
226 -    JALVIEW_VERSION=JALVIEW_VERSION+"-d${buildDate}"
227 -    
228 -    install4jSuffix = "Develop"
229 -    install4jExtraScheme = "jalviewd"
230 -    install4jInstallerName = "${jalview_name} Develop Installer"
231 -    break
232 -
233 -    case "TEST-RELEASE":
234 -    reportRsyncCommand = true
235 -    // Don't ignore transpile errors for release build
236 -    if (jalviewjs_ignore_transpile_errors.equals("true")) {
237 -      jalviewjs_ignore_transpile_errors = "false"
238 -      println("Setting jalviewjs_ignore_transpile_errors to 'false'")
239 -    }
240 -    JALVIEW_VERSION = JALVIEW_VERSION+"-test"
241 -    install4jSuffix = "Test"
242 -    install4jExtraScheme = "jalviewt"
243 -    install4jInstallerName = "${jalview_name} Test Installer"
244 -    break
245 -
246 -    case ~/^SCRATCH(|-[-\w]*)$/:
247 -    getdownChannelName = CHANNEL
248 -    JALVIEW_VERSION = JALVIEW_VERSION+"-"+CHANNEL
249 -    
250 -    getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
251 -    getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
252 -    reportRsyncCommand = true
253 -    install4jSuffix = "Scratch"
254 -    break
255 -
256 -    case "TEST-LOCAL":
257 -    if (!file("${LOCALDIR}").exists()) {
258 -      throw new GradleException("Must provide a LOCALDIR value to produce a local distribution")
259 -    } else {
260 -      getdownAppBase = file(file("${LOCALDIR}").getAbsolutePath()).toURI().toString()
261 -      getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
262 -    }
263 -    JALVIEW_VERSION = "TEST"
264 -    install4jSuffix = "Test-Local"
265 -    install4jExtraScheme = "jalviewt"
266 -    install4jInstallerName = "${jalview_name} Test Installer"
267 -    break
268 -
269 -    case [ "LOCAL", "JALVIEWJS" ]:
270 -    JALVIEW_VERSION = "TEST"
271 -    getdownAppBase = file(getdownWebsiteDir).toURI().toString()
272 -    getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
273 -    install4jExtraScheme = "jalviewl"
274 -    break
275 -
276 -    default: // something wrong specified
277 -    throw new GradleException("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
278 -    break
279 -
280 -  }
281 -  // override getdownAppBase if requested
282 -  if (findProperty("getdown_appbase_override") != null) {
283 -    // revert to LOCAL if empty string
284 -    if (string(getdown_appbase_override) == "") {
285 -      getdownAppBase = file(getdownWebsiteDir).toURI().toString()
286 -      getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
287 -    } else if (string(getdown_appbase_override).startsWith("file://")) {
288 -      getdownAppBase = string(getdown_appbase_override)
289 -      getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
290 -    } else {
291 -      getdownAppBase = string(getdown_appbase_override)
292 -    }
293 -    println("Overriding getdown appbase with '${getdownAppBase}'")
294 -  }
295 -  // sanitise file name for jalview launcher file for this channel
296 -  jvlChannelName = jvlChannelName.replaceAll("[^\\w\\-]+", "_")
297 -  // install4j application and folder names
298 -  if (install4jSuffix == "") {
299 -    install4jApplicationName = "${jalview_name}"
300 -    install4jBundleId = "${install4j_bundle_id}"
301 -    install4jWinApplicationId = install4j_release_win_application_id
302 -  } else {
303 -    install4jApplicationName = "${jalview_name} ${install4jSuffix}"
304 -    install4jBundleId = "${install4j_bundle_id}-" + install4jSuffix.toLowerCase()
305 -    // add int hash of install4jSuffix to the last part of the application_id
306 -    def id = install4j_release_win_application_id
307 -    def idsplitreverse = id.split("-").reverse()
308 -    idsplitreverse[0] = idsplitreverse[0].toInteger() + install4jSuffix.hashCode()
309 -    install4jWinApplicationId = idsplitreverse.reverse().join("-")
310 -  }
311 -  // sanitise folder and id names
312 -  // install4jApplicationFolder = e.g. "Jalview Build"
313 -  install4jApplicationFolder = install4jApplicationName
314 -                                    .replaceAll("[\"'~:/\\\\\\s]", "_") // replace all awkward filename chars " ' ~ : / \
315 -                                    .replaceAll("_+", "_") // collapse __
316 -  install4jInternalId = install4jApplicationName
317 -                                    .replaceAll(" ","_")
318 -                                    .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
319 -                                    .replaceAll("_+", "") // collapse __
320 -                                    //.replaceAll("_*-_*", "-") // collapse _-_
321 -  install4jUnixApplicationFolder = install4jApplicationName
322 -                                    .replaceAll(" ","_")
323 -                                    .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
324 -                                    .replaceAll("_+", "_") // collapse __
325 -                                    .replaceAll("_*-_*", "-") // collapse _-_
326 -                                    .toLowerCase()
327 -
328 -  getdownWrapperLink = install4jUnixApplicationFolder // e.g. "jalview_local"
329 -  getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
330 -  //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
331 -  getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
332 -  getdownInstallDir = string("${getdownWebsiteDir}/${getdown_install_dir}")
333 -  getdownFilesDir = string("${jalviewDir}/${getdown_files_dir}/${JAVA_VERSION}/")
334 -  getdownFilesInstallDir = string("${getdownFilesDir}/${getdown_install_dir}")
335 -  /* compile without modules -- using classpath libraries
336 -  modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
337 -  modules_runtimeClasspath = modules_compileClasspath
338 -  */
339 +  install4jApplicationName = "${jalview_name}"
340 +  
341    def details = versionDetails()
342    gitHash = details.gitHash
343    gitBranch = details.branchName
344 @@ -396,71 +130,16 @@
345      libDistDir = j8libDir
346      compile_source_compatibility = 1.8
347      compile_target_compatibility = 1.8
348 -    // these are getdown.txt properties defined dependent on the JAVA_VERSION
349 -    getdownAltJavaMinVersion = string(findProperty("getdown_alt_java8_min_version"))
350 -    getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java8_max_version"))
351 -    // this property is assigned below and expanded to multiple lines in the getdown task
352 -    getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java8_txt_multi_java_location"))
353 -    // this property is for the Java library used in eclipse
354 -    eclipseJavaRuntimeName = string("JavaSE-1.8")
355    } else if (JAVA_VERSION.equals("11")) {
356      JAVA_INTEGER_VERSION = string("11")
357      libDir = j11libDir
358      libDistDir = j11libDir
359      compile_source_compatibility = 11
360      compile_target_compatibility = 11
361 -    getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
362 -    getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
363 -    getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
364 -    eclipseJavaRuntimeName = string("JavaSE-11")
365 -    /* compile without modules -- using classpath libraries
366 -    additional_compiler_args += [
367 -    '--module-path', modules_compileClasspath.asPath,
368 -    '--add-modules', j11modules
369 -    ]
370 -     */
371 -  } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
372 -    JAVA_INTEGER_VERSION = JAVA_VERSION
373 -    libDir = j11libDir
374 -    libDistDir = j11libDir
375 -    compile_source_compatibility = JAVA_VERSION
376 -    compile_target_compatibility = JAVA_VERSION
377 -    getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
378 -    getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
379 -    getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
380 -    eclipseJavaRuntimeName = string("JavaSE-11")
381 -    /* compile without modules -- using classpath libraries
382 -    additional_compiler_args += [
383 -    '--module-path', modules_compileClasspath.asPath,
384 -    '--add-modules', j11modules
385 -    ]
386 -     */
387    } else {
388      throw new GradleException("JAVA_VERSION=${JAVA_VERSION} not currently supported by Jalview")
389    }
390  
391 -
392 -  // for install4j
393 -  JAVA_MIN_VERSION = JAVA_VERSION
394 -  JAVA_MAX_VERSION = JAVA_VERSION
395 -  def jreInstallsDir = string(jre_installs_dir)
396 -  if (jreInstallsDir.startsWith("~/")) {
397 -    jreInstallsDir = System.getProperty("user.home") + jreInstallsDir.substring(1)
398 -  }
399 -  macosJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-mac-x64/jre")
400 -  macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-mac-x64.tar.gz")
401 -  windowsJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-windows-x64/jre")
402 -  windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-windows-x64.tar.gz")
403 -  linuxJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-linux-x64/jre")
404 -  linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-linux-x64.tar.gz")
405 -  install4jDir = string("${jalviewDir}/${install4j_utils_dir}")
406 -  install4jConfFileName = string("jalview-install4j-conf.install4j")
407 -  install4jConfFile = file("${install4jDir}/${install4jConfFileName}")
408 -  install4jHomeDir = install4j_home_dir
409 -  if (install4jHomeDir.startsWith("~/")) {
410 -    install4jHomeDir = System.getProperty("user.home") + install4jHomeDir.substring(1)
411 -  }
412 -
413    resourceBuildDir = string("${buildDir}/resources")
414    resourcesBuildDir = string("${resourceBuildDir}/resources_build")
415    helpBuildDir = string("${resourceBuildDir}/help_build")
416 @@ -474,31 +153,6 @@
417    helpSourceDir = string("${helpParentDir}/${help_dir}")
418    helpFile = string("${helpBuildDir}/${help_dir}/help.jhm")
419  
420 -
421 -  relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
422 -  jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
423 -  jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
424 -  if (IN_ECLIPSE) {
425 -    jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
426 -  } else {
427 -    jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
428 -  }
429 -  jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
430 -  jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
431 -  jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
432 -  jalviewjsJalviewCoreHtmlFile = string("")
433 -  jalviewjsJalviewCoreName = string(jalviewjs_core_name)
434 -  jalviewjsCoreClasslists = []
435 -  jalviewjsJalviewTemplateName = string(jalviewjs_name)
436 -  jalviewjsJ2sSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_settings}")
437 -  jalviewjsJ2sAltSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_alt_settings}")
438 -  jalviewjsJ2sProps = null
439 -  jalviewjsJ2sPlugin = jalviewjs_j2s_plugin
440 -
441 -  eclipseWorkspace = null
442 -  eclipseBinary = string("")
443 -  eclipseVersion = string("")
444 -  eclipseDebug = false
445    // ENDEXT
446  }
447  
448 @@ -517,27 +171,12 @@
449      compileClasspath = files(sourceSets.main.java.outputDir)
450      compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
451  
452 -    runtimeClasspath = compileClasspath
453 -    runtimeClasspath += files(sourceSets.main.resources.srcDirs)
454 -  }
455 -
456 -  clover {
457 -    java {
458 -      srcDirs cloverInstrDir
459 -      outputDir = cloverClassesDir
460 -    }
461  
462 -    resources {
463 -      srcDirs = sourceSets.main.resources.srcDirs
464 -    }
465 -
466 -    compileClasspath = files( sourceSets.clover.java.outputDir )
467 -    //compileClasspath += files( testClassesDir )
468 +    compileClasspath = files(sourceSets.main.java.outputDir)
469      compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
470 -    compileClasspath += fileTree(dir: "${jalviewDir}/${clover_lib_dir}", include: ["*.jar"])
471 -    compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["**/*.jar"])
472  
473      runtimeClasspath = compileClasspath
474 +    runtimeClasspath += files(sourceSets.main.resources.srcDirs)
475    }
476  
477    test {
478 @@ -557,453 +196,41 @@
479      runtimeClasspath = compileClasspath
480      runtimeClasspath += files(sourceSets.test.resources.srcDirs)
481    }
482 -
483 -}
484 -
485 -
486 -// eclipse project and settings files creation, also used by buildship
487 -eclipse {
488 -  project {
489 -    name = eclipse_project_name
490 -
491 -    natures 'org.eclipse.jdt.core.javanature',
492 -    'org.eclipse.jdt.groovy.core.groovyNature',
493 -    'org.eclipse.buildship.core.gradleprojectnature'
494 -
495 -    buildCommand 'org.eclipse.jdt.core.javabuilder'
496 -    buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
497 -  }
498 -
499 -  classpath {
500 -    //defaultOutputDir = sourceSets.main.java.outputDir
501 -    configurations.each{ c->
502 -      if (c.isCanBeResolved()) {
503 -        minusConfigurations += [c]
504 -      }
505 -    }
506 -
507 -    plusConfigurations = [ ]
508 -    file {
509 -
510 -      whenMerged { cp ->
511 -        def removeTheseToo = []
512 -        HashMap<String, Boolean> alreadyAddedSrcPath = new HashMap<>();
513 -        cp.entries.each { entry ->
514 -          // This conditional removes all src classpathentries that a) have already been added or b) aren't "src" or "test".
515 -          // e.g. this removes the resources dir being copied into bin/main, bin/test AND bin/clover
516 -          // we add the resources and help/help dirs in as libs afterwards (see below)
517 -          if (entry.kind == 'src') {
518 -            if (alreadyAddedSrcPath.getAt(entry.path) || !(entry.path == bareSourceDir || entry.path == bareTestSourceDir)) {
519 -              removeTheseToo += entry
520 -            } else {
521 -              alreadyAddedSrcPath.putAt(entry.path, true)
522 -            }
523 -          }
524 -
525 -        }
526 -        cp.entries.removeAll(removeTheseToo)
527 -
528 -        //cp.entries += new Output("${eclipse_bin_dir}/main")
529 -        if (file(helpParentDir).isDirectory()) {
530 -          cp.entries += new Library(fileReference(helpParentDir))
531 -        }
532 -        if (file(resourceDir).isDirectory()) {
533 -          cp.entries += new Library(fileReference(resourceDir))
534 -        }
535 -
536 -        HashMap<String, Boolean> alreadyAddedLibPath = new HashMap<>();
537 -
538 -        sourceSets.main.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
539 -          //don't want to add outputDir as eclipse is using its own output dir in bin/main
540 -          if (it.isDirectory() || ! it.exists()) {
541 -            // don't add dirs to classpath, especially if they don't exist
542 -            return false // groovy "continue" in .any closure
543 -          }
544 -          def itPath = it.toString()
545 -          if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
546 -            // make relative path
547 -            itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
548 -          }
549 -          if (alreadyAddedLibPath.get(itPath)) {
550 -            //println("Not adding duplicate entry "+itPath)
551 -          } else {
552 -            //println("Adding entry "+itPath)
553 -            cp.entries += new Library(fileReference(itPath))
554 -            alreadyAddedLibPath.put(itPath, true)
555 -          }
556 -        }
557 -
558 -        sourceSets.test.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
559 -          //no longer want to add outputDir as eclipse is using its own output dir in bin/main
560 -          if (it.isDirectory() || ! it.exists()) {
561 -            // don't add dirs to classpath
562 -            return false // groovy "continue" in .any closure
563 -          }
564 -
565 -          def itPath = it.toString()
566 -          if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
567 -            itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
568 -          }
569 -          if (alreadyAddedLibPath.get(itPath)) {
570 -            // don't duplicate
571 -          } else {
572 -            def lib = new Library(fileReference(itPath))
573 -            lib.entryAttributes["test"] = "true"
574 -            cp.entries += lib
575 -            alreadyAddedLibPath.put(itPath, true)
576 -          }
577 -        }
578 -
579 -      } // whenMerged
580 -
581 -    } // file
582 -
583 -    containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
584 -
585 -  } // classpath
586 -
587 -  jdt {
588 -    // for the IDE, use java 11 compatibility
589 -    sourceCompatibility = compile_source_compatibility
590 -    targetCompatibility = compile_target_compatibility
591 -    javaRuntimeName = eclipseJavaRuntimeName
592 -
593 -    // add in jalview project specific properties/preferences into eclipse core preferences
594 -    file {
595 -      withProperties { props ->
596 -        def jalview_prefs = new Properties()
597 -        def ins = new FileInputStream("${jalviewDirAbsolutePath}/${eclipse_extra_jdt_prefs_file}")
598 -        jalview_prefs.load(ins)
599 -        ins.close()
600 -        jalview_prefs.forEach { t, v ->
601 -          if (props.getAt(t) == null) {
602 -            props.putAt(t, v)
603 -          }
604 -        }
605 -        // codestyle file -- overrides previous formatter prefs
606 -        def csFile = file("${jalviewDirAbsolutePath}/${eclipse_codestyle_file}")
607 -        if (csFile.exists()) {
608 -          XmlParser parser = new XmlParser()
609 -          def profiles = parser.parse(csFile)
610 -          def profile = profiles.'profile'.find { p -> (p.'@kind' == "CodeFormatterProfile" && p.'@name' == "Jalview") }
611 -          if (profile != null) {
612 -            profile.'setting'.each { s ->
613 -              def id = s.'@id'
614 -              def value = s.'@value'
615 -              if (id != null && value != null) {
616 -                props.putAt(id, value)
617 -              }
618 -            }
619 -          }
620 -        }
621 -      }
622 -    }
623 -
624 -  } // jdt
625 -
626 -  if (IN_ECLIPSE) {
627 -    // Don't want these to be activated if in headless build
628 -    synchronizationTasks "eclipseSynchronizationTask"
629 -    //autoBuildTasks "eclipseAutoBuildTask"
630 -
631 -  }
632 -}
633 -
634 -
635 -/* hack to change eclipse prefs in .settings files other than org.eclipse.jdt.core.prefs */
636 -// Class to allow updating arbitrary properties files
637 -class PropertiesFile extends PropertiesPersistableConfigurationObject {
638 -  public PropertiesFile(PropertiesTransformer t) { super(t); }
639 -  @Override protected void load(Properties properties) { }
640 -  @Override protected void store(Properties properties) { }
641 -  @Override protected String getDefaultResourceName() { return ""; }
642 -  // This is necessary, because PropertiesPersistableConfigurationObject fails
643 -  // if no default properties file exists.
644 -  @Override public void loadDefaults() { load(new StringBufferInputStream("")); }
645 -}
646 -
647 -// Task to update arbitrary properties files (set outputFile)
648 -class PropertiesFileTask extends PropertiesGeneratorTask<PropertiesFile> {
649 -  private final PropertiesFileContentMerger file;
650 -  public PropertiesFileTask() { file = new PropertiesFileContentMerger(getTransformer()); }
651 -  protected PropertiesFile create() { return new PropertiesFile(getTransformer()); }
652 -  protected void configure(PropertiesFile props) {
653 -    file.getBeforeMerged().execute(props); file.getWhenMerged().execute(props);
654 -  }
655 -  public void file(Closure closure) { ConfigureUtil.configure(closure, file); }
656 -}
657 -
658 -task eclipseUIPreferences(type: PropertiesFileTask) {
659 -  description = "Generate Eclipse additional settings"
660 -  def filename = "org.eclipse.jdt.ui.prefs"
661 -  outputFile = "$projectDir/.settings/${filename}" as File
662 -  file {
663 -    withProperties {
664 -      it.load new FileInputStream("$projectDir/utils/eclipse/${filename}" as String)
665 + /*  test {
666 +    java {
667 +      srcDirs testSourceDir
668 +      outputDir = file(testClassesDir)
669      }
670 -  }
671 -}
672  
673 -task eclipseGroovyCorePreferences(type: PropertiesFileTask) {
674 -  description = "Generate Eclipse additional settings"
675 -  def filename = "org.eclipse.jdt.groovy.core.prefs"
676 -  outputFile = "$projectDir/.settings/${filename}" as File
677 -  file {
678 -    withProperties {
679 -      it.load new FileInputStream("$projectDir/utils/eclipse/${filename}" as String)
680 +    resources {
681 +      srcDirs = sourceSets.main.resources.srcDirs
682      }
683 -  }
684 -}
685 -
686 -task eclipseAllPreferences {
687 -  dependsOn eclipseJdt
688 -  dependsOn eclipseUIPreferences
689 -  dependsOn eclipseGroovyCorePreferences
690 -}
691 -
692 -eclipseUIPreferences.mustRunAfter eclipseJdt
693 -eclipseGroovyCorePreferences.mustRunAfter eclipseJdt
694 -
695 -/* end of eclipse preferences hack */
696 -
697 -
698 -// clover bits
699 -
700 -
701 -task cleanClover {
702 -  doFirst {
703 -    delete cloverBuildDir
704 -    delete cloverReportDir
705 -  }
706 -}
707 -
708 -
709 -task cloverInstrJava(type: JavaExec) {
710 -  group = "Verification"
711 -  description = "Create clover instrumented source java files"
712 -
713 -  dependsOn cleanClover
714 -
715 -  inputs.files(sourceSets.main.allJava)
716 -  outputs.dir(cloverInstrDir)
717 -
718 -  //classpath = fileTree(dir: "${jalviewDir}/${clover_lib_dir}", include: ["*.jar"])
719 -  classpath = sourceSets.clover.compileClasspath
720 -  main = "com.atlassian.clover.CloverInstr"
721 -
722 -  def argsList = [
723 -    "--encoding",
724 -    "UTF-8",
725 -    "--initstring",
726 -    cloverDb,
727 -    "--destdir",
728 -    cloverInstrDir.getPath(),
729 -  ]
730 -  def srcFiles = sourceSets.main.allJava.files
731 -  argsList.addAll(
732 -    srcFiles.collect(
733 -      { file -> file.absolutePath }
734 -    )
735 -  )
736 -  args argsList.toArray()
737 -
738 -  doFirst {
739 -    delete cloverInstrDir
740 -    println("Clover: About to instrument "+srcFiles.size() +" files")
741 -  }
742 -}
743 -
744 -
745 -task cloverInstrTests(type: JavaExec) {
746 -  group = "Verification"
747 -  description = "Create clover instrumented source test files"
748 -
749 -  dependsOn cleanClover
750 -
751 -  inputs.files(testDir)
752 -  outputs.dir(cloverTestInstrDir)
753 -
754 -  classpath = sourceSets.clover.compileClasspath
755 -  main = "com.atlassian.clover.CloverInstr"
756 -
757 -  def argsList = [
758 -    "--encoding",
759 -    "UTF-8",
760 -    "--initstring",
761 -    cloverDb,
762 -    "--srcdir",
763 -    testDir,
764 -    "--destdir",
765 -    cloverTestInstrDir.getPath(),
766 -  ]
767 -  args argsList.toArray()
768 -
769 -  doFirst {
770 -    delete cloverTestInstrDir
771 -    println("Clover: About to instrument test files")
772 -  }
773 -}
774 -
775 -
776 -task cloverInstr {
777 -  group = "Verification"
778 -  description = "Create clover instrumented all source files"
779 -
780 -  dependsOn cloverInstrJava
781 -  dependsOn cloverInstrTests
782 -}
783 -
784 -
785 -cloverClasses.dependsOn cloverInstr
786 -
787 -
788 -task cloverConsoleReport(type: JavaExec) {
789 -  group = "Verification"
790 -  description = "Creates clover console report"
791 -
792 -  onlyIf {
793 -    file(cloverDb).exists()
794 -  }
795 -
796 -  inputs.dir cloverClassesDir
797 -
798 -  classpath = sourceSets.clover.runtimeClasspath
799 -  main = "com.atlassian.clover.reporters.console.ConsoleReporter"
800 -
801 -  if (cloverreport_mem.length() > 0) {
802 -    maxHeapSize = cloverreport_mem
803 -  }
804 -  if (cloverreport_jvmargs.length() > 0) {
805 -    jvmArgs Arrays.asList(cloverreport_jvmargs.split(" "))
806 -  }
807 -
808 -  def argsList = [
809 -    "--alwaysreport",
810 -    "--initstring",
811 -    cloverDb,
812 -    "--unittests"
813 -  ]
814 -
815 -  args argsList.toArray()
816 -}
817 -
818 -
819 -task cloverHtmlReport(type: JavaExec) {
820 -  group = "Verification"
821 -  description = "Creates clover HTML report"
822 -
823 -  onlyIf {
824 -    file(cloverDb).exists()
825 -  }
826 -
827 -  def cloverHtmlDir = cloverReportDir
828 -  inputs.dir cloverClassesDir
829 -  outputs.dir cloverHtmlDir
830 -
831 -  classpath = sourceSets.clover.runtimeClasspath
832 -  main = "com.atlassian.clover.reporters.html.HtmlReporter"
833 -
834 -  if (cloverreport_mem.length() > 0) {
835 -    maxHeapSize = cloverreport_mem
836 -  }
837 -  if (cloverreport_jvmargs.length() > 0) {
838 -    jvmArgs Arrays.asList(cloverreport_jvmargs.split(" "))
839 -  }
840 -
841 -  def argsList = [
842 -    "--alwaysreport",
843 -    "--initstring",
844 -    cloverDb,
845 -    "--outputdir",
846 -    cloverHtmlDir
847 -  ]
848 -
849 -  if (cloverreport_html_options.length() > 0) {
850 -    argsList += cloverreport_html_options.split(" ")
851 -  }
852 -
853 -  args argsList.toArray()
854 -}
855 -
856 -
857 -task cloverXmlReport(type: JavaExec) {
858 -  group = "Verification"
859 -  description = "Creates clover XML report"
860 -
861 -  onlyIf {
862 -    file(cloverDb).exists()
863 -  }
864 -
865 -  def cloverXmlFile = "${cloverReportDir}/clover.xml"
866 -  inputs.dir cloverClassesDir
867 -  outputs.file cloverXmlFile
868 -
869 -  classpath = sourceSets.clover.runtimeClasspath
870 -  main = "com.atlassian.clover.reporters.xml.XMLReporter"
871 -
872 -  if (cloverreport_mem.length() > 0) {
873 -    maxHeapSize = cloverreport_mem
874 -  }
875 -  if (cloverreport_jvmargs.length() > 0) {
876 -    jvmArgs Arrays.asList(cloverreport_jvmargs.split(" "))
877 -  }
878 -
879 -  def argsList = [
880 -    "--alwaysreport",
881 -    "--initstring",
882 -    cloverDb,
883 -    "--outfile",
884 -    cloverXmlFile
885 -  ]
886 -
887 -  if (cloverreport_xml_options.length() > 0) {
888 -    argsList += cloverreport_xml_options.split(" ")
889 -  }
890  
891 -  args argsList.toArray()
892 -}
893 -
894 -
895 -task cloverReport {
896 -  group = "Verification"
897 -  description = "Creates clover reports"
898 -
899 -  dependsOn cloverXmlReport
900 -  dependsOn cloverHtmlReport
901 -}
902 -
903 -
904 -compileCloverJava {
905 +    compileClasspath = files( sourceSets.test.java.outputDir )
906 +    compileClasspath += sourceSets.main.compileClasspath
907 +    compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["**   REMOVE_THIS_GAP  /*.jar"])
908  
909 -  doFirst {
910 -    sourceCompatibility = compile_source_compatibility
911 -    targetCompatibility = compile_target_compatibility
912 -    options.compilerArgs += additional_compiler_args
913 -    print ("Setting target compatibility to "+targetCompatibility+"\n")
914 +    runtimeClasspath = compileClasspath
915    }
916 -  //classpath += configurations.cloverRuntime
917 +*/
918  }
919 -// end clover bits
920  
921  
922  compileJava {
923 -  // JBP->BS should the print statement in doFirst refer to compile_target_compatibility ?
924    sourceCompatibility = compile_source_compatibility
925    targetCompatibility = compile_target_compatibility
926    options.compilerArgs = additional_compiler_args
927 -  options.encoding = "UTF-8"
928    doFirst {
929      print ("Setting target compatibility to "+compile_target_compatibility+"\n")
930    }
931 -
932  }
933  
934  
935  compileTestJava {
936 -  sourceCompatibility = compile_source_compatibility
937 -  targetCompatibility = compile_target_compatibility
938 -  options.compilerArgs = additional_compiler_args
939    doFirst {
940 +    sourceCompatibility = compile_source_compatibility
941 +    targetCompatibility = compile_target_compatibility
942 +    options.compilerArgs = additional_compiler_args
943      print ("Setting target compatibility to "+targetCompatibility+"\n")
944    }
945  }
946 @@ -1017,7 +244,6 @@
947  
948  
949  cleanTest {
950 -  dependsOn cleanClover
951    doFirst {
952      delete sourceSets.test.java.outputDir
953    }
954 @@ -1306,12 +532,7 @@
955  //testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
956  test {
957    dependsOn prepare
958 -
959 -  if (useClover) {
960 -    dependsOn cloverClasses
961 -   } else { //?
962 -    dependsOn compileJava //?
963 -  }
964 +  dependsOn compileJava //?
965  
966    useTestNG() {
967      includeGroups testng_groups
968 @@ -1323,6 +544,7 @@
969    maxHeapSize = "1024m"
970  
971    workingDir = jalviewDir
972 +  //systemProperties 'clover.jar' System.properties.clover.jar
973    def testLaf = project.findProperty("test_laf")
974    if (testLaf != null) {
975      println("Setting Test LaF to '${testLaf}'")
976 @@ -1338,9 +560,6 @@
977    jvmArgs += additional_compiler_args
978  
979    doFirst {
980 -    if (useClover) {
981 -      println("Running tests " + (useClover?"WITH":"WITHOUT") + " clover")
982 -    }
983    }
984  }
985  
986 @@ -1420,1752 +639,7 @@
987    sourceSets.main.resources.srcDirs.each{ dir ->
988      inputs.dir(dir)
989    }
990 -  outputs.file("${outputDir}/${archiveFileName}")
991 -}
992 -
993 -
994 -task copyJars(type: Copy) {
995 -  from fileTree(dir: classesDir, include: "**/*.jar").files
996 -  into "${jalviewDir}/${package_dir}"
997 -}
998 -
999 -
1000 -// doing a Sync instead of Copy as Copy doesn't deal with "outputs" very well
1001 -task syncJars(type: Sync) {
1002 -  dependsOn jar
1003 -  from fileTree(dir: "${jalviewDir}/${libDistDir}", include: "**/*.jar").files
1004 -  into "${jalviewDir}/${package_dir}"
1005 -  preserve {
1006 -    include jar.archiveFileName.getOrNull()
1007 -  }
1008 -}
1009 -
1010 -
1011 -task makeDist {
1012 -  group = "build"
1013 -  description = "Put all required libraries in dist"
1014 -  // order of "cleanPackageDir", "copyJars", "jar" important!
1015 -  jar.mustRunAfter cleanPackageDir
1016 -  syncJars.mustRunAfter cleanPackageDir
1017 -  dependsOn cleanPackageDir
1018 -  dependsOn syncJars
1019 -  dependsOn jar
1020 -  outputs.dir("${jalviewDir}/${package_dir}")
1021 -}
1022 -
1023 -
1024 -task cleanDist {
1025 -  dependsOn cleanPackageDir
1026 -  dependsOn cleanTest
1027 -  dependsOn clean
1028 -}
1029 -
1030 -
1031 -shadowJar {
1032 -  group = "distribution"
1033 -  description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar"
1034 -  if (buildDist) {
1035 -    dependsOn makeDist
1036 -  }
1037 -  from ("${jalviewDir}/${libDistDir}") {
1038 -    include("*.jar")
1039 -  }
1040 -  manifest {
1041 -    attributes "Implementation-Version": JALVIEW_VERSION,
1042 -    "Application-Name": install4jApplicationName
1043 -  }
1044 -  mainClassName = shadow_jar_main_class
1045 -  mergeServiceFiles()
1046 -  classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION
1047 -  minimize()
1048 -}
1049 -
1050 -
1051 -task getdownWebsite() {
1052 -  group = "distribution"
1053 -  description = "Create the getdown minimal app folder, and website folder for this version of jalview. Website folder also used for offline app installer"
1054 -  if (buildDist) {
1055 -    dependsOn makeDist
1056 -  }
1057 -
1058 -  def getdownWebsiteResourceFilenames = []
1059 -  def getdownTextString = ""
1060 -  def getdownResourceDir = getdownResourceDir
1061 -  def getdownResourceFilenames = []
1062 -
1063 -  doFirst {
1064 -    // clean the getdown website and files dir before creating getdown folders
1065 -    delete getdownWebsiteDir
1066 -    delete getdownFilesDir
1067 -
1068 -    copy {
1069 -      from buildProperties
1070 -      rename(file(buildProperties).getName(), getdown_build_properties)
1071 -      into getdownAppDir
1072 -    }
1073 -    getdownWebsiteResourceFilenames += "${getdownAppDistDir}/${getdown_build_properties}"
1074 -
1075 -    // set some getdown_txt_ properties then go through all properties looking for getdown_txt_...
1076 -    def props = project.properties.sort { it.key }
1077 -    if (getdownAltJavaMinVersion != null && getdownAltJavaMinVersion.length() > 0) {
1078 -      props.put("getdown_txt_java_min_version", getdownAltJavaMinVersion)
1079 -    }
1080 -    if (getdownAltJavaMaxVersion != null && getdownAltJavaMaxVersion.length() > 0) {
1081 -      props.put("getdown_txt_java_max_version", getdownAltJavaMaxVersion)
1082 -    }
1083 -    if (getdownAltMultiJavaLocation != null && getdownAltMultiJavaLocation.length() > 0) {
1084 -      props.put("getdown_txt_multi_java_location", getdownAltMultiJavaLocation)
1085 -    }
1086 -    if (getdownImagesDir != null && file(getdownImagesDir).exists()) {
1087 -      props.put("getdown_txt_ui.background_image", "${getdownImagesDir}/${getdown_background_image}")
1088 -      props.put("getdown_txt_ui.instant_background_image", "${getdownImagesDir}/${getdown_instant_background_image}")
1089 -      props.put("getdown_txt_ui.error_background", "${getdownImagesDir}/${getdown_error_background}")
1090 -      props.put("getdown_txt_ui.progress_image", "${getdownImagesDir}/${getdown_progress_image}")
1091 -      props.put("getdown_txt_ui.icon", "${getdownImagesDir}/${getdown_icon}")
1092 -      props.put("getdown_txt_ui.mac_dock_icon", "${getdownImagesDir}/${getdown_mac_dock_icon}")
1093 -    }
1094 -
1095 -    props.put("getdown_txt_title", jalview_name)
1096 -    props.put("getdown_txt_ui.name", install4jApplicationName)
1097 -
1098 -    // start with appbase
1099 -    getdownTextString += "appbase = ${getdownAppBase}\n"
1100 -    props.each{ prop, val ->
1101 -      if (prop.startsWith("getdown_txt_") && val != null) {
1102 -        if (prop.startsWith("getdown_txt_multi_")) {
1103 -          def key = prop.substring(18)
1104 -          val.split(",").each{ v ->
1105 -            def line = "${key} = ${v}\n"
1106 -            getdownTextString += line
1107 -          }
1108 -        } else {
1109 -          // file values rationalised
1110 -          if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
1111 -            def r = null
1112 -            if (val.indexOf('/') == 0) {
1113 -              // absolute path
1114 -              r = file(val)
1115 -            } else if (val.indexOf('/') > 0) {
1116 -              // relative path (relative to jalviewDir)
1117 -              r = file( "${jalviewDir}/${val}" )
1118 -            }
1119 -            if (r.exists()) {
1120 -              val = "${getdown_resource_dir}/" + r.getName()
1121 -              getdownWebsiteResourceFilenames += val
1122 -              getdownResourceFilenames += r.getPath()
1123 -            }
1124 -          }
1125 -          if (! prop.startsWith("getdown_txt_resource")) {
1126 -            def line = prop.substring(12) + " = ${val}\n"
1127 -            getdownTextString += line
1128 -          }
1129 -        }
1130 -      }
1131 -    }
1132 -
1133 -    getdownWebsiteResourceFilenames.each{ filename ->
1134 -      getdownTextString += "resource = ${filename}\n"
1135 -    }
1136 -    getdownResourceFilenames.each{ filename ->
1137 -      copy {
1138 -        from filename
1139 -        into getdownResourceDir
1140 -      }
1141 -    }
1142 -    
1143 -    def getdownWrapperScripts = [ getdown_bash_wrapper_script, getdown_powershell_wrapper_script, getdown_batch_wrapper_script ]
1144 -    getdownWrapperScripts.each{ script ->
1145 -      def s = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${script}" )
1146 -      if (s.exists()) {
1147 -        copy {
1148 -          from s
1149 -          into "${getdownWebsiteDir}/${getdown_wrapper_script_dir}"
1150 -        }
1151 -        getdownTextString += "resource = ${getdown_wrapper_script_dir}/${script}\n"
1152 -      }
1153 -    }
1154 -
1155 -    def codeFiles = []
1156 -    fileTree(file(package_dir)).each{ f ->
1157 -      if (f.isDirectory()) {
1158 -        def files = fileTree(dir: f, include: ["*"]).getFiles()
1159 -        codeFiles += files
1160 -      } else if (f.exists()) {
1161 -        codeFiles += f
1162 -      }
1163 -    }
1164 -    codeFiles.sort().each{f ->
1165 -      def name = f.getName()
1166 -      def line = "code = ${getdownAppDistDir}/${name}\n"
1167 -      getdownTextString += line
1168 -      copy {
1169 -        from f.getPath()
1170 -        into getdownAppDir
1171 -      }
1172 -    }
1173 -
1174 -    // NOT USING MODULES YET, EVERYTHING SHOULD BE IN dist
1175 -    /*
1176 -    if (JAVA_VERSION.equals("11")) {
1177 -    def j11libFiles = fileTree(dir: "${jalviewDir}/${j11libDir}", include: ["*.jar"]).getFiles()
1178 -    j11libFiles.sort().each{f ->
1179 -    def name = f.getName()
1180 -    def line = "code = ${getdown_j11lib_dir}/${name}\n"
1181 -    getdownTextString += line
1182 -    copy {
1183 -    from f.getPath()
1184 -    into getdownJ11libDir
1185 -    }
1186 -    }
1187 -    }
1188 -     */
1189 -
1190 -    // getdown-launcher.jar should not be in main application class path so the main application can move it when updated.  Listed as a resource so it gets updated.
1191 -    //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
1192 -    getdownTextString += "resource = ${getdown_launcher_new}\n"
1193 -    getdownTextString += "class = ${main_class}\n"
1194 -    // Not setting these properties in general so that getdownappbase and getdowndistdir will default to release version in jalview.bin.Cache
1195 -    if (getdownSetAppBaseProperty) {
1196 -      getdownTextString += "jvmarg = -Dgetdowndistdir=${getdownAppDistDir}\n"
1197 -      getdownTextString += "jvmarg = -Dgetdownappbase=${getdownAppBase}\n"
1198 -    }
1199 -
1200 -    def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
1201 -    getdown_txt.write(getdownTextString)
1202 -
1203 -    def getdownLaunchJvl = getdown_launch_jvl_name + ( (jvlChannelName != null && jvlChannelName.length() > 0)?"-${jvlChannelName}":"" ) + ".jvl"
1204 -    def launchJvl = file("${getdownWebsiteDir}/${getdownLaunchJvl}")
1205 -    launchJvl.write("appbase=${getdownAppBase}")
1206 -
1207 -    // files going into the getdown website dir: getdown-launcher.jar
1208 -    copy {
1209 -      from getdownLauncher
1210 -      rename(file(getdownLauncher).getName(), getdown_launcher_new)
1211 -      into getdownWebsiteDir
1212 -    }
1213 -
1214 -    // files going into the getdown website dir: getdown-launcher(-local).jar
1215 -    copy {
1216 -      from getdownLauncher
1217 -      if (file(getdownLauncher).getName() != getdown_launcher) {
1218 -        rename(file(getdownLauncher).getName(), getdown_launcher)
1219 -      }
1220 -      into getdownWebsiteDir
1221 -    }
1222 -
1223 -    // files going into the getdown website dir: ./install dir and files
1224 -    if (! (CHANNEL.startsWith("ARCHIVE") || CHANNEL.startsWith("DEVELOP"))) {
1225 -      copy {
1226 -        from getdown_txt
1227 -        from getdownLauncher
1228 -        from "${getdownAppDir}/${getdown_build_properties}"
1229 -        if (file(getdownLauncher).getName() != getdown_launcher) {
1230 -          rename(file(getdownLauncher).getName(), getdown_launcher)
1231 -        }
1232 -        into getdownInstallDir
1233 -      }
1234 -
1235 -      // and make a copy in the getdown files dir (these are not downloaded by getdown)
1236 -      copy {
1237 -        from getdownInstallDir
1238 -        into getdownFilesInstallDir
1239 -      }
1240 -    }
1241 -
1242 -    // files going into the getdown files dir: getdown.txt, getdown-launcher.jar, channel-launch.jvl, build_properties
1243 -    copy {
1244 -      from getdown_txt
1245 -      from launchJvl
1246 -      from getdownLauncher
1247 -      from "${getdownWebsiteDir}/${getdown_build_properties}"
1248 -      if (file(getdownLauncher).getName() != getdown_launcher) {
1249 -        rename(file(getdownLauncher).getName(), getdown_launcher)
1250 -      }
1251 -      into getdownFilesDir
1252 -    }
1253 -
1254 -    // and ./resources (not all downloaded by getdown)
1255 -    copy {
1256 -      from getdownResourceDir
1257 -      into "${getdownFilesDir}/${getdown_resource_dir}"
1258 -    }
1259 -  }
1260 -
1261 -  if (buildDist) {
1262 -    inputs.dir("${jalviewDir}/${package_dir}")
1263 -  }
1264 -  outputs.dir(getdownWebsiteDir)
1265 -  outputs.dir(getdownFilesDir)
1266 -}
1267 -
1268 -
1269 -// a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir
1270 -task getdownDigestDir(type: JavaExec) {
1271 -  group "Help"
1272 -  description "A task to run a getdown Digest on a dir with getdown.txt. Provide a DIGESTDIR property via -PDIGESTDIR=..."
1273 -
1274 -  def digestDirPropertyName = "DIGESTDIR"
1275 -  doFirst {
1276 -    classpath = files(getdownLauncher)
1277 -    def digestDir = findProperty(digestDirPropertyName)
1278 -    if (digestDir == null) {
1279 -      throw new GradleException("Must provide a DIGESTDIR value to produce an alternative getdown digest")
1280 -    }
1281 -    args digestDir
1282 -  }
1283 -  main = "com.threerings.getdown.tools.Digester"
1284 -}
1285 -
1286 -
1287 -task getdownDigest(type: JavaExec) {
1288 -  group = "distribution"
1289 -  description = "Digest the getdown website folder"
1290 -  dependsOn getdownWebsite
1291 -  doFirst {
1292 -    classpath = files(getdownLauncher)
1293 -  }
1294 -  main = "com.threerings.getdown.tools.Digester"
1295 -  args getdownWebsiteDir
1296 -  inputs.dir(getdownWebsiteDir)
1297 -  outputs.file("${getdownWebsiteDir}/digest2.txt")
1298 -}
1299 -
1300 -
1301 -task getdown() {
1302 -  group = "distribution"
1303 -  description = "Create the minimal and full getdown app folder for installers and website and create digest file"
1304 -  dependsOn getdownDigest
1305 -  doLast {
1306 -    if (reportRsyncCommand) {
1307 -      def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith('/')?'':'/')
1308 -      def toDir = "${getdown_rsync_dest}/${getdownDir}" + (getdownDir.endsWith('/')?'':'/')
1309 -      println "LIKELY RSYNC COMMAND:"
1310 -      println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'"
1311 -      if (RUNRSYNC == "true") {
1312 -        exec {
1313 -          commandLine "mkdir", "-p", toDir
1314 -        }
1315 -        exec {
1316 -          commandLine "rsync", "-avh", "--delete", fromDir, toDir
1317 -        }
1318 -      }
1319 -    }
1320 -  }
1321 -}
1322 -
1323 -
1324 -tasks.withType(JavaCompile) {
1325 -       options.encoding = 'UTF-8'
1326 -}
1327 -
1328 -
1329 -clean {
1330 -  doFirst {
1331 -    delete getdownWebsiteDir
1332 -    delete getdownFilesDir
1333 -  }
1334 -}
1335 -
1336 -
1337 -install4j {
1338 -  if (file(install4jHomeDir).exists()) {
1339 -    // good to go!
1340 -  } else if (file(System.getProperty("user.home")+"/buildtools/install4j").exists()) {
1341 -    install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
1342 -  } else if (file("/Applications/install4j.app/Contents/Resources/app").exists()) {
1343 -    install4jHomeDir = "/Applications/install4j.app/Contents/Resources/app"
1344 -  }
1345 -  installDir(file(install4jHomeDir))
1346 -
1347 -  mediaTypes = Arrays.asList(install4j_media_types.split(","))
1348 -}
1349 -
1350 -
1351 -task copyInstall4jTemplate {
1352 -  def install4jTemplateFile = file("${install4jDir}/${install4j_template}")
1353 -  def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}")
1354 -  inputs.file(install4jTemplateFile)
1355 -  inputs.file(install4jFileAssociationsFile)
1356 -  inputs.property("CHANNEL", { CHANNEL })
1357 -  outputs.file(install4jConfFile)
1358 -
1359 -  doLast {
1360 -    def install4jConfigXml = new XmlParser().parse(install4jTemplateFile)
1361 -
1362 -    // turn off code signing if no OSX_KEYPASS
1363 -    if (OSX_KEYPASS == "") {
1364 -      install4jConfigXml.'**'.codeSigning.each { codeSigning ->
1365 -        codeSigning.'@macEnabled' = "false"
1366 -      }
1367 -      install4jConfigXml.'**'.windows.each { windows ->
1368 -        windows.'@runPostProcessor' = "false"
1369 -      }
1370 -    }
1371 -
1372 -    // turn off checksum creation for LOCAL channel
1373 -    def e = install4jConfigXml.application[0]
1374 -    if (CHANNEL == "LOCAL") {
1375 -      e.'@createChecksums' = "false"
1376 -    } else {
1377 -      e.'@createChecksums' = "true"
1378 -    }
1379 -
1380 -    // put file association actions where placeholder action is
1381 -    def install4jFileAssociationsText = install4jFileAssociationsFile.text
1382 -    def fileAssociationActions = new XmlParser().parseText("<actions>${install4jFileAssociationsText}</actions>")
1383 -    install4jConfigXml.'**'.action.any { a -> // .any{} stops after the first one that returns true
1384 -      if (a.'@name' == 'EXTENSIONS_REPLACED_BY_GRADLE') {
1385 -        def parent = a.parent()
1386 -        parent.remove(a)
1387 -        fileAssociationActions.each { faa ->
1388 -            parent.append(faa)
1389 -        }
1390 -        // don't need to continue in .any loop once replacements have been made
1391 -        return true
1392 -      }
1393 -    }
1394 -
1395 -    // use Windows Program Group with Examples folder for RELEASE, and Program Group without Examples for everything else
1396 -    // NB we're deleting the /other/ one!
1397 -    // Also remove the examples subdir from non-release versions
1398 -    def customizedIdToDelete = "PROGRAM_GROUP_RELEASE"
1399 -    // 2.11.1.0 NOT releasing with the Examples folder in the Program Group
1400 -    if (false && CHANNEL=="RELEASE") { // remove 'false && ' to include Examples folder in RELEASE channel
1401 -      customizedIdToDelete = "PROGRAM_GROUP_NON_RELEASE"
1402 -    } else {
1403 -      // remove the examples subdir from Full File Set
1404 -      def files = install4jConfigXml.files[0]
1405 -      def fileset = files.filesets.fileset.find { fs -> fs.'@customizedId' == "FULL_FILE_SET" }
1406 -      def root = files.roots.root.find { r -> r.'@fileset' == fileset.'@id' }
1407 -      def mountPoint = files.mountPoints.mountPoint.find { mp -> mp.'@root' == root.'@id' }
1408 -      def dirEntry = files.entries.dirEntry.find { de -> de.'@mountPoint' == mountPoint.'@id' && de.'@subDirectory' == "examples" }
1409 -      dirEntry.parent().remove(dirEntry)
1410 -    }
1411 -    install4jConfigXml.'**'.action.any { a ->
1412 -      if (a.'@customizedId' == customizedIdToDelete) {
1413 -        def parent = a.parent()
1414 -        parent.remove(a)
1415 -        return true
1416 -      }
1417 -    }
1418 -
1419 -    // write install4j file
1420 -    install4jConfFile.text = XmlUtil.serialize(install4jConfigXml)
1421 -  }
1422 -}
1423 -
1424 -
1425 -clean {
1426 -  doFirst {
1427 -    delete install4jConfFile
1428 -  }
1429 -}
1430 -
1431 -
1432 -task installers(type: com.install4j.gradle.Install4jTask) {
1433 -  group = "distribution"
1434 -  description = "Create the install4j installers"
1435 -  dependsOn getdown
1436 -  dependsOn copyInstall4jTemplate
1437 -
1438 -  projectFile = install4jConfFile
1439 -
1440 -  // create an md5 for the input files to use as version for install4j conf file
1441 -  def digest = MessageDigest.getInstance("MD5")
1442 -  digest.update(
1443 -    (file("${install4jDir}/${install4j_template}").text + 
1444 -    file("${install4jDir}/${install4j_info_plist_file_associations}").text +
1445 -    file("${install4jDir}/${install4j_installer_file_associations}").text).bytes)
1446 -  def filesMd5 = new BigInteger(1, digest.digest()).toString(16)
1447 -  if (filesMd5.length() >= 8) {
1448 -    filesMd5 = filesMd5.substring(0,8)
1449 -  }
1450 -  def install4jTemplateVersion = "${JALVIEW_VERSION}_F${filesMd5}_C${gitHash}"
1451 -  // make install4jBuildDir relative to jalviewDir
1452 -  def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
1453 -
1454 -  variables = [
1455 -    'JALVIEW_NAME': jalview_name,
1456 -    'JALVIEW_APPLICATION_NAME': install4jApplicationName,
1457 -    'JALVIEW_DIR': "../..",
1458 -    'OSX_KEYSTORE': OSX_KEYSTORE,
1459 -    'OSX_APPLEID': OSX_APPLEID,
1460 -    'OSX_ALTOOLPASS': OSX_ALTOOLPASS,
1461 -    'JSIGN_SH': JSIGN_SH,
1462 -    'JRE_DIR': getdown_app_dir_java,
1463 -    'INSTALLER_TEMPLATE_VERSION': install4jTemplateVersion,
1464 -    'JALVIEW_VERSION': JALVIEW_VERSION,
1465 -    'JAVA_MIN_VERSION': JAVA_MIN_VERSION,
1466 -    'JAVA_MAX_VERSION': JAVA_MAX_VERSION,
1467 -    'JAVA_VERSION': JAVA_VERSION,
1468 -    'JAVA_INTEGER_VERSION': JAVA_INTEGER_VERSION,
1469 -    'VERSION': JALVIEW_VERSION,
1470 -    'MACOS_JAVA_VM_DIR': macosJavaVMDir,
1471 -    'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir,
1472 -    'LINUX_JAVA_VM_DIR': linuxJavaVMDir,
1473 -    'MACOS_JAVA_VM_TGZ': macosJavaVMTgz,
1474 -    'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz,
1475 -    'LINUX_JAVA_VM_TGZ': linuxJavaVMTgz,
1476 -    'COPYRIGHT_MESSAGE': install4j_copyright_message,
1477 -    'BUNDLE_ID': install4jBundleId,
1478 -    'INTERNAL_ID': install4jInternalId,
1479 -    'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
1480 -    'MACOS_DMG_DS_STORE': install4jDMGDSStore,
1481 -    'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
1482 -    'WRAPPER_LINK': getdownWrapperLink,
1483 -    'BASH_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
1484 -    'POWERSHELL_WRAPPER_SCRIPT': getdown_powershell_wrapper_script,
1485 -    'WRAPPER_SCRIPT_BIN_DIR': getdown_wrapper_script_dir,
1486 -    'INSTALLER_NAME': install4jInstallerName,
1487 -    'INSTALL4J_UTILS_DIR': install4j_utils_dir,
1488 -    'GETDOWN_WEBSITE_DIR': getdown_website_dir,
1489 -    'GETDOWN_FILES_DIR': getdown_files_dir,
1490 -    'GETDOWN_RESOURCE_DIR': getdown_resource_dir,
1491 -    'GETDOWN_DIST_DIR': getdownAppDistDir,
1492 -    'GETDOWN_ALT_DIR': getdown_app_dir_alt,
1493 -    'GETDOWN_INSTALL_DIR': getdown_install_dir,
1494 -    'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
1495 -    'BUILD_DIR': install4jBuildDir,
1496 -    'APPLICATION_CATEGORIES': install4j_application_categories,
1497 -    'APPLICATION_FOLDER': install4jApplicationFolder,
1498 -    'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
1499 -    'EXECUTABLE_NAME': install4jExecutableName,
1500 -    'EXTRA_SCHEME': install4jExtraScheme,
1501 -    'MAC_ICONS_FILE': install4jMacIconsFile,
1502 -    'WINDOWS_ICONS_FILE': install4jWindowsIconsFile,
1503 -    'PNG_ICON_FILE': install4jPngIconFile,
1504 -    'BACKGROUND': install4jBackground,
1505 -
1506 -  ]
1507 -
1508 -  //println("INSTALL4J VARIABLES:")
1509 -  //variables.each{k,v->println("${k}=${v}")}
1510 -
1511 -  destination = "${jalviewDir}/${install4jBuildDir}"
1512 -  buildSelected = true
1513 -
1514 -  if (install4j_faster.equals("true") || CHANNEL.startsWith("LOCAL")) {
1515 -    faster = true
1516 -    disableSigning = true
1517 -    disableNotarization = true
1518 -  }
1519 -
1520 -  if (OSX_KEYPASS) {
1521 -    macKeystorePassword = OSX_KEYPASS
1522 -  } 
1523 -  
1524 -  if (OSX_ALTOOLPASS) {
1525 -    appleIdPassword = OSX_ALTOOLPASS
1526 -    disableNotarization = false
1527 -  } else {
1528 -    disableNotarization = true
1529 -  }
1530 -
1531 -  doFirst {
1532 -    println("Using projectFile "+projectFile)
1533 -    if (!disableNotarization) { println("Will notarize OSX App DMG") }
1534 -  }
1535 -  //verbose=true
1536 -
1537 -  inputs.dir(getdownWebsiteDir)
1538 -  inputs.file(install4jConfFile)
1539 -  inputs.file("${install4jDir}/${install4j_info_plist_file_associations}")
1540 -  inputs.dir(macosJavaVMDir)
1541 -  inputs.dir(windowsJavaVMDir)
1542 -  outputs.dir("${jalviewDir}/${install4j_build_dir}/${JAVA_VERSION}")
1543 -}
1544 -
1545 -
1546 -spotless {
1547 -  java {
1548 -    eclipse().configFile(eclipse_codestyle_file)
1549 -  }
1550 -}
1551 -
1552 -
1553 -task sourceDist(type: Tar) {
1554 -  group "distribution"
1555 -  description "Create a source .tar.gz file for distribution"
1556 -
1557 -  dependsOn createBuildProperties
1558 -  dependsOn convertMdFiles
1559 -
1560 -  def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
1561 -  def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
1562 -  archiveFileName = outputFileName
1563 -  
1564 -  compression Compression.GZIP
1565 -  
1566 -  into project.name
1567 -
1568 -  def EXCLUDE_FILES=[
1569 -    "build/*",
1570 -    "bin/*",
1571 -    "test-output/",
1572 -    "test-reports",
1573 -    "tests",
1574 -    "clover*/*",
1575 -    ".*",
1576 -    "benchmarking/*",
1577 -    "**/.*",
1578 -    "*.class",
1579 -    "**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales",
1580 -    "*locales/**",
1581 -    "utils/InstallAnywhere",
1582 -    "**/*.log",
1583 -  ] 
1584 -  def PROCESS_FILES=[
1585 -    "AUTHORS",
1586 -    "CITATION",
1587 -    "FEATURETODO",
1588 -    "JAVA-11-README",
1589 -    "FEATURETODO",
1590 -    "LICENSE",
1591 -    "**/README",
1592 -    "RELEASE",
1593 -    "THIRDPARTYLIBS",
1594 -    "TESTNG",
1595 -    "build.gradle",
1596 -    "gradle.properties",
1597 -    "**/*.java",
1598 -    "**/*.html",
1599 -    "**/*.xml",
1600 -    "**/*.gradle",
1601 -    "**/*.groovy",
1602 -    "**/*.properties",
1603 -    "**/*.perl",
1604 -    "**/*.sh",
1605 -  ]
1606 -  def INCLUDE_FILES=[
1607 -    ".settings/org.eclipse.jdt.core.jalview.prefs",
1608 -  ]
1609 -
1610 -  from(jalviewDir) {
1611 -    exclude (EXCLUDE_FILES)
1612 -    include (PROCESS_FILES)
1613 -    filter(ReplaceTokens,
1614 -      beginToken: '$$',
1615 -      endToken: '$$',
1616 -      tokens: [
1617 -        'Version-Rel': JALVIEW_VERSION,
1618 -        'Year-Rel': getDate("yyyy")
1619 -      ]
1620 -    )
1621 -  }
1622 -  from(jalviewDir) {
1623 -    exclude (EXCLUDE_FILES)
1624 -    exclude (PROCESS_FILES)
1625 -    exclude ("appletlib")
1626 -    exclude ("**/*locales")
1627 -    exclude ("*locales/**")
1628 -    exclude ("utils/InstallAnywhere")
1629 -
1630 -    exclude (getdown_files_dir)
1631 -    exclude (getdown_website_dir)
1632 -
1633 -    // exluding these as not using jars as modules yet
1634 -    exclude ("${j11modDir}/**/*.jar")
1635 -  }
1636 -  from(jalviewDir) {
1637 -    include(INCLUDE_FILES)
1638 -  }
1639 -//  from (jalviewDir) {
1640 -//    // explicit includes for stuff that seemed to not get included
1641 -//    include(fileTree("test/**/*."))
1642 -//    exclude(EXCLUDE_FILES)
1643 -//    exclude(PROCESS_FILES)
1644 -//  }
1645 -
1646 -  from(file(buildProperties).getParent()) {
1647 -    include(file(buildProperties).getName())
1648 -    rename(file(buildProperties).getName(), "build_properties")
1649 -    filter({ line ->
1650 -      line.replaceAll("^INSTALLATION=.*\$","INSTALLATION=Source Release"+" git-commit\\\\:"+gitHash+" ["+gitBranch+"]")
1651 -    })
1652 -  }
1653 -
1654 -}
1655 -
1656 -
1657 -task helppages {
1658 -  dependsOn copyHelp
1659 -  dependsOn pubhtmlhelp
1660 -  
1661 -  inputs.dir("${helpBuildDir}/${help_dir}")
1662 -  outputs.dir("${buildDir}/distributions/${help_dir}")
1663 -}
1664 -
1665 -
1666 -task j2sSetHeadlessBuild {
1667 -  doFirst {
1668 -    IN_ECLIPSE = false
1669 -  }
1670 -}
1671 -
1672 -
1673 -task jalviewjsEnableAltFileProperty(type: WriteProperties) {
1674 -  group "jalviewjs"
1675 -  description "Enable the alternative J2S Config file for headless build"
1676 -
1677 -  outputFile = jalviewjsJ2sSettingsFileName
1678 -  def j2sPropsFile = file(jalviewjsJ2sSettingsFileName)
1679 -  def j2sProps = new Properties()
1680 -  if (j2sPropsFile.exists()) {
1681 -    try {
1682 -      def j2sPropsFileFIS = new FileInputStream(j2sPropsFile)
1683 -      j2sProps.load(j2sPropsFileFIS)
1684 -      j2sPropsFileFIS.close()
1685 -
1686 -      j2sProps.each { prop, val ->
1687 -        property(prop, val)
1688 -      }
1689 -    } catch (Exception e) {
1690 -      println("Exception reading ${jalviewjsJ2sSettingsFileName}")
1691 -      e.printStackTrace()
1692 -    }
1693 -  }
1694 -  if (! j2sProps.stringPropertyNames().contains(jalviewjs_j2s_alt_file_property_config)) {
1695 -    property(jalviewjs_j2s_alt_file_property_config, jalviewjs_j2s_alt_file_property)
1696 -  }
1697 -}
1698 -
1699 -
1700 -task jalviewjsSetEclipseWorkspace {
1701 -  def propKey = "jalviewjs_eclipse_workspace"
1702 -  def propVal = null
1703 -  if (project.hasProperty(propKey)) {
1704 -    propVal = project.getProperty(propKey)
1705 -    if (propVal.startsWith("~/")) {
1706 -      propVal = System.getProperty("user.home") + propVal.substring(1)
1707 -    }
1708 -  }
1709 -  def propsFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}"
1710 -  def propsFile = file(propsFileName)
1711 -  def eclipseWsDir = propVal
1712 -  def props = new Properties()
1713 -
1714 -  def writeProps = true
1715 -  if (( eclipseWsDir == null || !file(eclipseWsDir).exists() ) && propsFile.exists()) {
1716 -    def ins = new FileInputStream(propsFileName)
1717 -    props.load(ins)
1718 -    ins.close()
1719 -    if (props.getProperty(propKey, null) != null) {
1720 -      eclipseWsDir = props.getProperty(propKey)
1721 -      writeProps = false
1722 -    }
1723 -  }
1724 -
1725 -  if (eclipseWsDir == null || !file(eclipseWsDir).exists()) {
1726 -    def tempDir = File.createTempDir()
1727 -    eclipseWsDir = tempDir.getAbsolutePath()
1728 -    writeProps = true
1729 -  }
1730 -  eclipseWorkspace = file(eclipseWsDir)
1731 -
1732 -  doFirst {
1733 -    // do not run a headless transpile when we claim to be in Eclipse
1734 -    if (IN_ECLIPSE) {
1735 -      println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1736 -      throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1737 -    } else {
1738 -      println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1739 -    }
1740 -
1741 -    if (writeProps) {
1742 -      props.setProperty(propKey, eclipseWsDir)
1743 -      propsFile.parentFile.mkdirs()
1744 -      def bytes = new ByteArrayOutputStream()
1745 -      props.store(bytes, null)
1746 -      def propertiesString = bytes.toString()
1747 -      propsFile.text = propertiesString
1748 -      print("NEW ")
1749 -    } else {
1750 -      print("EXISTING ")
1751 -    }
1752 -
1753 -    println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath())
1754 -  }
1755 -
1756 -  //inputs.property(propKey, eclipseWsDir) // eclipseWsDir only gets set once this task runs, so will be out-of-date
1757 -  outputs.file(propsFileName)
1758 -  outputs.upToDateWhen { eclipseWorkspace.exists() && propsFile.exists() }
1759 -}
1760 -
1761 -
1762 -task jalviewjsEclipsePaths {
1763 -  def eclipseProduct
1764 -
1765 -  def eclipseRoot = jalviewjs_eclipse_root
1766 -  if (eclipseRoot.startsWith("~/")) {
1767 -    eclipseRoot = System.getProperty("user.home") + eclipseRoot.substring(1)
1768 -  }
1769 -  if (OperatingSystem.current().isMacOsX()) {
1770 -    eclipseRoot += "/Eclipse.app"
1771 -    eclipseBinary = "${eclipseRoot}/Contents/MacOS/eclipse"
1772 -    eclipseProduct = "${eclipseRoot}/Contents/Eclipse/.eclipseproduct"
1773 -  } else if (OperatingSystem.current().isWindows()) { // check these paths!!
1774 -    if (file("${eclipseRoot}/eclipse").isDirectory() && file("${eclipseRoot}/eclipse/.eclipseproduct").exists()) {
1775 -      eclipseRoot += "/eclipse"
1776 -    }
1777 -    eclipseBinary = "${eclipseRoot}/eclipse.exe"
1778 -    eclipseProduct = "${eclipseRoot}/.eclipseproduct"
1779 -  } else { // linux or unix
1780 -    if (file("${eclipseRoot}/eclipse").isDirectory() && file("${eclipseRoot}/eclipse/.eclipseproduct").exists()) {
1781 -      eclipseRoot += "/eclipse"
1782 -println("eclipseDir exists")
1783 -    }
1784 -    eclipseBinary = "${eclipseRoot}/eclipse"
1785 -    eclipseProduct = "${eclipseRoot}/.eclipseproduct"
1786 -  }
1787 -
1788 -  eclipseVersion = "4.13" // default
1789 -  def assumedVersion = true
1790 -  if (file(eclipseProduct).exists()) {
1791 -    def fis = new FileInputStream(eclipseProduct)
1792 -    def props = new Properties()
1793 -    props.load(fis)
1794 -    eclipseVersion = props.getProperty("version")
1795 -    fis.close()
1796 -    assumedVersion = false
1797 -  }
1798 -  
1799 -  def propKey = "eclipse_debug"
1800 -  eclipseDebug = (project.hasProperty(propKey) && project.getProperty(propKey).equals("true"))
1801 -
1802 -  doFirst {
1803 -    // do not run a headless transpile when we claim to be in Eclipse
1804 -    if (IN_ECLIPSE) {
1805 -      println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1806 -      throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1807 -    } else {
1808 -      println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1809 -    }
1810 -
1811 -    if (!assumedVersion) {
1812 -      println("ECLIPSE VERSION=${eclipseVersion}")
1813 -    }
1814 -  }
1815 -}
1816 -
1817 -
1818 -task printProperties {
1819 -  group "Debug"
1820 -  description "Output to console all System.properties"
1821 -  doFirst {
1822 -    System.properties.each { key, val -> System.out.println("Property: ${key}=${val}") }
1823 -  }
1824 -}
1825 -
1826 -
1827 -task eclipseSetup {
1828 -  dependsOn eclipseProject
1829 -  dependsOn eclipseClasspath
1830 -  dependsOn eclipseJdt
1831 -}
1832 -
1833 -
1834 -// this version (type: Copy) will delete anything in the eclipse dropins folder that isn't in fromDropinsDir
1835 -task jalviewjsEclipseCopyDropins(type: Copy) {
1836 -  dependsOn jalviewjsEclipsePaths
1837 -
1838 -  def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_eclipse_dropins_dir}", include: "*.jar")
1839 -  inputFiles += file("${jalviewDir}/${jalviewjsJ2sPlugin}")
1840 -  def outputDir = "${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}"
1841 -
1842 -  from inputFiles
1843 -  into outputDir
1844 -}
1845 -
1846 -
1847 -// this eclipse -clean doesn't actually work
1848 -task jalviewjsCleanEclipse(type: Exec) {
1849 -  dependsOn eclipseSetup
1850 -  dependsOn jalviewjsEclipsePaths
1851 -  dependsOn jalviewjsEclipseCopyDropins
1852 -
1853 -  executable(eclipseBinary)
1854 -  args(["-nosplash", "--launcher.suppressErrors", "-data", eclipseWorkspace.getPath(), "-clean", "-console", "-consoleLog"])
1855 -  if (eclipseDebug) {
1856 -    args += "-debug"
1857 -  }
1858 -  args += "-l"
1859 -
1860 -  def inputString = """exit
1861 -y
1862 -"""
1863 -  def inputByteStream = new ByteArrayInputStream(inputString.getBytes())
1864 -  standardInput = inputByteStream
1865 -}
1866 -
1867 -/* not really working yet
1868 -jalviewjsEclipseCopyDropins.finalizedBy jalviewjsCleanEclipse
1869 -*/
1870 -
1871 -
1872 -task jalviewjsTransferUnzipSwingJs {
1873 -  def file_zip = "${jalviewDir}/${jalviewjs_swingjs_zip}"
1874 -
1875 -  doLast {
1876 -    copy {
1877 -      from zipTree(file_zip)
1878 -      into "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
1879 -    }
1880 -  }
1881 -
1882 -  inputs.file file_zip
1883 -  outputs.dir "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
1884 -}
1885 -
1886 -
1887 -task jalviewjsTransferUnzipLib {
1888 -  def zipFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_libjs_dir}", include: "*.zip")
1889 -
1890 -  doLast {
1891 -    zipFiles.each { file_zip -> 
1892 -      copy {
1893 -        from zipTree(file_zip)
1894 -        into "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
1895 -      }
1896 -    }
1897 -  }
1898 -
1899 -  inputs.files zipFiles
1900 -  outputs.dir "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
1901 -}
1902 -
1903 -
1904 -task jalviewjsTransferUnzipAllLibs {
1905 -  dependsOn jalviewjsTransferUnzipSwingJs
1906 -  dependsOn jalviewjsTransferUnzipLib
1907 -}
1908 -
1909 -
1910 -task jalviewjsCreateJ2sSettings(type: WriteProperties) {
1911 -  group "JalviewJS"
1912 -  description "Create the alternative j2s file from the j2s.* properties"
1913 -
1914 -  jalviewjsJ2sProps = project.properties.findAll { it.key.startsWith("j2s.") }.sort { it.key }
1915 -  def siteDirProperty = "j2s.site.directory"
1916 -  def setSiteDir = false
1917 -  jalviewjsJ2sProps.each { prop, val ->
1918 -    if (val != null) {
1919 -      if (prop == siteDirProperty) {
1920 -        if (!(val.startsWith('/') || val.startsWith("file://") )) {
1921 -          val = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${val}"
1922 -        }
1923 -        setSiteDir = true
1924 -      }
1925 -      property(prop,val)
1926 -    }
1927 -    if (!setSiteDir) { // default site location, don't override specifically set property
1928 -      property(siteDirProperty,"${jalviewDirRelativePath}/${jalviewjsTransferSiteJsDir}")
1929 -    }
1930 -  }
1931 -  outputFile = jalviewjsJ2sAltSettingsFileName
1932 -
1933 -  if (! IN_ECLIPSE) {
1934 -    inputs.properties(jalviewjsJ2sProps)
1935 -    outputs.file(jalviewjsJ2sAltSettingsFileName)
1936 -  }
1937 -}
1938 -
1939 -
1940 -task jalviewjsEclipseSetup {
1941 -  dependsOn jalviewjsEclipseCopyDropins
1942 -  dependsOn jalviewjsSetEclipseWorkspace
1943 -  dependsOn jalviewjsCreateJ2sSettings
1944 -}
1945 -
1946 -
1947 -task jalviewjsSyncAllLibs (type: Sync) {
1948 -  dependsOn jalviewjsTransferUnzipAllLibs
1949 -  def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteLibDir}")
1950 -  inputFiles += fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}")
1951 -  def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
1952 -
1953 -  from inputFiles
1954 -  into outputDir
1955 -  def outputFiles = []
1956 -  rename { filename ->
1957 -    outputFiles += "${outputDir}/${filename}"
1958 -    null
1959 -  }
1960 -  preserve {
1961 -    include "**"
1962 -  }
1963 -  outputs.files outputFiles
1964 -  inputs.files inputFiles
1965 -}
1966 -
1967 -
1968 -task jalviewjsSyncResources (type: Sync) {
1969 -  dependsOn buildResources
1970 -
1971 -  def inputFiles = fileTree(dir: resourcesBuildDir)
1972 -  def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}"
1973 -
1974 -  from inputFiles
1975 -  into outputDir
1976 -  def outputFiles = []
1977 -  rename { filename ->
1978 -    outputFiles += "${outputDir}/${filename}"
1979 -    null
1980 -  }
1981 -  preserve {
1982 -    include "**"
1983 -  }
1984 -  outputs.files outputFiles
1985 -  inputs.files inputFiles
1986 -}
1987 -
1988 -
1989 -task jalviewjsSyncSiteResources (type: Sync) {
1990 -  def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_site_resource_dir}")
1991 -  def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
1992 -
1993 -  from inputFiles
1994 -  into outputDir
1995 -  def outputFiles = []
1996 -  rename { filename ->
1997 -    outputFiles += "${outputDir}/${filename}"
1998 -    null
1999 -  }
2000 -  preserve {
2001 -    include "**"
2002 -  }
2003 -  outputs.files outputFiles
2004 -  inputs.files inputFiles
2005 -}
2006 -
2007 -
2008 -task jalviewjsSyncBuildProperties (type: Sync) {
2009 -  dependsOn createBuildProperties
2010 -  def inputFiles = [file(buildProperties)]
2011 -  def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}"
2012 -
2013 -  from inputFiles
2014 -  into outputDir
2015 -  def outputFiles = []
2016 -  rename { filename ->
2017 -    outputFiles += "${outputDir}/${filename}"
2018 -    null
2019 -  }
2020 -  preserve {
2021 -    include "**"
2022 -  }
2023 -  outputs.files outputFiles
2024 -  inputs.files inputFiles
2025 -}
2026 -
2027 -
2028 -task jalviewjsProjectImport(type: Exec) {
2029 -  dependsOn eclipseSetup
2030 -  dependsOn jalviewjsEclipsePaths
2031 -  dependsOn jalviewjsEclipseSetup
2032 -
2033 -  doFirst {
2034 -    // do not run a headless import when we claim to be in Eclipse
2035 -    if (IN_ECLIPSE) {
2036 -      println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
2037 -      throw new StopExecutionException("Not running headless import whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
2038 -    } else {
2039 -      println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
2040 -    }
2041 -  }
2042 -
2043 -  //def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview/org.eclipse.jdt.core"
2044 -  def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview"
2045 -  executable(eclipseBinary)
2046 -  args(["-nosplash", "--launcher.suppressErrors", "-application", "com.seeq.eclipse.importprojects.headlessimport", "-data", eclipseWorkspace.getPath(), "-import", jalviewDirAbsolutePath])
2047 -  if (eclipseDebug) {
2048 -    args += "-debug"
2049 -  }
2050 -  args += [ "--launcher.appendVmargs", "-vmargs", "-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}" ]
2051 -  if (!IN_ECLIPSE) {
2052 -    args += [ "-D${j2sHeadlessBuildProperty}=true" ]
2053 -    args += [ "-D${jalviewjs_j2s_alt_file_property}=${jalviewjsJ2sAltSettingsFileName}" ]
2054 -  }
2055 -
2056 -  inputs.file("${jalviewDir}/.project")
2057 -  outputs.upToDateWhen { 
2058 -    file(projdir).exists()
2059 -  }
2060 -}
2061 -
2062  
2063 -task jalviewjsTranspile(type: Exec) {
2064 -  dependsOn jalviewjsEclipseSetup 
2065 -  dependsOn jalviewjsProjectImport
2066 -  dependsOn jalviewjsEclipsePaths
2067 -  if (!IN_ECLIPSE) {
2068 -    dependsOn jalviewjsEnableAltFileProperty
2069 -  }
2070 -
2071 -  doFirst {
2072 -    // do not run a headless transpile when we claim to be in Eclipse
2073 -    if (IN_ECLIPSE) {
2074 -      println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
2075 -      throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
2076 -    } else {
2077 -      println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
2078 -    }
2079 -  }
2080 -
2081 -  executable(eclipseBinary)
2082 -  args(["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-data", eclipseWorkspace, "-${jalviewjs_eclipse_build_arg}", eclipse_project_name ])
2083 -  if (eclipseDebug) {
2084 -    args += "-debug"
2085 -  }
2086 -  args += [ "--launcher.appendVmargs", "-vmargs", "-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}" ]
2087 -  if (!IN_ECLIPSE) {
2088 -    args += [ "-D${j2sHeadlessBuildProperty}=true" ]
2089 -    args += [ "-D${jalviewjs_j2s_alt_file_property}=${jalviewjsJ2sAltSettingsFileName}" ]
2090 -  }
2091 -
2092 -  def stdout
2093 -  def stderr
2094 -  doFirst {
2095 -    stdout = new ByteArrayOutputStream()
2096 -    stderr = new ByteArrayOutputStream()
2097 -
2098 -    def logOutFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}"
2099 -    def logOutFile = file(logOutFileName)
2100 -    logOutFile.createNewFile()
2101 -    logOutFile.text = """ROOT: ${jalviewjs_eclipse_root}
2102 -BINARY: ${eclipseBinary}
2103 -VERSION: ${eclipseVersion}
2104 -WORKSPACE: ${eclipseWorkspace}
2105 -DEBUG: ${eclipseDebug}
2106 -----
2107 -"""
2108 -    def logOutFOS = new FileOutputStream(logOutFile, true) // true == append
2109 -    // combine stdout and stderr
2110 -    def logErrFOS = logOutFOS
2111 -
2112 -    if (jalviewjs_j2s_to_console.equals("true")) {
2113 -      standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
2114 -        new org.apache.tools.ant.util.TeeOutputStream(
2115 -          logOutFOS,
2116 -          stdout),
2117 -        System.out)
2118 -      errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
2119 -        new org.apache.tools.ant.util.TeeOutputStream(
2120 -          logErrFOS,
2121 -          stderr),
2122 -        System.err)
2123 -    } else {
2124 -      standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
2125 -        logOutFOS,
2126 -        stdout)
2127 -      errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
2128 -        logErrFOS,
2129 -        stderr)
2130 -    }
2131 -  }
2132 -
2133 -  doLast {
2134 -    if (stdout.toString().contains("Error processing ")) {
2135 -      // j2s did not complete transpile
2136 -      //throw new TaskExecutionException("Error during transpilation:\n${stderr}\nSee eclipse transpile log file '${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}'")
2137 -      if (jalviewjs_ignore_transpile_errors.equals("true")) {
2138 -        println("IGNORING TRANSPILE ERRORS")
2139 -        println("See eclipse transpile log file '${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}'")
2140 -      } else {
2141 -        throw new GradleException("Error during transpilation:\n${stderr}\nSee eclipse transpile log file '${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}'")
2142 -      }
2143 -    }
2144 -  }
2145 -
2146 -  inputs.dir("${jalviewDir}/${sourceDir}")
2147 -  outputs.dir("${jalviewDir}/${jalviewjsTransferSiteJsDir}")
2148 -  outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteJsDir}${jalviewjs_server_resource}").exists() } )
2149 -}
2150 -
2151 -
2152 -def jalviewjsCallCore(String name, FileCollection list, String prefixFile, String suffixFile, String jsfile, String zjsfile, File logOutFile, Boolean logOutConsole) {
2153 -
2154 -  def stdout = new ByteArrayOutputStream()
2155 -  def stderr = new ByteArrayOutputStream()
2156 -
2157 -  def coreFile = file(jsfile)
2158 -  def msg = ""
2159 -  msg = "Creating core for ${name}...\nGenerating ${jsfile}"
2160 -  println(msg)
2161 -  logOutFile.createNewFile()
2162 -  logOutFile.append(msg+"\n")
2163 -
2164 -  def coreTop = file(prefixFile)
2165 -  def coreBottom = file(suffixFile)
2166 -  coreFile.getParentFile().mkdirs()
2167 -  coreFile.createNewFile()
2168 -  coreFile.write( coreTop.getText("UTF-8") )
2169 -  list.each {
2170 -    f ->
2171 -    if (f.exists()) {
2172 -      def t = f.getText("UTF-8")
2173 -      t.replaceAll("Clazz\\.([^_])","Clazz_${1}")
2174 -      coreFile.append( t )
2175 -    } else {
2176 -      msg = "...file '"+f.getPath()+"' does not exist, skipping"
2177 -      println(msg)
2178 -      logOutFile.append(msg+"\n")
2179 -    }
2180 -  }
2181 -  coreFile.append( coreBottom.getText("UTF-8") )
2182 -
2183 -  msg = "Generating ${zjsfile}"
2184 -  println(msg)
2185 -  logOutFile.append(msg+"\n")
2186 -  def logOutFOS = new FileOutputStream(logOutFile, true) // true == append
2187 -  def logErrFOS = logOutFOS
2188 -
2189 -  javaexec {
2190 -    classpath = files(["${jalviewDir}/${jalviewjs_closure_compiler}"])
2191 -    main = "com.google.javascript.jscomp.CommandLineRunner"
2192 -    jvmArgs = [ "-Dfile.encoding=UTF-8" ]
2193 -    args = [ "--compilation_level", "SIMPLE_OPTIMIZATIONS", "--warning_level", "QUIET", "--charset", "UTF-8", "--js", jsfile, "--js_output_file", zjsfile ]
2194 -    maxHeapSize = "2g"
2195 -
2196 -    msg = "\nRunning '"+commandLine.join(' ')+"'\n"
2197 -    println(msg)
2198 -    logOutFile.append(msg+"\n")
2199 -
2200 -    if (logOutConsole) {
2201 -      standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
2202 -        new org.apache.tools.ant.util.TeeOutputStream(
2203 -          logOutFOS,
2204 -          stdout),
2205 -        standardOutput)
2206 -        errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
2207 -          new org.apache.tools.ant.util.TeeOutputStream(
2208 -            logErrFOS,
2209 -            stderr),
2210 -          errorOutput)
2211 -    } else {
2212 -      standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
2213 -        logOutFOS,
2214 -        stdout)
2215 -        errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
2216 -          logErrFOS,
2217 -          stderr)
2218 -    }
2219 -  }
2220 -  msg = "--"
2221 -  println(msg)
2222 -  logOutFile.append(msg+"\n")
2223 -}
2224 -
2225 -
2226 -task jalviewjsBuildAllCores {
2227 -  group "JalviewJS"
2228 -  description "Build the core js lib closures listed in the classlists dir"
2229 -  dependsOn jalviewjsTranspile
2230 -  dependsOn jalviewjsTransferUnzipSwingJs
2231 -
2232 -  def j2sDir = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${jalviewjs_j2s_subdir}"
2233 -  def swingJ2sDir = "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}/${jalviewjs_j2s_subdir}"
2234 -  def libJ2sDir = "${jalviewDir}/${jalviewjsTransferSiteLibDir}/${jalviewjs_j2s_subdir}"
2235 -  def jsDir = "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}/${jalviewjs_js_subdir}"
2236 -  def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}/${jalviewjs_j2s_subdir}/core"
2237 -  def prefixFile = "${jsDir}/core/coretop2.js"
2238 -  def suffixFile = "${jsDir}/core/corebottom2.js"
2239 -
2240 -  inputs.file prefixFile
2241 -  inputs.file suffixFile
2242 -
2243 -  def classlistFiles = []
2244 -  // add the classlists found int the jalviewjs_classlists_dir
2245 -  fileTree(dir: "${jalviewDir}/${jalviewjs_classlists_dir}", include: "*.txt").each {
2246 -    file ->
2247 -    def name = file.getName() - ".txt"
2248 -    classlistFiles += [
2249 -      'file': file,
2250 -      'name': name
2251 -    ]
2252 -  }
2253 -
2254 -  // _jmol and _jalview cores. Add any other peculiar classlist.txt files here
2255 -  //classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jmol}"), 'name': "_jvjmol" ]
2256 -  classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jalview}"), 'name': jalviewjsJalviewCoreName ]
2257 -
2258 -  jalviewjsCoreClasslists = []
2259 -
2260 -  classlistFiles.each {
2261 -    hash ->
2262 -
2263 -    def file = hash['file']
2264 -    if (! file.exists()) {
2265 -      //println("...classlist file '"+file.getPath()+"' does not exist, skipping")
2266 -      return false // this is a "continue" in groovy .each closure
2267 -    }
2268 -    def name = hash['name']
2269 -    if (name == null) {
2270 -      name = file.getName() - ".txt"
2271 -    }
2272 -
2273 -    def filelist = []
2274 -    file.eachLine {
2275 -      line ->
2276 -        filelist += line
2277 -    }
2278 -    def list = fileTree(dir: j2sDir, includes: filelist)
2279 -
2280 -    def jsfile = "${outputDir}/core${name}.js"
2281 -    def zjsfile = "${outputDir}/core${name}.z.js"
2282 -
2283 -    jalviewjsCoreClasslists += [
2284 -      'jsfile': jsfile,
2285 -      'zjsfile': zjsfile,
2286 -      'list': list,
2287 -      'name': name
2288 -    ]
2289 -
2290 -    inputs.file(file)
2291 -    inputs.files(list)
2292 -    outputs.file(jsfile)
2293 -    outputs.file(zjsfile)
2294 -  }
2295 -  
2296 -  // _stevesoft core. add any cores without a classlist here (and the inputs and outputs)
2297 -  def stevesoftClasslistName = "_stevesoft"
2298 -  def stevesoftClasslist = [
2299 -    'jsfile': "${outputDir}/core${stevesoftClasslistName}.js",
2300 -    'zjsfile': "${outputDir}/core${stevesoftClasslistName}.z.js",
2301 -    'list': fileTree(dir: j2sDir, include: "com/stevesoft/pat/**/*.js"),
2302 -    'name': stevesoftClasslistName
2303 -  ]
2304 -  jalviewjsCoreClasslists += stevesoftClasslist
2305 -  inputs.files(stevesoftClasslist['list'])
2306 -  outputs.file(stevesoftClasslist['jsfile'])
2307 -  outputs.file(stevesoftClasslist['zjsfile'])
2308 -
2309 -  // _all core
2310 -  def allClasslistName = "_all"
2311 -  def allJsFiles = fileTree(dir: j2sDir, include: "**/*.js")
2312 -  allJsFiles += fileTree(
2313 -    dir: libJ2sDir,
2314 -    include: "**/*.js",
2315 -    excludes: [
2316 -      // these exlusions are files that the closure-compiler produces errors for. Should fix them
2317 -      "**/org/jmol/jvxl/readers/IsoIntersectFileReader.js",
2318 -      "**/org/jmol/export/JSExporter.js"
2319 -    ]
2320 -  )
2321 -  allJsFiles += fileTree(
2322 -    dir: swingJ2sDir,
2323 -    include: "**/*.js",
2324 -    excludes: [
2325 -      // these exlusions are files that the closure-compiler produces errors for. Should fix them
2326 -      "**/sun/misc/Unsafe.js",
2327 -      "**/swingjs/jquery/jquery-editable-select.js",
2328 -      "**/swingjs/jquery/j2sComboBox.js",
2329 -      "**/sun/misc/FloatingDecimal.js"
2330 -    ]
2331 -  )
2332 -  def allClasslist = [
2333 -    'jsfile': "${outputDir}/core${allClasslistName}.js",
2334 -    'zjsfile': "${outputDir}/core${allClasslistName}.z.js",
2335 -    'list': allJsFiles,
2336 -    'name': allClasslistName
2337 -  ]
2338 -  // not including this version of "all" core at the moment
2339 -  //jalviewjsCoreClasslists += allClasslist
2340 -  inputs.files(allClasslist['list'])
2341 -  outputs.file(allClasslist['jsfile'])
2342 -  outputs.file(allClasslist['zjsfile'])
2343 -
2344 -  doFirst {
2345 -    def logOutFile = file("${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_closure_stdout}")
2346 -    logOutFile.getParentFile().mkdirs()
2347 -    logOutFile.createNewFile()
2348 -    logOutFile.write(getDate("yyyy-MM-dd HH:mm:ss")+" jalviewjsBuildAllCores\n----\n")
2349 -
2350 -    jalviewjsCoreClasslists.each {
2351 -      jalviewjsCallCore(it.name, it.list, prefixFile, suffixFile, it.jsfile, it.zjsfile, logOutFile, jalviewjs_j2s_to_console.equals("true"))
2352 -    }
2353 -  }
2354 -
2355 -}
2356 -
2357 -
2358 -def jalviewjsPublishCoreTemplate(String coreName, String templateName, File inputFile, String outputFile) {
2359 -  copy {
2360 -    from inputFile
2361 -    into file(outputFile).getParentFile()
2362 -    rename { filename ->
2363 -      if (filename.equals(inputFile.getName())) {
2364 -        return file(outputFile).getName()
2365 -      }
2366 -      return null
2367 -    }
2368 -    filter(ReplaceTokens,
2369 -      beginToken: '_',
2370 -      endToken: '_',
2371 -      tokens: [
2372 -        'MAIN': '"'+main_class+'"',
2373 -        'CODE': "null",
2374 -        'NAME': jalviewjsJalviewTemplateName+" [core ${coreName}]",
2375 -        'COREKEY': jalviewjs_core_key,
2376 -        'CORENAME': coreName
2377 -      ]
2378 -    )
2379 -  }
2380 -}
2381 -
2382 -
2383 -task jalviewjsPublishCoreTemplates {
2384 -  dependsOn jalviewjsBuildAllCores
2385 -  def inputFileName = "${jalviewDir}/${j2s_coretemplate_html}"
2386 -  def inputFile = file(inputFileName)
2387 -  def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}"
2388 -
2389 -  def outputFiles = []
2390 -  jalviewjsCoreClasslists.each { cl ->
2391 -    def outputFile = "${outputDir}/${jalviewjsJalviewTemplateName}_${cl.name}.html"
2392 -    cl['outputfile'] = outputFile
2393 -    outputFiles += outputFile
2394 -  }
2395 -
2396 -  doFirst {
2397 -    jalviewjsCoreClasslists.each { cl ->
2398 -      jalviewjsPublishCoreTemplate(cl.name, jalviewjsJalviewTemplateName, inputFile, cl.outputfile)
2399 -    }
2400 -  }
2401 -  inputs.file(inputFile)
2402 -  outputs.files(outputFiles)
2403 -}
2404 -
2405 -
2406 -task jalviewjsSyncCore (type: Sync) {
2407 -  dependsOn jalviewjsBuildAllCores
2408 -  dependsOn jalviewjsPublishCoreTemplates
2409 -  def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteCoreDir}")
2410 -  def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
2411 -
2412 -  from inputFiles
2413 -  into outputDir
2414 -  def outputFiles = []
2415 -  rename { filename ->
2416 -    outputFiles += "${outputDir}/${filename}"
2417 -    null
2418 -  }
2419 -  preserve {
2420 -    include "**"
2421 -  }
2422 -  outputs.files outputFiles
2423 -  inputs.files inputFiles
2424 -}
2425 -
2426 -
2427 -// this Copy version of TransferSiteJs will delete anything else in the target dir
2428 -task jalviewjsCopyTransferSiteJs(type: Copy) {
2429 -  dependsOn jalviewjsTranspile
2430 -  from "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2431 -  into "${jalviewDir}/${jalviewjsSiteDir}"
2432 -}
2433 -
2434 -
2435 -// this Sync version of TransferSite is used by buildship to keep the website automatically up to date when a file changes
2436 -task jalviewjsSyncTransferSiteJs(type: Sync) {
2437 -  from "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2438 -  include "**/*.*"
2439 -  into "${jalviewDir}/${jalviewjsSiteDir}"
2440 -  preserve {
2441 -    include "**"
2442 -  }
2443 -}
2444 -
2445 -
2446 -jalviewjsSyncAllLibs.mustRunAfter jalviewjsCopyTransferSiteJs
2447 -jalviewjsSyncResources.mustRunAfter jalviewjsCopyTransferSiteJs
2448 -jalviewjsSyncSiteResources.mustRunAfter jalviewjsCopyTransferSiteJs
2449 -jalviewjsSyncBuildProperties.mustRunAfter jalviewjsCopyTransferSiteJs
2450 -
2451 -jalviewjsSyncAllLibs.mustRunAfter jalviewjsSyncTransferSiteJs
2452 -jalviewjsSyncResources.mustRunAfter jalviewjsSyncTransferSiteJs
2453 -jalviewjsSyncSiteResources.mustRunAfter jalviewjsSyncTransferSiteJs
2454 -jalviewjsSyncBuildProperties.mustRunAfter jalviewjsSyncTransferSiteJs
2455 -
2456 -
2457 -task jalviewjsPrepareSite {
2458 -  group "JalviewJS"
2459 -  description "Prepares the website folder including unzipping files and copying resources"
2460 -  dependsOn jalviewjsSyncAllLibs
2461 -  dependsOn jalviewjsSyncResources
2462 -  dependsOn jalviewjsSyncSiteResources
2463 -  dependsOn jalviewjsSyncBuildProperties
2464 -  dependsOn jalviewjsSyncCore
2465 -}
2466 -
2467 -
2468 -task jalviewjsBuildSite {
2469 -  group "JalviewJS"
2470 -  description "Builds the whole website including transpiled code"
2471 -  dependsOn jalviewjsCopyTransferSiteJs
2472 -  dependsOn jalviewjsPrepareSite
2473 -}
2474 -
2475 -
2476 -task cleanJalviewjsTransferSite {
2477 -  doFirst {
2478 -    delete "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2479 -    delete "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
2480 -    delete "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
2481 -    delete "${jalviewDir}/${jalviewjsTransferSiteCoreDir}"
2482 -  }
2483 -}
2484 -
2485 -
2486 -task cleanJalviewjsSite {
2487 -  dependsOn cleanJalviewjsTransferSite
2488 -  doFirst {
2489 -    delete "${jalviewDir}/${jalviewjsSiteDir}"
2490 -  }
2491 -}
2492 -
2493 -
2494 -task jalviewjsSiteTar(type: Tar) {
2495 -  group "JalviewJS"
2496 -  description "Creates a tar.gz file for the website"
2497 -  dependsOn jalviewjsBuildSite
2498 -  def outputFilename = "jalviewjs-site-${JALVIEW_VERSION}.tar.gz"
2499 -  archiveFileName = outputFilename
2500 -
2501 -  compression Compression.GZIP
2502 -
2503 -  from "${jalviewDir}/${jalviewjsSiteDir}"
2504 -  into jalviewjs_site_dir // this is inside the tar file
2505 -
2506 -  inputs.dir("${jalviewDir}/${jalviewjsSiteDir}")
2507 -}
2508 -
2509 -
2510 -task jalviewjsServer {
2511 -  group "JalviewJS"
2512 -  def filename = "jalviewjsTest.html"
2513 -  description "Starts a webserver on localhost to test the website. See ${filename} to access local site on most recently used port."
2514 -  def htmlFile = "${jalviewDirAbsolutePath}/${filename}"
2515 -  doLast {
2516 -
2517 -    def factory
2518 -    try {
2519 -      def f = Class.forName("org.gradle.plugins.javascript.envjs.http.simple.SimpleHttpFileServerFactory")
2520 -      factory = f.newInstance()
2521 -    } catch (ClassNotFoundException e) {
2522 -      throw new GradleException("Unable to create SimpleHttpFileServerFactory")
2523 -    }
2524 -    def port = Integer.valueOf(jalviewjs_server_port)
2525 -    def start = port
2526 -    def running = false
2527 -    def url
2528 -    def jalviewjsServer
2529 -    while(port < start+1000 && !running) {
2530 -      try {
2531 -        def doc_root = new File("${jalviewDirAbsolutePath}/${jalviewjsSiteDir}")
2532 -        jalviewjsServer = factory.start(doc_root, port)
2533 -        running = true
2534 -        url = jalviewjsServer.getResourceUrl(jalviewjs_server_resource)
2535 -        println("SERVER STARTED with document root ${doc_root}.")
2536 -        println("Go to "+url+" . Run  gradle --stop  to stop (kills all gradle daemons).")
2537 -        println("For debug: "+url+"?j2sdebug")
2538 -        println("For verbose: "+url+"?j2sverbose")
2539 -      } catch (Exception e) {
2540 -        port++;
2541 -      }
2542 -    }
2543 -    def htmlText = """
2544 -      <p><a href="${url}">JalviewJS Test. &lt;${url}&gt;</a></p>
2545 -      <p><a href="${url}?j2sdebug">JalviewJS Test with debug. &lt;${url}?j2sdebug&gt;</a></p>
2546 -      <p><a href="${url}?j2sverbose">JalviewJS Test with verbose. &lt;${url}?j2sdebug&gt;</a></p>
2547 -      """
2548 -    jalviewjsCoreClasslists.each { cl ->
2549 -      def urlcore = jalviewjsServer.getResourceUrl(file(cl.outputfile).getName())
2550 -      htmlText += """
2551 -      <p><a href="${urlcore}">${jalviewjsJalviewTemplateName} [core ${cl.name}]. &lt;${urlcore}&gt;</a></p>
2552 -      """
2553 -      println("For core ${cl.name}: "+urlcore)
2554 -    }
2555 -
2556 -    file(htmlFile).text = htmlText
2557 -  }
2558 -
2559 -  outputs.file(htmlFile)
2560 -  outputs.upToDateWhen({false})
2561 -}
2562 -
2563 -
2564 -task cleanJalviewjsAll {
2565 -  group "JalviewJS"
2566 -  description "Delete all configuration and build artifacts to do with JalviewJS build"
2567 -  dependsOn cleanJalviewjsSite
2568 -  dependsOn jalviewjsEclipsePaths
2569 -  
2570 -  doFirst {
2571 -    delete "${jalviewDir}/${jalviewjsBuildDir}"
2572 -    delete "${jalviewDir}/${eclipse_bin_dir}"
2573 -    if (eclipseWorkspace != null && file(eclipseWorkspace.getAbsolutePath()+"/.metadata").exists()) {
2574 -      delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata")
2575 -    }
2576 -    delete jalviewjsJ2sAltSettingsFileName
2577 -  }
2578 -
2579 -  outputs.upToDateWhen( { false } )
2580 -}
2581 -
2582 -
2583 -task jalviewjsIDE_checkJ2sPlugin {
2584 -  group "00 JalviewJS in Eclipse"
2585 -  description "Compare the swingjs/net.sf.j2s.core(-j11)?.jar file with the Eclipse IDE's plugin version (found in the 'dropins' dir)"
2586 -
2587 -  doFirst {
2588 -    def j2sPlugin = string("${jalviewDir}/${jalviewjsJ2sPlugin}")
2589 -    def j2sPluginFile = file(j2sPlugin)
2590 -    def eclipseHome = System.properties["eclipse.home.location"]
2591 -    if (eclipseHome == null || ! IN_ECLIPSE) {
2592 -      throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. Skipping J2S Plugin Check.")
2593 -    }
2594 -    def eclipseJ2sPluginDirs = [ "${eclipseHome}/dropins" ]
2595 -    def altPluginsDir = System.properties["org.eclipse.equinox.p2.reconciler.dropins.directory"]
2596 -    if (altPluginsDir != null && file(altPluginsDir).exists()) {
2597 -      eclipseJ2sPluginDirs += altPluginsDir
2598 -    }
2599 -    def foundPlugin = false
2600 -    def j2sPluginFileName = j2sPluginFile.getName()
2601 -    def eclipseJ2sPlugin
2602 -    def eclipseJ2sPluginFile
2603 -    eclipseJ2sPluginDirs.any { dir ->
2604 -      eclipseJ2sPlugin = "${dir}/${j2sPluginFileName}"
2605 -      eclipseJ2sPluginFile = file(eclipseJ2sPlugin)
2606 -      if (eclipseJ2sPluginFile.exists()) {
2607 -        foundPlugin = true
2608 -        return true
2609 -      }
2610 -    }
2611 -    if (!foundPlugin) {
2612 -      def msg = "Eclipse J2S Plugin is not installed (could not find '${j2sPluginFileName}' in\n"+eclipseJ2sPluginDirs.join("\n")+"\n)\nTry running task jalviewjsIDE_copyJ2sPlugin"
2613 -      System.err.println(msg)
2614 -      throw new StopExecutionException(msg)
2615 -    }
2616 -
2617 -    def digest = MessageDigest.getInstance("MD5")
2618 -
2619 -    digest.update(j2sPluginFile.text.bytes)
2620 -    def j2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
2621 -
2622 -    digest.update(eclipseJ2sPluginFile.text.bytes)
2623 -    def eclipseJ2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
2624 -     
2625 -    if (j2sPluginMd5 != eclipseJ2sPluginMd5) {
2626 -      def msg = "WARNING! Eclipse J2S Plugin '${eclipseJ2sPlugin}' is different to this commit's version '${j2sPlugin}'"
2627 -      System.err.println(msg)
2628 -      throw new StopExecutionException(msg)
2629 -    } else {
2630 -      def msg = "Eclipse J2S Plugin '${eclipseJ2sPlugin}' is the same as '${j2sPlugin}' (this is good)"
2631 -      println(msg)
2632 -    }
2633 -  }
2634 -}
2635 -
2636 -task jalviewjsIDE_copyJ2sPlugin {
2637 -  group "00 JalviewJS in Eclipse"
2638 -  description "Copy the swingjs/net.sf.j2s.core(-j11)?.jar file into the Eclipse IDE's 'dropins' dir"
2639 -
2640 -  doFirst {
2641 -    def j2sPlugin = string("${jalviewDir}/${jalviewjsJ2sPlugin}")
2642 -    def j2sPluginFile = file(j2sPlugin)
2643 -    def eclipseHome = System.properties["eclipse.home.location"]
2644 -    if (eclipseHome == null || ! IN_ECLIPSE) {
2645 -      throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. NOT copying J2S Plugin.")
2646 -    }
2647 -    def eclipseJ2sPlugin = "${eclipseHome}/dropins/${j2sPluginFile.getName()}"
2648 -    def eclipseJ2sPluginFile = file(eclipseJ2sPlugin)
2649 -    def msg = "WARNING! Copying this commit's j2s plugin '${j2sPlugin}' to Eclipse J2S Plugin '${eclipseJ2sPlugin}'\n* May require an Eclipse restart"
2650 -    System.err.println(msg)
2651 -    copy {
2652 -      from j2sPlugin
2653 -      eclipseJ2sPluginFile.getParentFile().mkdirs()
2654 -      into eclipseJ2sPluginFile.getParent()
2655 -    }
2656 -  }
2657 -}
2658 -
2659 -
2660 -task jalviewjsIDE_j2sFile {
2661 -  group "00 JalviewJS in Eclipse"
2662 -  description "Creates the .j2s file"
2663 -  dependsOn jalviewjsCreateJ2sSettings
2664 -}
2665 -
2666 -
2667 -task jalviewjsIDE_SyncCore {
2668 -  group "00 JalviewJS in Eclipse"
2669 -  description "Build the core js lib closures listed in the classlists dir and publish core html from template"
2670 -  dependsOn jalviewjsSyncCore
2671 -}
2672 -
2673 -
2674 -task jalviewjsIDE_SyncSiteAll {
2675 -  dependsOn jalviewjsSyncAllLibs
2676 -  dependsOn jalviewjsSyncResources
2677 -  dependsOn jalviewjsSyncSiteResources
2678 -  dependsOn jalviewjsSyncBuildProperties
2679 -}
2680 -
2681 -
2682 -cleanJalviewjsTransferSite.mustRunAfter jalviewjsIDE_SyncSiteAll
2683 -
2684 -
2685 -task jalviewjsIDE_PrepareSite {
2686 -  group "00 JalviewJS in Eclipse"
2687 -  description "Sync libs and resources to site dir, but not closure cores"
2688 -
2689 -  dependsOn jalviewjsIDE_SyncSiteAll
2690 -  //dependsOn cleanJalviewjsTransferSite // not sure why this clean is here -- will slow down a re-run of this task
2691 -}
2692 -
2693 -
2694 -task jalviewjsIDE_AssembleSite {
2695 -  group "00 JalviewJS in Eclipse"
2696 -  description "Assembles unzipped supporting zipfiles, resources, site resources and closure cores into the Eclipse transpiled site"
2697 -  dependsOn jalviewjsPrepareSite
2698 -}
2699 -
2700 -
2701 -task jalviewjsIDE_SiteClean {
2702 -  group "00 JalviewJS in Eclipse"
2703 -  description "Deletes the Eclipse transpiled site"
2704 -  dependsOn cleanJalviewjsSite
2705 -}
2706 -
2707 -
2708 -task jalviewjsIDE_Server {
2709 -  group "00 JalviewJS in Eclipse"
2710 -  description "Starts a webserver on localhost to test the website"
2711 -  dependsOn jalviewjsServer
2712 -}
2713 -
2714 -
2715 -// buildship runs this at import or gradle refresh
2716 -task eclipseSynchronizationTask {
2717 -  //dependsOn eclipseSetup
2718 -  dependsOn createBuildProperties
2719 -  if (J2S_ENABLED) {
2720 -    dependsOn jalviewjsIDE_j2sFile
2721 -    dependsOn jalviewjsIDE_checkJ2sPlugin
2722 -    dependsOn jalviewjsIDE_PrepareSite
2723 -  }
2724 -}
2725 -
2726 -
2727 -// buildship runs this at build time or project refresh
2728 -task eclipseAutoBuildTask {
2729 -  //dependsOn jalviewjsIDE_checkJ2sPlugin
2730 -  //dependsOn jalviewjsIDE_PrepareSite
2731 +  outputs.file("${outputDir}/${archiveFileName}")
2732  }
2733  
2734 -
2735 -task jalviewjs {
2736 -  group "JalviewJS"
2737 -  description "Build the site"
2738 -  dependsOn jalviewjsBuildSite
2739 -}