}
- println("Using a ${CHANNEL} profile. appbase=${getdown_app_base}")
getdownAppDir = "${getdownWebsiteDir}/${getdown_app_dir}"
//getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
getdownResourceDir = "${getdownWebsiteDir}/${getdown_resource_dir}"
gitHash = ""
gitBranch = ""
+ println("Using a ${CHANNEL} profile. appbase=${getdown_app_base}")
}
def JAVA_INTEGER_VERSION
sourceCompatibility = compile_source_compatibility
targetCompatibility = compile_target_compatibility
jvmArgs += additional_compiler_args
- print ("Setting target compatibility to "+targetCompatibility+"\n")
+
}
task buildIndices(type: JavaExec) {
// go through properties looking for getdown_txt_...
def props = project.properties.sort { it.key }
- if (getdown_alt_java_min_version.length() > 0) {
- props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
- }
- if (getdown_alt_java_max_version.length() > 0) {
- props.put("getdown_txt_java_max_version", getdown_alt_java_max_version)
- }
- props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
+ if (getdown_alt_java_min_version.length() > 0) {
+ props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
+ }
+ if (getdown_alt_java_max_version.length() > 0) {
+ props.put("getdown_txt_java_max_version", getdown_alt_java_max_version)
+ }
+ props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
props.put("getdown_txt_appbase", getdown_app_base)
props.each{ prop, val ->
}
copy {
- from getdownResourceDir
+ from getdownResourceDir
into "${project.ext.getdownFilesDir}/${getdown_resource_dir}"
}
}
dependsOn getdown
dependsOn copyInstall4jTemplate
projectFile = file(install4jConf)
- println("Using projectFile "+projectFile)
variables = [majorVersion: version.substring(2, 11), build: 001, OSX_KEYSTORE: OSX_KEYSTORE, JSIGN_SH: JSIGN_SH]
destination = "${jalviewDir}/${install4jBuildDir}/${JAVA_VERSION}"
buildSelected = true
if (OSX_KEYPASS) {
macKeystorePassword=OSX_KEYPASS
+ }
+ doFirst {
+ println("Using projectFile "+projectFile)
}
inputs.dir(project.ext.getdownWebsiteDir)
inputs.dir(macosJavaVMDir)
inputs.dir(windowsJavaVMDir)
outputs.dir("${jalviewDir}/${install4jBuildDir}/${JAVA_VERSION}")
-
}
clean {
def eclipseWorkspace
task jalviewjsSetEclipseWorkspace {
def propKey = "jalviewjs_eclipse_workspace"
- def propsFileName = "${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}"
- def props = new Properties()
- def eclipseWsDir
def propVal = null
if (project.hasProperty(propKey)) {
propVal = project.getProperty(propKey)
- eclipseWsDir = propVal
}
+ def propsFileName = "${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}"
+ def eclipseWsDir = propVal
+ def props = new Properties()
+
if (( eclipseWsDir == null || !file(eclipseWsDir).exists() ) && file(propsFileName).exists()) {
def ins = new FileInputStream("${jalviewDirAbsolutePath}/${propsFileName}")
props.load(ins)
}
eclipseWorkspace = file(eclipseWsDir)
-
- println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath())
- inputs.property(propKey, propVal)
+ doFirst {
+ println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath())
+ }
+ inputs.property(propKey, eclipseWsDir)
outputs.file(propsFileName)
}
-task jalviewjsUnzipFiles {
- dependsOn jalviewjsSitePath
-
- def zipFiles = fileTree(dir: "${jalviewjs_utils_dir}/${jalviewjs_libjs_dir}", include: "*.zip")
- zipFiles += "${jalviewjs_utils_dir}/${jalviewjs_swingjs_zip}"
-
- doLast {
- zipFiles.each { file_zip ->
- copy {
- from zipTree(file_zip)
- into jalviewjsSiteDir
- }
- }
- }
-
- inputs.files zipFiles
- outputs.dir jalviewjsSiteDir
-}
-
def eclipseDropinsDir
+def utilsDropinsDir
def eclipseBinary
def eclipseVersion
-def fromDropinsDir
+def eclipseDebug = false
+def eclipseVersionSuffix = ""
task jalviewjsEclipsePaths {
def eclipseRoot
def eclipseProduct
+
eclipseRoot = jalviewjs_eclipse_root
if (eclipseRoot.startsWith("~")) {
eclipseRoot = System.getProperty("user.home") + eclipseRoot.substring(1)
}
eclipseVersion = "4.12" // default
+ def assumedVersion = true
if (file(eclipseProduct).exists()) {
def fis = new FileInputStream(eclipseProduct)
def props = new Properties()
props.load(fis)
eclipseVersion = props.getProperty("version")
fis.close()
- println("ECLIPSE_VERSION=${eclipseVersion}")
+ assumedVersion = false
}
String[] v = eclipseVersion.split("\\.")
def v0 = Integer.valueOf(v[0])
def v1 = Integer.valueOf(v[1])
if (v0 < 4 || ( v0 == 4 && v1 < 13 )) {
- fromDropinsDir = "eclipse/dropins_4.12"
+ eclipseVersionSuffix = "_4.12"
} else {
- fromDropinsDir = "eclipse/dropins_4.13"
- }
+ eclipseVersionSuffix = "_4.13"
+ }
+
+ utilsDropinsDir = "${jalviewjs_utils_dir}/${jalviewjs_eclipse_dropins_dir}${eclipseVersionSuffix}"
+ def propKey = "eclipse_debug"
+ eclipseDebug = (project.hasProperty(propKey) && project.getProperty(propKey).equals("true"))
+
+ doFirst {
+ if (!assumedVersion) {
+ println("ECLIPSE_VERSION=${eclipseVersion}")
+ }
+ }
}
task jalviewjsEclipseCopyDropins {
dependsOn jalviewjsEclipsePaths
- def inputFiles = fileTree(dir: "${jalviewjs_utils_dir}/${fromDropinsDir}", include: "*.jar")
+ def inputFiles = fileTree(dir: utilsDropinsDir, include: "*.jar")
def outputDir = eclipseDropinsDir
inputs.files inputFiles
// this version (type: Copy) will delete anything in the eclipse dropins folder that isn't in fromDropinsDir
task NEWjalviewjsEclipseCopyDropins(type: Copy) {
dependsOn jalviewjsEclipsePaths
- from fromDropinsDir
+ from utilsDropinsDir
into eclipseDropinsDir
}
+task jalviewjsUnzipFiles {
+ dependsOn jalviewjsSitePath
+
+ def zipFiles = fileTree(dir: "${jalviewjs_utils_dir}/${jalviewjs_libjs_dir}", include: "*.zip")
+ zipFiles += "${jalviewjs_utils_dir}/${jalviewjs_swingjs_zip}${eclipseVersionSuffix}"
+
+ doLast {
+ zipFiles.each { file_zip ->
+ copy {
+ from zipTree(file_zip)
+ into jalviewjsSiteDir
+ }
+ }
+ }
+
+ inputs.files zipFiles
+ outputs.dir jalviewjsSiteDir
+}
+
task jalviewjsCreateJ2sSettings(type: WriteProperties) {
dependsOn jalviewjsSitePath
outputFile ("${jalviewDir}/${jalviewjs_j2s_settings}")
- def props = project.properties.sort { it.key }
+ def j2s_props = project.properties.findAll { it.key.startsWith("j2s.") }.sort { it.key }
def siteDirProperty = "j2s.site.directory"
def setSiteDir = false
- props.each { prop, val ->
- if (prop.startsWith("j2s.") && val != null) {
+ j2s_props.each { prop, val ->
+ if (val != null) {
if (prop == siteDirProperty) {
if (!(val.startsWith('/') || val.startsWith("file://") )) {
val = "${jalviewjsTransferSiteDir}/${val}"
}
property(prop,val)
}
- if (!setSiteDir) {
+ if (!setSiteDir) { // default site location, don't override specifically set property
property(siteDirProperty,jalviewjsTransferSiteDir)
}
}
- inputs.properties(props.findAll( { k, v -> k.startsWith("j2s.") } ))
+ inputs.properties(j2s_props)
outputs.file(outputFile)
}
}
task jalviewjsProjectImport(type: Exec) {
- // work out how to do this!
dependsOn eclipseProject
dependsOn eclipseClasspath
dependsOn eclipseJdt
dependsOn jalviewjsEclipsePaths
dependsOn jalviewjsEclipseSetup
+
+ def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview/org.eclipse.jdt.core"
executable(eclipseBinary)
args(["-nosplash", "--launcher.suppressErrors", "-application", "com.seeq.eclipse.importprojects.headlessimport", "-data", eclipseWorkspace.getPath(), "-import", jalviewDirAbsolutePath])
- if (eclipse_debug == "true") {
+ if (eclipseDebug) {
args += "-debug"
}
- def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview/org.eclipse.jdt.core"
+ doFirst {
+ println("IMPORT ECLIPSE_DEBUG=${eclipseDebug}")
+ }
+
inputs.file("${jalviewDir}/.project")
outputs.dir(projdir)
outputs.upToDateWhen { file(projdir).exists() }
dependsOn jalviewjsEclipseSetup
dependsOn jalviewjsProjectImport
dependsOn jalviewjsEclipsePaths
+
executable(eclipseBinary)
args(["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-data", eclipseWorkspace, "-${jalviewjs_eclipseBuildArg}", eclipse_project_name ])
- if (eclipse_debug == "true") {
+ if (eclipseDebug) {
args += "-debug"
}
def stdout
def stderr
- doFirst {
- stdout = new ByteArrayOutputStream()
- stderr = new ByteArrayOutputStream()
-
- def logOutFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_stdout}"
- def logOutFile = file(logOutFileName)
- logOutFile.createNewFile()
- def logOutFOS = new FileOutputStream(logOutFile, false)
- //def logErrFileName = "${jalviewjsBuildDir}/${jalviewjs_j2s_stderr}"
- //def logErrFile = file(logFileName)
- //logErrFile.createNewFile()
- //def logErrFOS = new FileErrputStream(logErrFile, false)
- // combine stdout and stderr
- def logErrFOS = logOutFOS
- if (jalviewjs_j2s_to_console.equals("true")) {
- standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
- new org.apache.tools.ant.util.TeeOutputStream(
- logOutFOS,
- stdout),
- standardOutput)
+ stdout = new ByteArrayOutputStream()
+ stderr = new ByteArrayOutputStream()
+
+ def logOutFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_stdout}"
+ def logOutFile = file(logOutFileName)
+ logOutFile.createNewFile()
+ def logOutFOS = new FileOutputStream(logOutFile, false)
+ //def logErrFileName = "${jalviewjsBuildDir}/${jalviewjs_j2s_stderr}"
+ //def logErrFile = file(logFileName)
+ //logErrFile.createNewFile()
+ //def logErrFOS = new FileErrputStream(logErrFile, false)
+ // combine stdout and stderr
+ def logErrFOS = logOutFOS
+ if (jalviewjs_j2s_to_console.equals("true")) {
+ standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
+ new org.apache.tools.ant.util.TeeOutputStream(
+ logOutFOS,
+ stdout),
+ standardOutput)
errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
new org.apache.tools.ant.util.TeeOutputStream(
logErrFOS,
stderr),
errorOutput)
- } else {
- standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
- logOutFOS,
- stdout)
+ } else {
+ standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
+ logOutFOS,
+ stdout)
errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
logErrFOS,
stderr)
- }
}
+
doLast {
if (stdout.toString().contains("Error processing ")) {
// j2s did not complete transpile
}
}
+ doFirst {
+ println("TRANSPILE ECLIPSE_DEBUG=${eclipseDebug}")
+ }
+
inputs.dir(sourceDir)
outputs.dir("${eclipse_bin_dir}/main")
outputs.dir(jalviewjsTransferSiteDir)
group "JalviewJS"
description "Delete all configuration and build artifacts to do with JalviewJS build"
dependsOn cleanJalviewjsSite
+ dependsOn jalviewjsEclipsePaths
doFirst {
delete jalviewjsBuildDir
delete "${jalviewDir}/${eclipse_bin_dir}"
- delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata")
+ if (eclipseWorkspace != null && file(eclipseWorkspace.getAbsolutePath()+"/.metadata").exists()) {
+ delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata")
+ }
delete "${jalviewDir}/${jalviewjs_j2s_settings}"
}
}