X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=b4636bc523f0d453e0e55b241481ccdff87c2e14;hb=refs%2Fheads%2Fpatch%2FJAL-4008_jabaws_2_2_1_patch;hp=bdfcfdf7faad659153f0045a62524022b4bb3a17;hpb=d6837e738b809051f0c389936a20e5750cb73554;p=jalview.git diff --git a/build.gradle b/build.gradle index bdfcfdf..b4636bc 100644 --- a/build.gradle +++ b/build.gradle @@ -115,7 +115,7 @@ ext { // 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 { @@ -392,7 +392,9 @@ ext { 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.") } @@ -2014,6 +2016,22 @@ spotless { } } +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" @@ -2021,6 +2039,9 @@ task sourceDist(type: Tar) { dependsOn createBuildProperties dependsOn convertMdFiles + dependsOn eclipseAllPreferences + dependsOn createSourceReleaseProperties + def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_") def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz" @@ -2045,6 +2066,7 @@ task sourceDist(type: Tar) { "*locales/**", "utils/InstallAnywhere", "**/*.log", + "RELEASE", ] def PROCESS_FILES=[ "AUTHORS", @@ -2054,7 +2076,6 @@ task sourceDist(type: Tar) { "FEATURETODO", "LICENSE", "**/README", - "RELEASE", "THIRDPARTYLIBS", "TESTNG", "build.gradle", @@ -2069,7 +2090,9 @@ task sourceDist(type: Tar) { "**/*.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) { @@ -2116,6 +2139,10 @@ task sourceDist(type: Tar) { }) } + def sourceTarBuildDir = "${buildDir}/sourceTar" + from(sourceTarBuildDir) { + // this includes the appended RELEASE properties file + } }