def jalviewjsBuildDir
def jalviewjsSiteDir
-def jalviewjsTransferSiteDir
+def jalviewjsTransferSiteJSDir
+def jalviewjsTransferSiteLibDir
task jalviewjsSitePath {
def relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
jalviewjsBuildDir = "${relativeBuildDir}/jalviewjs"
jalviewjsSiteDir = "${jalviewjsBuildDir}/${jalviewjs_site_dir}"
- jalviewjsTransferSiteDir = "${jalviewjsBuildDir}/tmp/site"
+ jalviewjsTransferSiteJSDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js"
+ jalviewjsTransferSiteLibDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib"
}
def eclipseWorkspace
jalviewjsEclipseCopyDropins.finalizedBy jalviewjsCleanEclipse
*/
-task jalviewjsUnzipFiles {
+def jalviewjsTransferSiteUnzipDir
+task jalviewjsTransferUnzipLib {
dependsOn jalviewjsSitePath
def zipFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_libjs_dir}", include: "*.zip")
zipFiles.each { file_zip ->
copy {
from zipTree(file_zip)
- into "${jalviewDir}/${jalviewjsSiteDir}"
+ into "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
}
}
}
inputs.files zipFiles
- outputs.dir "${jalviewDir}/${jalviewjsSiteDir}"
+ outputs.dir "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
}
task jalviewjsCreateJ2sSettings(type: WriteProperties) {
if (val != null) {
if (prop == siteDirProperty) {
if (!(val.startsWith('/') || val.startsWith("file://") )) {
- val = "${jalviewDir}/${jalviewjsTransferSiteDir}/${val}"
+ val = "${jalviewDir}/${jalviewjsTransferSiteJSDir}/${val}"
}
setSiteDir = true
}
property(prop,val)
}
if (!setSiteDir) { // default site location, don't override specifically set property
- property(siteDirProperty,"${jalviewDir}/${jalviewjsTransferSiteDir}")
+ property(siteDirProperty,"${jalviewDir}/${jalviewjsTransferSiteJSDir}")
}
}
inputs.properties(j2s_props)
dependsOn jalviewjsCreateJ2sSettings
}
+task jalviewjsSyncLib (type: Sync) {
+ dependsOn jalviewjsSitePath
+ dependsOn jalviewjsTransferUnzipLib
+ def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteLibDir}")
+ def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
+
+ from inputFiles
+ into outputDir
+ def outputFiles = []
+ rename { filename ->
+ outputFiles += "${outputDir}/${filename}"
+ null
+ }
+ preserve {
+ include "**"
+ }
+ outputs.files outputFiles
+ inputs.files inputFiles
+}
+
task jalviewjsSyncResources (type: Sync) {
dependsOn jalviewjsSitePath
def inputFiles = fileTree(dir: "${jalviewDir}/${resourceDir}")
}
inputs.dir("${jalviewDir}/${sourceDir}")
- outputs.dir("${jalviewDir}/${jalviewjsTransferSiteDir}")
- outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteDir}${jalviewjs_server_resource}").exists() } )
+ outputs.dir("${jalviewDir}/${jalviewjsTransferSiteJSDir}")
+ outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteJSDir}${jalviewjs_server_resource}").exists() } )
}
task jalviewjsCopyTransferSite(type: Copy) {
dependsOn jalviewjsTranspile
- from "${jalviewDir}/${jalviewjsTransferSiteDir}"
+ from "${jalviewDir}/${jalviewjsTransferSiteJSDir}"
into "${jalviewDir}/${jalviewjsSiteDir}"
}
// this Sync version is used by buildship to keep the website automatically up to date when a file changes
task jalviewjsSyncTransferSite(type: Sync) {
- from "${jalviewDir}/${jalviewjsTransferSiteDir}"
+ from "${jalviewDir}/${jalviewjsTransferSiteJSDir}"
include "**/*.*"
into "${jalviewDir}/${jalviewjsSiteDir}"
preserve {
}
}
-jalviewjsUnzipFiles.mustRunAfter jalviewjsCopyTransferSite
+jalviewjsSyncLib.mustRunAfter jalviewjsCopyTransferSite
jalviewjsSyncResources.mustRunAfter jalviewjsCopyTransferSite
jalviewjsSyncSiteResources.mustRunAfter jalviewjsCopyTransferSite
-jalviewjsUnzipFiles.mustRunAfter jalviewjsSyncTransferSite
+jalviewjsSyncLib.mustRunAfter jalviewjsSyncTransferSite
jalviewjsSyncResources.mustRunAfter jalviewjsSyncTransferSite
jalviewjsSyncSiteResources.mustRunAfter jalviewjsSyncTransferSite
task jalviewjsPrepareSite {
group "JalviewJS"
description "Prepares the website folder including unzipping files and copying resources"
- dependsOn jalviewjsSitePath
- dependsOn jalviewjsUnzipFiles
+ dependsOn jalviewjsSyncLib
dependsOn jalviewjsSyncResources
dependsOn jalviewjsSyncSiteResources
}
task cleanJalviewjsSite {
doFirst {
- delete "${jalviewDir}/${jalviewjsTransferSiteDir}"
+ delete "${jalviewDir}/${jalviewjsTransferSiteJSDir}"
delete "${jalviewDir}/${jalviewjsSiteDir}"
}
}
task jalviewjsIDE_CopyTransferSite(type: Copy) {
- from "${jalviewDir}/${jalviewjsTransferSiteDir}"
+ from "${jalviewDir}/${jalviewjsTransferSiteJSDir}"
into "${jalviewDir}/${jalviewjsSiteDir}"
}