j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
// this property set by Eclipse
eclipseApplicationProperty = string("eclipse.application")
- // CHECK IF IN ECLIPSE
- IN_ECLIPSE = System.properties[eclipseApplicationProperty].startsWith("org.eclipse.ui.")
- if (System.properties[j2sHeadlessBuildProperty].equals("true")) { // headless build property has been set
+ // CHECK IF RUNNING FROM WITHIN ECLIPSE
+ def eclipseApplicationPropertyVal = System.properties[eclipseApplicationProperty]
+ IN_ECLIPSE = eclipseApplicationPropertyVal != null && eclipseApplicationPropertyVal.startsWith("org.eclipse.ui.")
+ // BUT WITHOUT THE HEADLESS BUILD PROPERTY SET
+ if (System.properties[j2sHeadlessBuildProperty].equals("true")) {
println("Setting IN_ECLIPSE to ${IN_ECLIPSE} as System.properties['${j2sHeadlessBuildProperty}'] == '${System.properties[j2sHeadlessBuildProperty]}'")
IN_ECLIPSE = false
}
+ if (IN_ECLIPSE) {
+ println("WITHIN ECLIPSE IDE")
+ } else {
+ println("HEADLESS BUILD")
+ }
/*
System.properties.sort { it.key }.each {
key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
- jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
+ if (IN_ECLIPSE) {
+ jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
+ } else {
+ jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
+ }
jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
- jalviewjsJalviewCoreName = jalviewjs_core_name
+ jalviewjsJalviewCoreHtmlFile = string("")
+ jalviewjsJalviewCoreName = string(jalviewjs_core_name)
jalviewjsJalviewTemplateName = string(jalviewjs_name)
eclipseWorkspace = null
} // jdt
- synchronizationTasks "eclipseSynchronizationTask"
- autoBuildTasks "eclipseAutoBuildTask"
+ if (IN_ECLIPSE) {
+ // Don't want these to be activated if in headless build
+ synchronizationTasks "eclipseSynchronizationTask"
+ autoBuildTasks "eclipseAutoBuildTask"
+ }
}
args += "-debug"
}
args += [ "--launcher.appendVmargs", "-vmargs", "-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}" ]
+ if (!IN_ECLIPSE) {
+ args += [ "-D${j2sHeadlessBuildProperty}=true" ]
+ }
def stdout
def stderr
}
-task jalviewjsNoTranspileBuildAllCores {
+task jalviewjsBuildAllCores {
+ group "JalviewJS"
+ description "Build the core js lib closures listed in the classlists dir"
+ dependsOn jalviewjsTranspile
dependsOn jalviewjsTransferUnzipSwingJs
def j2sDir = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${jalviewjs_j2s_subdir}"
def logOutFile = file("${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_closure_stdout}")
logOutFile.getParentFile().mkdirs()
logOutFile.createNewFile()
- logOutFile.write(getDate("yyyy-MM-dd HH:mm:ss")+" jalviewjsNoTranspileBuildAllCores\n----\n")
+ logOutFile.write(getDate("yyyy-MM-dd HH:mm:ss")+" jalviewjsBuildAllCores\n----\n")
classlists.each {
jalviewjsCallCore(it.list, prefixFile, suffixFile, it.jsfile, it.zjsfile, logOutFile, jalviewjs_j2s_to_console.equals("true"))
}
-jalviewjsNoTranspileBuildAllCores.mustRunAfter jalviewjsTranspile
-
-
-task jalviewjsBuildAllCores {
- group "JalviewJS"
- description "Build the core js lib closures listed in the classlists dir"
- dependsOn jalviewjsTranspile
- dependsOn jalviewjsNoTranspileBuildAllCores
-}
-
-
-def jalviewjsJalviewCoreHtmlFile
-task jalviewjsNoTranspilePublishCoreTemplate(type: Sync) {
- dependsOn jalviewjsNoTranspileBuildAllCores
+task jalviewjsPublishCoreTemplate(type: Sync) {
+ dependsOn jalviewjsBuildAllCores
def inputFile = file("${jalviewDir}/${j2s_template_html}")
def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}"
beginToken: '_',
endToken: '_',
tokens: [
- 'MAIN': '"'+mainClass+'"',
+ 'MAIN': '"'+mainClassName+'"',
'CODE': "null",
'NAME': jalviewjsJalviewTemplateName
]
}
-task jalviewjsPublishCoreTemplate {
- dependsOn jalviewjsTranspile
+task jalviewjsSyncCore (type: Sync) {
+ dependsOn jalviewjsBuildAllCores
dependsOn jalviewjsPublishCoreTemplate
-}
-
-
-task jalviewjsNoTranspileSyncCore (type: Sync) {
- dependsOn jalviewjsNoTranspileBuildAllCores
- dependsOn jalviewjsNoTranspilePublishCoreTemplate
def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteCoreDir}")
def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
}
-task jalviewjsSyncCore (type: Sync) {
- dependsOn jalviewjsTranspile
- dependsOn jalviewjsNoTranspileSyncCore
- dependsOn "jalviewjsBuildAllCores"
-}
-
-
// this Copy version of TransferSiteJs will delete anything else in the target dir
task jalviewjsCopyTransferSiteJs(type: Copy) {
dependsOn jalviewjsTranspile
// this Sync version of TransferSite is used by buildship to keep the website automatically up to date when a file changes
-task jalviewjsNoTranspileSyncTransferSiteJs(type: Sync) {
+task jalviewjsSyncTransferSiteJs(type: Sync) {
from "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
include "**/*.*"
into "${jalviewDir}/${jalviewjsSiteDir}"
}
}
+
jalviewjsSyncAllLibs.mustRunAfter jalviewjsCopyTransferSiteJs
jalviewjsSyncResources.mustRunAfter jalviewjsCopyTransferSiteJs
jalviewjsSyncSiteResources.mustRunAfter jalviewjsCopyTransferSiteJs
jalviewjsSyncBuildProperties.mustRunAfter jalviewjsCopyTransferSiteJs
-jalviewjsSyncAllLibs.mustRunAfter jalviewjsNoTranspileSyncTransferSiteJs
-jalviewjsSyncResources.mustRunAfter jalviewjsNoTranspileSyncTransferSiteJs
-jalviewjsSyncSiteResources.mustRunAfter jalviewjsNoTranspileSyncTransferSiteJs
-jalviewjsSyncBuildProperties.mustRunAfter jalviewjsNoTranspileSyncTransferSiteJs
-
-
-task jalviewjsNoTranspilePrepareSite {
- dependsOn jalviewjsSyncAllLibs
- dependsOn jalviewjsSyncResources
- dependsOn jalviewjsSyncSiteResources
- dependsOn jalviewjsSyncBuildProperties
- dependsOn jalviewjsNoTranspileSyncCore
-}
+jalviewjsSyncAllLibs.mustRunAfter jalviewjsSyncTransferSiteJs
+jalviewjsSyncResources.mustRunAfter jalviewjsSyncTransferSiteJs
+jalviewjsSyncSiteResources.mustRunAfter jalviewjsSyncTransferSiteJs
+jalviewjsSyncBuildProperties.mustRunAfter jalviewjsSyncTransferSiteJs
task jalviewjsPrepareSite {
}
-task jalviewjsIDE_BuildAllCores {
+task jalviewjsIDE_SyncCore {
group "00 JalviewJS in Eclipse"
- description "Build the core js lib closures listed in the classlists dir"
- dependsOn jalviewjsNoTranspileBuildAllCores
+ description "Build the core js lib closures listed in the classlists dir and publish core html from template"
+ dependsOn jalviewjsSyncCore
+}
+
+
+task jalviewjsIDE_PrepareSite {
+ group "00 JalviewJS in Eclipse"
+ description "Sync libs and resources to site dir, but not closure cores"
+ dependsOn jalviewjsSyncAllLibs
+ dependsOn jalviewjsSyncResources
+ dependsOn jalviewjsSyncSiteResources
+ dependsOn jalviewjsSyncBuildProperties
}
group "00 JalviewJS in Eclipse"
description "Assembles the Eclipse transpiled site and unzips supporting zipfiles"
dependsOn jalviewjsIDE_CopyTransferSiteJs
- dependsOn jalviewjsNoTranspilePrepareSite
+ dependsOn jalviewjsPrepareSite
}
// buildship runs this at build time
task eclipseAutoBuildTask {
- dependsOn jalviewjsNoTranspileSyncTransferSiteJs
- dependsOn jalviewjsNoTranspilePrepareSite
+ dependsOn jalviewjsIDE_PrepareSite
}