---- a/build.gradle 2021-09-20 17:46:04.088152106 +0100
-+++ b/build.gradle 2021-09-20 17:46:09.180302062 +0100
-@@ -2,16 +2,6 @@
+--- a/build.gradle 2021-09-21 09:52:04.653972716 +0100
++++ b/build.gradle 2021-09-21 09:52:18.117985307 +0100
+@@ -2,56 +2,12 @@
* For properties set within build.gradle, use camelCaseNoSpace.
*/
import org.apache.tools.ant.filters.ReplaceTokens
-import groovy.transform.ExternalizeMethods
-import groovy.util.XmlParser
-import groovy.xml.XmlUtil
- import com.vladsch.flexmark.util.ast.Node
- import com.vladsch.flexmark.html.HtmlRenderer
- import com.vladsch.flexmark.parser.Parser
-@@ -24,34 +14,17 @@
- import com.vladsch.flexmark.ext.toc.TocExtension
-
- buildscript {
+-import com.vladsch.flexmark.util.ast.Node
+-import com.vladsch.flexmark.html.HtmlRenderer
+-import com.vladsch.flexmark.parser.Parser
+-import com.vladsch.flexmark.util.data.MutableDataSet
+-import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension
+-import com.vladsch.flexmark.ext.tables.TablesExtension
+-import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension
+-import com.vladsch.flexmark.ext.autolink.AutolinkExtension
+-import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension
+-import com.vladsch.flexmark.ext.toc.TocExtension
+-
+-buildscript {
- repositories {
- mavenCentral()
- mavenLocal()
- }
- dependencies {
- classpath "com.vladsch.flexmark:flexmark-all:0.62.0"
- }
- }
-
+- dependencies {
+- classpath "com.vladsch.flexmark:flexmark-all:0.62.0"
+- }
+-}
-
+
plugins {
id 'java'
id 'application'
- id 'com.github.johnrengelman.shadow' version '4.0.3'
- id 'com.install4j.gradle' version '8.0.10'
- id 'com.dorongold.task-tree' version '1.5' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree
- id 'com.palantir.git-version' version '0.12.3'
- }
-
+- id 'com.palantir.git-version' version '0.12.3'
+-}
+-
-repositories {
- jcenter()
- mavenCentral()
- mavenLocal()
--}
--
+ }
+
-
// in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use
def string(Object o) {
return o == null ? "" : o.toString()
-@@ -96,19 +69,11 @@
+@@ -92,23 +48,15 @@
+ }
+ }
+
+-ext {
++project.ext {
jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
jalviewDirRelativePath = jalviewDir
////
// Import releaseProps from the RELEASE file
// or a file specified via JALVIEW_RELEASE_FILE if defined
-@@ -128,41 +93,6 @@
+@@ -128,41 +76,6 @@
if (findProperty("JALVIEW_VERSION")==null || "".equals(JALVIEW_VERSION)) {
JALVIEW_VERSION = releaseProps.get("jalview.version")
}
// essentials
bareSourceDir = string(source_dir)
-@@ -173,214 +103,18 @@
+@@ -173,218 +86,18 @@
classesDir = string("${jalviewDir}/${classes_dir}")
- getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
- getdownAppDistDir = getdown_app_dir_alt
- getdownImagesDir = string("${jalviewDir}/${getdown_images_dir}")
-+ useClover = false
-+
-+ resourceClassesDir = classesDir
-+
-+ testSourceDir = testDir
-+ testClassesDir = "${jalviewDir}/${test_output_dir}"
-+
-+ buildProperties = string("${classesDir}/${build_properties_file}")
- getdownSetAppBaseProperty = false // whether to pass the appbase and appdistdir to the application
+- getdownSetAppBaseProperty = false // whether to pass the appbase and appdistdir to the application
- reportRsyncCommand = false
- jvlChannelName = CHANNEL.toLowerCase()
- install4jSuffix = CHANNEL.substring(0, 1).toUpperCase() + CHANNEL.substring(1).toLowerCase(); // BUILD -> Build
- }
- install4jExtraScheme = "jalviewb"
- break
++ useClover = false
- case [ "RELEASE", "JALVIEWJS-RELEASE" ]:
- getdownAppDistDir = getdown_app_dir_release
- modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
- modules_runtimeClasspath = modules_compileClasspath
- */
+- def details = versionDetails()
+- gitHash = details.gitHash
+- gitBranch = details.branchName
++ resourceClassesDir = classesDir
++
++ testSourceDir = testDir
++ testClassesDir = "${jalviewDir}/${test_output_dir}"
+
++ buildProperties = string("${classesDir}/${build_properties_file}")
++ getdownSetAppBaseProperty = false // whether to pass the appbase and appdistdir to the application
++
+ install4jApplicationName = "${jalview_name}"
+
- def details = versionDetails()
- gitHash = details.gitHash
- gitBranch = details.branchName
-@@ -396,71 +130,16 @@
+ println("Using a ${CHANNEL} profile.")
+
+ additional_compiler_args = []
+@@ -396,71 +109,16 @@
libDistDir = j8libDir
compile_source_compatibility = 1.8
compile_target_compatibility = 1.8
resourceBuildDir = string("${buildDir}/resources")
resourcesBuildDir = string("${resourceBuildDir}/resources_build")
helpBuildDir = string("${resourceBuildDir}/help_build")
-@@ -474,31 +153,6 @@
+@@ -474,31 +132,6 @@
helpSourceDir = string("${helpParentDir}/${help_dir}")
helpFile = string("${helpBuildDir}/${help_dir}/help.jhm")
// ENDEXT
}
-@@ -517,27 +171,12 @@
+@@ -517,27 +150,12 @@
compileClasspath = files(sourceSets.main.java.outputDir)
compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
- srcDirs cloverInstrDir
- outputDir = cloverClassesDir
- }
-
+-
- resources {
- srcDirs = sourceSets.main.resources.srcDirs
- }
--
+
- compileClasspath = files( sourceSets.clover.java.outputDir )
- //compileClasspath += files( testClassesDir )
+ compileClasspath = files(sourceSets.main.java.outputDir)
}
test {
-@@ -557,453 +196,41 @@
+@@ -557,453 +175,41 @@
runtimeClasspath = compileClasspath
runtimeClasspath += files(sourceSets.test.resources.srcDirs)
}
- if (cloverreport_xml_options.length() > 0) {
- argsList += cloverreport_xml_options.split(" ")
- }
-
+-
- args argsList.toArray()
-}
--
--
+
++ compileClasspath = files( sourceSets.test.java.outputDir )
++ compileClasspath += sourceSets.main.compileClasspath
++ compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["** REMOVE_THIS_GAP /*.jar"])
+
-task cloverReport {
- group = "Verification"
- description = "Creates clover reports"
-
-
-compileCloverJava {
-+ compileClasspath = files( sourceSets.test.java.outputDir )
-+ compileClasspath += sourceSets.main.compileClasspath
-+ compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["** REMOVE_THIS_GAP /*.jar"])
-
+-
- doFirst {
- sourceCompatibility = compile_source_compatibility
- targetCompatibility = compile_target_compatibility
print ("Setting target compatibility to "+targetCompatibility+"\n")
}
}
-@@ -1017,7 +244,6 @@
+@@ -1017,7 +223,6 @@
cleanTest {
doFirst {
delete sourceSets.test.java.outputDir
}
-@@ -1306,12 +532,7 @@
+@@ -1031,85 +236,6 @@
+ }
+
+
+-def convertMdToHtml (FileTree mdFiles, File cssFile) {
+- MutableDataSet options = new MutableDataSet()
+-
+- def extensions = new ArrayList<>()
+- extensions.add(AnchorLinkExtension.create())
+- extensions.add(AutolinkExtension.create())
+- extensions.add(StrikethroughExtension.create())
+- extensions.add(TaskListExtension.create())
+- extensions.add(TablesExtension.create())
+- extensions.add(TocExtension.create())
+-
+- options.set(Parser.EXTENSIONS, extensions)
+-
+- // set GFM table parsing options
+- options.set(TablesExtension.WITH_CAPTION, false)
+- options.set(TablesExtension.COLUMN_SPANS, false)
+- options.set(TablesExtension.MIN_HEADER_ROWS, 1)
+- options.set(TablesExtension.MAX_HEADER_ROWS, 1)
+- options.set(TablesExtension.APPEND_MISSING_COLUMNS, true)
+- options.set(TablesExtension.DISCARD_EXTRA_COLUMNS, true)
+- options.set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true)
+- // GFM anchor links
+- options.set(AnchorLinkExtension.ANCHORLINKS_SET_ID, false)
+- options.set(AnchorLinkExtension.ANCHORLINKS_ANCHOR_CLASS, "anchor")
+- options.set(AnchorLinkExtension.ANCHORLINKS_SET_NAME, true)
+- options.set(AnchorLinkExtension.ANCHORLINKS_TEXT_PREFIX, "<span class=\"octicon octicon-link\"></span>")
+-
+- Parser parser = Parser.builder(options).build()
+- HtmlRenderer renderer = HtmlRenderer.builder(options).build()
+-
+- mdFiles.each { mdFile ->
+- // add table of contents
+- def mdText = "[TOC]\n"+mdFile.text
+-
+- // grab the first top-level title
+- def title = null
+- def titleRegex = /(?m)^#(\s+|([^#]))(.*)/
+- def matcher = mdText =~ titleRegex
+- if (matcher.size() > 0) {
+- // matcher[0][2] is the first character of the title if there wasn't any whitespace after the #
+- title = (matcher[0][2] != null ? matcher[0][2] : "")+matcher[0][3]
+- }
+- // or use the filename if none found
+- if (title == null) {
+- title = mdFile.getName()
+- }
+-
+- Node document = parser.parse(mdText)
+- String htmlBody = renderer.render(document)
+- def htmlText = '''<html>
+-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+-<html xmlns="http://www.w3.org/1999/xhtml">
+- <head>
+- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+- <meta http-equiv="Content-Style-Type" content="text/css" />
+- <meta name="generator" content="flexmark" />
+-'''
+- htmlText += ((title != null) ? " <title>${title}</title>" : '' )
+- htmlText += '''
+- <style type="text/css">code{white-space: pre;}</style>
+-'''
+- htmlText += ((cssFile != null) ? cssFile.text : '')
+- htmlText += '''</head>
+- <body>
+-'''
+- htmlText += htmlBody
+- htmlText += '''
+- </body>
+-</html>
+-'''
+-
+- def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html")
+- def htmlFile = file(htmlFilePath)
+- println("Creating ${htmlFilePath}")
+- htmlFile.text = htmlText
+- }
+-}
+-
+-
+ task copyDocs(type: Copy) {
+ def inputDir = "${jalviewDir}/${doc_dir}"
+ def outputDir = "${docBuildDir}/${doc_dir}"
+@@ -1140,27 +266,6 @@
+ }
+
+
+-task convertMdFiles {
+- dependsOn copyDocs
+- def mdFiles = fileTree(dir: docBuildDir, include: "**/*.md")
+- def cssFile = file("${jalviewDir}/${flexmark_css}")
+-
+- doLast {
+- convertMdToHtml(mdFiles, cssFile)
+- }
+-
+- inputs.files(mdFiles)
+- inputs.file(cssFile)
+-
+- def htmlFiles = []
+- mdFiles.each { mdFile ->
+- def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html")
+- htmlFiles.add(file(htmlFilePath))
+- }
+- outputs.files(htmlFiles)
+-}
+-
+-
+ task copyHelp(type: Copy) {
+ def inputDir = helpSourceDir
+ def outputDir = "${helpBuildDir}/${help_dir}"
+@@ -1242,24 +347,15 @@
+ outputs.dir(outputDir)
+ }
+
+-task createBuildProperties(type: WriteProperties) {
+- dependsOn copyResources
+- group = "build"
+- description = "Create the ${buildProperties} file"
+-
+- inputs.dir(sourceDir)
+- inputs.dir(resourcesBuildDir)
+- outputFile (buildProperties)
+- // taking time specific comment out to allow better incremental builds
+- comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
+- //comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
+- property "BUILD_DATE", getDate("HH:mm:ss dd MMMM yyyy")
+- property "VERSION", JALVIEW_VERSION
+- property "INSTALLATION", INSTALLATION+" git-commit:"+gitHash+" ["+gitBranch+"]"
+- if (getdownSetAppBaseProperty) {
+- property "GETDOWNAPPBASE", getdownAppBase
+- property "GETDOWNAPPDISTDIR", getdownAppDistDir
+- }
++task createBuildProperties(type: Copy) {
++ // using the build_properties already included in the source tarball
++ def inputFile = "build_properties"
++ def outputFile = buildProperties
++ from inputFile
++ into file(outputFile).getParent()
++ rename(file(inputFile).getName(), file(outputFile).getName())
++
++ inputs.file(inputFile)
+ outputs.file(outputFile)
+ }
+
+@@ -1293,7 +389,6 @@
+ dependsOn buildResources
+ dependsOn copyDocs
+ dependsOn copyHelp
+- dependsOn convertMdFiles
+ dependsOn buildIndices
+ }
+
+@@ -1306,12 +401,7 @@
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
useTestNG() {
includeGroups testng_groups
-@@ -1323,6 +544,7 @@
+@@ -1323,6 +413,7 @@
maxHeapSize = "1024m"
workingDir = jalviewDir
def testLaf = project.findProperty("test_laf")
if (testLaf != null) {
println("Setting Test LaF to '${testLaf}'")
-@@ -1338,9 +560,6 @@
+@@ -1338,9 +429,6 @@
jvmArgs += additional_compiler_args
doFirst {
}
}
-@@ -1420,1752 +639,7 @@
+@@ -1420,1752 +508,7 @@
sourceSets.main.resources.srcDirs.each{ dir ->
inputs.dir(dir)
}
- println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
- }
- }
--
+
- //def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview/org.eclipse.jdt.core"
- def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview"
- executable(eclipseBinary)
- }
-}
-
-
+-
-task jalviewjsTranspile(type: Exec) {
- dependsOn jalviewjsEclipseSetup
- dependsOn jalviewjsProjectImport
* For properties set within build.gradle, use camelCaseNoSpace.
*/
import org.apache.tools.ant.filters.ReplaceTokens
-import com.vladsch.flexmark.util.ast.Node
-import com.vladsch.flexmark.html.HtmlRenderer
-import com.vladsch.flexmark.parser.Parser
-import com.vladsch.flexmark.util.data.MutableDataSet
-import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension
-import com.vladsch.flexmark.ext.tables.TablesExtension
-import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension
-import com.vladsch.flexmark.ext.autolink.AutolinkExtension
-import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension
-import com.vladsch.flexmark.ext.toc.TocExtension
-
-buildscript {
- dependencies {
- classpath "com.vladsch.flexmark:flexmark-all:0.62.0"
- }
-}
plugins {
id 'java'
id 'application'
- id 'com.palantir.git-version' version '0.12.3'
}
// in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use
}
}
-ext {
+project.ext {
jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
jalviewDirRelativePath = jalviewDir
install4jApplicationName = "${jalview_name}"
- def details = versionDetails()
- gitHash = details.gitHash
- gitBranch = details.branchName
-
println("Using a ${CHANNEL} profile.")
additional_compiler_args = []
}
-def convertMdToHtml (FileTree mdFiles, File cssFile) {
- MutableDataSet options = new MutableDataSet()
-
- def extensions = new ArrayList<>()
- extensions.add(AnchorLinkExtension.create())
- extensions.add(AutolinkExtension.create())
- extensions.add(StrikethroughExtension.create())
- extensions.add(TaskListExtension.create())
- extensions.add(TablesExtension.create())
- extensions.add(TocExtension.create())
-
- options.set(Parser.EXTENSIONS, extensions)
-
- // set GFM table parsing options
- options.set(TablesExtension.WITH_CAPTION, false)
- options.set(TablesExtension.COLUMN_SPANS, false)
- options.set(TablesExtension.MIN_HEADER_ROWS, 1)
- options.set(TablesExtension.MAX_HEADER_ROWS, 1)
- options.set(TablesExtension.APPEND_MISSING_COLUMNS, true)
- options.set(TablesExtension.DISCARD_EXTRA_COLUMNS, true)
- options.set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true)
- // GFM anchor links
- options.set(AnchorLinkExtension.ANCHORLINKS_SET_ID, false)
- options.set(AnchorLinkExtension.ANCHORLINKS_ANCHOR_CLASS, "anchor")
- options.set(AnchorLinkExtension.ANCHORLINKS_SET_NAME, true)
- options.set(AnchorLinkExtension.ANCHORLINKS_TEXT_PREFIX, "<span class=\"octicon octicon-link\"></span>")
-
- Parser parser = Parser.builder(options).build()
- HtmlRenderer renderer = HtmlRenderer.builder(options).build()
-
- mdFiles.each { mdFile ->
- // add table of contents
- def mdText = "[TOC]\n"+mdFile.text
-
- // grab the first top-level title
- def title = null
- def titleRegex = /(?m)^#(\s+|([^#]))(.*)/
- def matcher = mdText =~ titleRegex
- if (matcher.size() > 0) {
- // matcher[0][2] is the first character of the title if there wasn't any whitespace after the #
- title = (matcher[0][2] != null ? matcher[0][2] : "")+matcher[0][3]
- }
- // or use the filename if none found
- if (title == null) {
- title = mdFile.getName()
- }
-
- Node document = parser.parse(mdText)
- String htmlBody = renderer.render(document)
- def htmlText = '''<html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta name="generator" content="flexmark" />
-'''
- htmlText += ((title != null) ? " <title>${title}</title>" : '' )
- htmlText += '''
- <style type="text/css">code{white-space: pre;}</style>
-'''
- htmlText += ((cssFile != null) ? cssFile.text : '')
- htmlText += '''</head>
- <body>
-'''
- htmlText += htmlBody
- htmlText += '''
- </body>
-</html>
-'''
-
- def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html")
- def htmlFile = file(htmlFilePath)
- println("Creating ${htmlFilePath}")
- htmlFile.text = htmlText
- }
-}
-
-
task copyDocs(type: Copy) {
def inputDir = "${jalviewDir}/${doc_dir}"
def outputDir = "${docBuildDir}/${doc_dir}"
}
-task convertMdFiles {
- dependsOn copyDocs
- def mdFiles = fileTree(dir: docBuildDir, include: "**/*.md")
- def cssFile = file("${jalviewDir}/${flexmark_css}")
-
- doLast {
- convertMdToHtml(mdFiles, cssFile)
- }
-
- inputs.files(mdFiles)
- inputs.file(cssFile)
-
- def htmlFiles = []
- mdFiles.each { mdFile ->
- def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html")
- htmlFiles.add(file(htmlFilePath))
- }
- outputs.files(htmlFiles)
-}
-
-
task copyHelp(type: Copy) {
def inputDir = helpSourceDir
def outputDir = "${helpBuildDir}/${help_dir}"
outputs.dir(outputDir)
}
-task createBuildProperties(type: WriteProperties) {
- dependsOn copyResources
- group = "build"
- description = "Create the ${buildProperties} file"
-
- inputs.dir(sourceDir)
- inputs.dir(resourcesBuildDir)
- outputFile (buildProperties)
- // taking time specific comment out to allow better incremental builds
- comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
- //comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
- property "BUILD_DATE", getDate("HH:mm:ss dd MMMM yyyy")
- property "VERSION", JALVIEW_VERSION
- property "INSTALLATION", INSTALLATION+" git-commit:"+gitHash+" ["+gitBranch+"]"
- if (getdownSetAppBaseProperty) {
- property "GETDOWNAPPBASE", getdownAppBase
- property "GETDOWNAPPDISTDIR", getdownAppDistDir
- }
+task createBuildProperties(type: Copy) {
+ // using the build_properties already included in the source tarball
+ def inputFile = "build_properties"
+ def outputFile = buildProperties
+ from inputFile
+ into file(outputFile).getParent()
+ rename(file(inputFile).getName(), file(outputFile).getName())
+
+ inputs.file(inputFile)
outputs.file(outputFile)
}
dependsOn buildResources
dependsOn copyDocs
dependsOn copyHelp
- dependsOn convertMdFiles
dependsOn buildIndices
}