// 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 {
gitHash = details.gitHash
gitBranch = details.branchName
} catch(org.gradle.api.internal.plugins.PluginApplicationException e) {
- println("Not in a git repository")
+ 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.")
}
}
}
+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"
"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
+ }
}