id 'eclipse'
id "com.diffplug.gradle.spotless" version "3.28.0"
id 'com.github.johnrengelman.shadow' version '4.0.3'
- id 'com.install4j.gradle' version '8.0.10'
+ id 'com.install4j.gradle' version '9.0.6'
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.13.0' apply false
}
repositories {
// Import releaseProps from the RELEASE file
// or a file specified via JALVIEW_RELEASE_FILE if defined
// Expect jalview.version and target release branch in jalview.release
- def releaseProps = new Properties();
+ releaseProps = new Properties();
def releasePropFile = findProperty("JALVIEW_RELEASE_FILE");
def defaultReleasePropFile = "${jalviewDirAbsolutePath}/RELEASE";
try {
modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
modules_runtimeClasspath = modules_compileClasspath
*/
- def details = versionDetails()
- gitHash = details.gitHash
- gitBranch = details.branchName
+
+ gitHash = "SOURCE"
+ gitBranch = "Source"
+ try {
+ apply plugin: "com.palantir.git-version"
+ def details = versionDetails()
+ gitHash = details.gitHash
+ gitBranch = details.branchName
+ } catch(org.gradle.api.internal.plugins.PluginApplicationException e) {
+ println("Not in a git repository. Using git values from RELEASE properties file.")
+ gitHash = releaseProps.getProperty("git.hash")
+ gitBranch = releaseProps.getProperty("git.branch")
+ } catch(java.lang.RuntimeException e1) {
+ throw new GradleException("Error with git-version plugin. Directory '.git' exists but versionDetails() cannot be found.")
+ }
println("Using a ${CHANNEL} profile.")
jreInstallsDir = System.getProperty("user.home") + jreInstallsDir.substring(1)
}
macosJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-mac-x64/jre")
- macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-mac-x64.tar.gz")
windowsJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-windows-x64/jre")
- windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-windows-x64.tar.gz")
linuxJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-linux-x64/jre")
- linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-linux-x64.tar.gz")
+ macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre_${JAVA_INTEGER_VERSION}_mac_x64.tar.gz")
+ windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre_${JAVA_INTEGER_VERSION}_windows_x64.tar.gz")
+ linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre_${JAVA_INTEGER_VERSION}_linux_x64.tar.gz")
install4jDir = string("${jalviewDir}/${install4j_utils_dir}")
install4jConfFileName = string("jalview-install4j-conf.install4j")
install4jConfFile = file("${install4jDir}/${install4jConfFileName}")
codeFiles += f
}
}
- codeFiles.sort().each{f ->
+ def jalviewJar = jar.archiveFileName.getOrNull()
+ // put jalview.jar first for CLASSPATH and .properties files reasons
+ codeFiles.sort{a, b -> ( a.getName() == jalviewJar ? -1 : ( b.getName() == jalviewJar ? 1 : a <=> b ) ) }.each{f ->
def name = f.getName()
def line = "code = ${getdownAppDistDir}/${name}\n"
getdownTextString += line
}
}
+ // disable install screen for OSX dmg (for 2.11.2.0)
+ install4jConfigXml.'**'.macosArchive.each { macosArchive ->
+ macosArchive.attributes().remove('executeSetupApp')
+ macosArchive.attributes().remove('setupAppId')
+ }
+
// turn off checksum creation for LOCAL channel
def e = install4jConfigXml.application[0]
if (CHANNEL == "LOCAL") {
}
}
+task createSourceReleaseProperties(type: WriteProperties) {
+ group = "distribution"
+ description = "Create the source RELEASE properties file"
+
+ def sourceTarBuildDir = "${buildDir}/sourceTar"
+ def sourceReleasePropertiesFile = "${sourceTarBuildDir}/RELEASE"
+ outputFile (sourceReleasePropertiesFile)
+
+ doFirst {
+ releaseProps.each{ key, val -> property key, val }
+ property "git.branch", gitBranch
+ property "git.hash", gitHash
+ }
+
+ outputs.file(outputFile)
+}
task sourceDist(type: Tar) {
group "distribution"
dependsOn createBuildProperties
dependsOn convertMdFiles
+ dependsOn eclipseAllPreferences
+ dependsOn createSourceReleaseProperties
+
def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
"*locales/**",
"utils/InstallAnywhere",
"**/*.log",
+ "RELEASE",
]
def PROCESS_FILES=[
"AUTHORS",
"FEATURETODO",
"LICENSE",
"**/README",
- "RELEASE",
"THIRDPARTYLIBS",
"TESTNG",
"build.gradle",
"**/*.sh",
]
def INCLUDE_FILES=[
- ".settings/org.eclipse.jdt.core.jalview.prefs",
+ ".classpath",
+ ".settings/org.eclipse.buildship.core.prefs",
+ ".settings/org.eclipse.jdt.core.prefs"
]
from(jalviewDir) {
})
}
+ def sourceTarBuildDir = "${buildDir}/sourceTar"
+ from(sourceTarBuildDir) {
+ // this includes the appended RELEASE properties file
+ }
}