From c3ff05f95e570130a20f7af051a3a75f794ebe3e Mon Sep 17 00:00:00 2001 From: Penghai Date: Wed, 28 Aug 2019 16:25:54 +1000 Subject: [PATCH 01/18] Update version to 2019.1.1 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0e70f5cfa0..c914917fb2 100644 --- a/build.sbt +++ b/build.sbt @@ -111,7 +111,7 @@ oracleDriverJar in ThisBuild := { name := "Equella" -equellaMajorMinor in ThisBuild := "2019.1" +equellaMajorMinor in ThisBuild := "2019.1.1" equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname") From 7b95f10d999081f9c719a403904108ec8f6b02de Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 29 Aug 2019 11:17:51 +1000 Subject: [PATCH 02/18] Update EquellaVersion to better support hotfix * Remove the number of commits since last release to form a better name of the Installer/TLEUpgrader * Modify the regular expression to match the new format --- Source/Server/equellaserver/build.sbt | 2 +- build.sbt | 18 +++--------------- project/EquellaVersion.scala | 10 +++++----- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index 37f78df150..26c269cb94 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -331,7 +331,7 @@ upgradeZip := { val log = streams.value.log val ver = equellaVersion.value val outZip - : File = target.value / s"tle-upgrade-${ver.majorMinor}.r${ver.commits} (${ver.majorMinor}-${ver.releaseType}).zip" + : File = target.value / s"tle-upgrade-${ver.majorMinor} (${ver.majorMinor}-${ver.releaseType}).zip" val plugVer = ver.fullVersion val zipFiles = Seq( assembly.value -> "equella-server.jar", diff --git a/build.sbt b/build.sbt index c914917fb2..e17b2b66e0 100644 --- a/build.sbt +++ b/build.sbt @@ -115,20 +115,9 @@ equellaMajorMinor in ThisBuild := "2019.1.1" equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname") -git.useGitDescribe := true - -val TagRegex = """(.*)-(.*)-(\d*)-(.*)""".r -git.gitTagToVersionNumber := { - val streamName = equellaStream.value - val majorMinor = equellaMajorMinor.value - val buildName = equellaBuild.value - - { - case TagRegex(_, _, v, sha) => - Some(EquellaVersion(majorMinor, s"$streamName.$buildName", v.toInt, sha).fullVersion) - case _ => None - } -} +version := EquellaVersion(equellaMajorMinor.value, + s"${equellaStream.value}.${equellaBuild.value}", + git.gitHeadCommit.value.orNull).fullVersion equellaVersion in ThisBuild := EquellaVersion(version.value) @@ -138,7 +127,6 @@ versionProperties in ThisBuild := { props.putAll( Map( "version.mm" -> eqVersion.majorMinor, - "version.mmr" -> s"${eqVersion.majorMinor}.r${eqVersion.commits}", "version.display" -> s"${eqVersion.majorMinor}-${eqVersion.releaseType}", "version.commit" -> eqVersion.sha ).asJava) diff --git a/project/EquellaVersion.scala b/project/EquellaVersion.scala index 9fb74172fe..a01a429f45 100644 --- a/project/EquellaVersion.scala +++ b/project/EquellaVersion.scala @@ -1,11 +1,11 @@ -case class EquellaVersion(majorMinor: String, releaseType: String, commits: Int, sha: String) { - def fullVersion = s"$majorMinor-$releaseType-r$commits-$sha" +case class EquellaVersion(majorMinor: String, releaseType: String, sha: String) { + def fullVersion = s"$majorMinor-$releaseType-$sha" } object EquellaVersion { - val RegEx = """(.*)-(.*)-r(\d*)-(.*)""".r + val RegEx = """(.*)-(.*)-(.*)""".r def apply(s: String): EquellaVersion = s match { - case RegEx(mm, rt, c, sha) => EquellaVersion(mm, rt, c.toInt, sha) - case _ => EquellaVersion("6.5", "Unknown", 0, "00000") + case RegEx(mm, rt, sha) => EquellaVersion(mm, rt, sha) + case _ => EquellaVersion("6.5", "Unknown", "00000") } } From b6f5380185d13221bfb275d2184bab706e23b5bd Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 29 Aug 2019 13:33:00 +1000 Subject: [PATCH 03/18] Ensure autotest can find the correct Installer --- autotest/build.sbt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/autotest/build.sbt b/autotest/build.sbt index e9e058e0fd..e218372602 100644 --- a/autotest/build.sbt +++ b/autotest/build.sbt @@ -69,9 +69,18 @@ installOptions := { def optPath(bc: Config, p: String) = if (bc.hasPath(p)) Some(file(bc.getString(p))) else None autotestInstallerZip := { - val bc = autotestBuildConfig.value - optPath(bc, "install.zip").orElse(optPath(bc, "install.dir").map(d => - (d * "equella-installer-*.zip").get.head)) + val bc = autotestBuildConfig.value + val currentFullVersion = equellaVersion.value + val installerFileName = s"equella-installer-${currentFullVersion.majorMinor}.zip" + val installerTargetDirectory = (target in LocalProject("Installer")).value + val installerFile = installerTargetDirectory / installerFileName + // If the Installer named as installerFileName exists then return it, otherwise returns the default Installer + if (installerFile.exists) { + Some(installerFile) + } else { + optPath(bc, "install.zip").orElse(optPath(bc, "install.dir").map(d => + (d * "equella-installer-*.zip").get.head)) + } } sourceZip := optPath(autotestBuildConfig.value, "install.sourcezip") From 603a1e5e4d96d7867db4792d82c5958bb9a879fd Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 29 Aug 2019 16:27:04 +1000 Subject: [PATCH 04/18] Use short commit hash instead of a full hash --- build.sbt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index e17b2b66e0..ade76f25d4 100644 --- a/build.sbt +++ b/build.sbt @@ -115,9 +115,15 @@ equellaMajorMinor in ThisBuild := "2019.1.1" equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname") -version := EquellaVersion(equellaMajorMinor.value, - s"${equellaStream.value}.${equellaBuild.value}", - git.gitHeadCommit.value.orNull).fullVersion +version := { + val shortCommit = git.gitHeadCommit.value.map { sha => + "g" + sha.take(7) + }.get + + EquellaVersion(equellaMajorMinor.value, + s"${equellaStream.value}.${equellaBuild.value}", + shortCommit).fullVersion +} equellaVersion in ThisBuild := EquellaVersion(version.value) From d1892ef422d4e66fd7e9a3926fbcc47201444ed9 Mon Sep 17 00:00:00 2001 From: Penghai Date: Mon, 2 Sep 2019 16:12:59 +1000 Subject: [PATCH 05/18] Modify the pattern to support artifacts that have no 'mmr' --- .../Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java index 2cb8075d4b..cc790f5b45 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java @@ -24,8 +24,9 @@ import java.util.regex.Pattern; public final class Utils { + // Modify the pattern to support artifacts that have no 'mmr' public static final Pattern VERSION_EXTRACT = - Pattern.compile("^tle-upgrade-(\\d+\\.\\d+\\.r\\d+) \\((.+)\\)\\.zip$"); // $NON-NLS-1$ + Pattern.compile("^tle-upgrade-(\\d+\\.\\d+\\.r?\\d+) \\((.+)\\)\\.zip$"); // $NON-NLS-1$ public static final Comparator VERSION_COMPARATOR = new InverseComparator( From 7a15a6d2f08e7cc19fd0b882a94da3c879ec840e Mon Sep 17 00:00:00 2001 From: Penghai Date: Tue, 3 Sep 2019 11:01:49 +1000 Subject: [PATCH 06/18] * For 2019.1.1, hard code `r0` as part of upgrader name * For future release, use `mm` instead of `mmr` to help the Manager recognise newer or older versions --- Source/Server/equellaserver/build.sbt | 2 +- .../src/com/tle/upgrademanager/ManagerConfig.java | 4 ++-- .../src/com/tle/upgrademanager/Utils.java | 5 ++++- .../com/tle/upgrademanager/helpers/Version.java | 8 ++++---- autotest/build.sbt | 14 +++++++------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index 26c269cb94..ad48278bdd 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -331,7 +331,7 @@ upgradeZip := { val log = streams.value.log val ver = equellaVersion.value val outZip - : File = target.value / s"tle-upgrade-${ver.majorMinor} (${ver.majorMinor}-${ver.releaseType}).zip" + : File = target.value / s"tle-upgrade-${ver.majorMinor}.r0 (${ver.majorMinor}-${ver.releaseType}).zip" val plugVer = ver.fullVersion val zipFiles = Seq( assembly.value -> "equella-server.jar", diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java index 47db73ed5d..fbf1bf8cbd 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java @@ -55,7 +55,7 @@ public class ManagerDetails { private static final String LOADING_TIME_OUT_DEFAULT = "6000"; private static final String SERVER_PORT_DEFAULT = "3000"; - private static final String VERSION_MMR = "version.mmr"; + private static final String VERSION_MM = "version.mm"; private static final String VERSION_DISPLAY = "version.display"; private static final String VERSION_COMMIT = "version.commit"; @@ -81,7 +81,7 @@ protected ManagerDetails(File managerConfigFile, InputStream inputStream) throws fullVersion = MessageFormat.format( "{0} {1} ({2})", - vp.getProperty(VERSION_MMR), + vp.getProperty(VERSION_MM), vp.getProperty(VERSION_DISPLAY), vp.getProperty(VERSION_COMMIT)); } else { diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java index cc790f5b45..cca9020f93 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java @@ -24,7 +24,10 @@ import java.util.regex.Pattern; public final class Utils { - // Modify the pattern to support artifacts that have no 'mmr' + // The below pattern supports both the old automatic versioning scheme (`..r` - + // `2019.1.r123`) + // as well as the newer semver hotfix scheme (.. - `2019.1.1`). Hence the optional + // `r?`. public static final Pattern VERSION_EXTRACT = Pattern.compile("^tle-upgrade-(\\d+\\.\\d+\\.r?\\d+) \\((.+)\\)\\.zip$"); // $NON-NLS-1$ diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java index 964f6e0ba5..1ce6f388b4 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java @@ -102,11 +102,11 @@ public WebVersion getDeployedVersion() { Properties p = new Properties(); p.load(in); version.setDisplayName(p.getProperty("version.display")); - version.setMmr(p.getProperty("version.mmr")); + // As mmr is removed from `version.properties`, replace mmr with mm + String mmr = p.getProperty("version.mm"); + version.setMmr(mmr); version.setFilename( - MessageFormat.format( - "tle-upgrade-{0} ({1}).zip", - p.getProperty("version.mmr"), p.getProperty("version.display"))); + MessageFormat.format("tle-upgrade-{0} ({1}).zip", mmr, p.getProperty("version.display"))); } catch (IOException ex) { version.setDisplayName(Utils.UNKNOWN_VERSION); } diff --git a/autotest/build.sbt b/autotest/build.sbt index e218372602..6c42d9a85d 100644 --- a/autotest/build.sbt +++ b/autotest/build.sbt @@ -69,14 +69,14 @@ installOptions := { def optPath(bc: Config, p: String) = if (bc.hasPath(p)) Some(file(bc.getString(p))) else None autotestInstallerZip := { - val bc = autotestBuildConfig.value - val currentFullVersion = equellaVersion.value - val installerFileName = s"equella-installer-${currentFullVersion.majorMinor}.zip" - val installerTargetDirectory = (target in LocalProject("Installer")).value - val installerFile = installerTargetDirectory / installerFileName + val bc = autotestBuildConfig.value + val equellaFullVersion = equellaVersion.value + val installerFileName = s"equella-installer-${equellaFullVersion.majorMinor}.zip" + val installerDirectory = (target in LocalProject("Installer")).value + val installerAbsoloutePath = installerDirectory / installerFileName // If the Installer named as installerFileName exists then return it, otherwise returns the default Installer - if (installerFile.exists) { - Some(installerFile) + if (installerAbsoloutePath.exists) { + Some(installerAbsoloutePath) } else { optPath(bc, "install.zip").orElse(optPath(bc, "install.dir").map(d => (d * "equella-installer-*.zip").get.head)) From d2f848c520b9fc6c54ea7cf6ed069f483c8d8335 Mon Sep 17 00:00:00 2001 From: Penghai Date: Tue, 3 Sep 2019 14:22:26 +1000 Subject: [PATCH 07/18] refactor Equella version * Support old versions to upgrade to 2019.1.1 * Use semantic versioning --- Installer/build.sbt | 2 +- Source/Server/equellaserver/build.sbt | 2 +- autotest/build.sbt | 2 +- build.sbt | 12 ++++++++---- project/CommonSettings.scala | 4 +++- project/EquellaVersion.scala | 12 +++++++----- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Installer/build.sbt b/Installer/build.sbt index 4d3150af10..59c7184906 100644 --- a/Installer/build.sbt +++ b/Installer/build.sbt @@ -27,7 +27,7 @@ lazy val upgradeManager = LocalProject("UpgradeManager") installerZip := { val log = streams.value.log val ver = equellaVersion.value - val dirname = s"equella-installer-${ver.majorMinor}" + val dirname = s"equella-installer-${ver.semanticVersion}" val outZip = target.value / s"$dirname.zip" val serverData = baseDirectory.value / "data/server" val allServerFiles = serverData ** "*" pair (relativeTo(serverData), false) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index ad48278bdd..92001263f3 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -331,7 +331,7 @@ upgradeZip := { val log = streams.value.log val ver = equellaVersion.value val outZip - : File = target.value / s"tle-upgrade-${ver.majorMinor}.r0 (${ver.majorMinor}-${ver.releaseType}).zip" + : File = target.value / s"tle-upgrade-${ver.major}.${ver.minor}.r${ver.patch} (${ver.semanticVersion}-${ver.releaseType}).zip" val plugVer = ver.fullVersion val zipFiles = Seq( assembly.value -> "equella-server.jar", diff --git a/autotest/build.sbt b/autotest/build.sbt index 6c42d9a85d..9903a551fb 100644 --- a/autotest/build.sbt +++ b/autotest/build.sbt @@ -71,7 +71,7 @@ def optPath(bc: Config, p: String) = if (bc.hasPath(p)) Some(file(bc.getString(p autotestInstallerZip := { val bc = autotestBuildConfig.value val equellaFullVersion = equellaVersion.value - val installerFileName = s"equella-installer-${equellaFullVersion.majorMinor}.zip" + val installerFileName = s"equella-installer-${equellaFullVersion.semanticVersion}.zip" val installerDirectory = (target in LocalProject("Installer")).value val installerAbsoloutePath = installerDirectory / installerFileName // If the Installer named as installerFileName exists then return it, otherwise returns the default Installer diff --git a/build.sbt b/build.sbt index ade76f25d4..42f387d995 100644 --- a/build.sbt +++ b/build.sbt @@ -111,7 +111,9 @@ oracleDriverJar in ThisBuild := { name := "Equella" -equellaMajorMinor in ThisBuild := "2019.1.1" +equellaMajor in ThisBuild := 2019 +equellaMinor in ThisBuild := 1 +equellaPatch in ThisBuild := 1 equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname") @@ -120,7 +122,9 @@ version := { "g" + sha.take(7) }.get - EquellaVersion(equellaMajorMinor.value, + EquellaVersion(equellaMajor.value, + equellaMinor.value, + equellaPatch.value, s"${equellaStream.value}.${equellaBuild.value}", shortCommit).fullVersion } @@ -132,8 +136,8 @@ versionProperties in ThisBuild := { val props = new Properties props.putAll( Map( - "version.mm" -> eqVersion.majorMinor, - "version.display" -> s"${eqVersion.majorMinor}-${eqVersion.releaseType}", + "version.mm" -> s"${eqVersion.major}.${eqVersion.minor}", + "version.display" -> s"${eqVersion.semanticVersion}-${eqVersion.releaseType}", "version.commit" -> eqVersion.sha ).asJava) val f = target.value / "version.properties" diff --git a/project/CommonSettings.scala b/project/CommonSettings.scala index 85bd8eb948..85b3047f4f 100644 --- a/project/CommonSettings.scala +++ b/project/CommonSettings.scala @@ -10,7 +10,9 @@ object CommonSettings extends AutoPlugin { lazy val versionProperties = taskKey[File]("Version property file") lazy val upgradeZip = taskKey[File]("Create upgrade zip") lazy val installerZip = taskKey[File]("Create the installer zip") - lazy val equellaMajorMinor = settingKey[String]("The major minor equella version") + lazy val equellaMajor = settingKey[Int]("The major equella version") + lazy val equellaMinor = settingKey[Int]("The minor equella version") + lazy val equellaPatch = settingKey[Int]("The patch equella version") lazy val equellaStream = settingKey[String]("The equella stream name") lazy val equellaBuild = settingKey[String]("The equella build version") lazy val equellaVersion = settingKey[EquellaVersion]("The full equella version") diff --git a/project/EquellaVersion.scala b/project/EquellaVersion.scala index a01a429f45..1436685522 100644 --- a/project/EquellaVersion.scala +++ b/project/EquellaVersion.scala @@ -1,11 +1,13 @@ -case class EquellaVersion(majorMinor: String, releaseType: String, sha: String) { - def fullVersion = s"$majorMinor-$releaseType-$sha" +case class EquellaVersion(major: Int, minor: Int, patch: Int, releaseType: String, sha: String) { + def semanticVersion = s"$major.$minor.$patch" + def fullVersion = s"$semanticVersion-$releaseType-$sha" } object EquellaVersion { - val RegEx = """(.*)-(.*)-(.*)""".r + val RegEx = """(\d+).(\d+).(\d+)-(.*)-(.*)""".r def apply(s: String): EquellaVersion = s match { - case RegEx(mm, rt, sha) => EquellaVersion(mm, rt, sha) - case _ => EquellaVersion("6.5", "Unknown", "00000") + case RegEx(major, minor, patch, rt, sha) => + EquellaVersion(major.toInt, minor.toInt, patch.toInt, rt, sha) + case _ => EquellaVersion(6, 5, 0, "Unknown", "00000") } } From c19288679d1a34188091567725121c1d1a5a20f7 Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 5 Sep 2019 11:37:15 +1000 Subject: [PATCH 08/18] * Remove `mm` and use `semanticVersion` * On the Manager side, get semanticVersion from displayName --- .../upgraders/UpgradeToEmbeddedTomcat.java | 7 +- .../resources/templates/main.st | 91 +++++++------------ .../resources/templates/version-set.st | 27 ++++-- .../com/tle/upgrademanager/ManagerConfig.java | 6 +- .../src/com/tle/upgrademanager/Utils.java | 2 +- .../upgrademanager/handlers/PagesHandler.java | 22 ++--- .../tle/upgrademanager/helpers/Version.java | 16 ++-- autotest/build.sbt | 14 +-- build.sbt | 1 - project/EquellaVersion.scala | 2 +- 10 files changed, 87 insertions(+), 101 deletions(-) diff --git a/Source/Tools/UpgradeInstallation/src/com/tle/upgrade/upgraders/UpgradeToEmbeddedTomcat.java b/Source/Tools/UpgradeInstallation/src/com/tle/upgrade/upgraders/UpgradeToEmbeddedTomcat.java index 70ada367ce..951c6a7abc 100644 --- a/Source/Tools/UpgradeInstallation/src/com/tle/upgrade/upgraders/UpgradeToEmbeddedTomcat.java +++ b/Source/Tools/UpgradeInstallation/src/com/tle/upgrade/upgraders/UpgradeToEmbeddedTomcat.java @@ -197,9 +197,10 @@ public void upgrade(UpgradeResult result, File tleInstallDir) throws Exception { private File getUpgradeZip(Path installPath, File versionProps) throws ConfigurationException { final PropertiesConfiguration props = new PropertiesConfiguration(versionProps); - final String mmr = (String) props.getProperty("version.mmr"); - final String display = (String) props.getProperty("version.display"); - String filename = MessageFormat.format("tle-upgrade-{0} ({1}).zip", mmr, display); + final String displayName = (String) props.getProperty("version.display"); + final String semanticVersion = displayName.substring(0, displayName.indexOf("-")); + String filename = + MessageFormat.format("tle-upgrade-{0} ({1}).zip", semanticVersion, displayName); return installPath.resolve("manager/updates/" + filename).toFile(); } diff --git a/Source/Tools/UpgradeManager/resources/templates/main.st b/Source/Tools/UpgradeManager/resources/templates/main.st index 8d05b9fcc3..3ad303fa24 100644 --- a/Source/Tools/UpgradeManager/resources/templates/main.st +++ b/Source/Tools/UpgradeManager/resources/templates/main.st @@ -1,59 +1,36 @@ -$("templates/page")(script={ - function updateStatus() \{ - \$.getJSON('/pages/ajaxstatus', function(data) { - \$('#ajaxstatus').empty().append(data[0]); - \$("#mainform").attr("action", data[1]); - setTimeout(updateStatus, $timeout$); - \}); - \} +$("templates/page")(script={ function updateStatus() \{ +\$.getJSON('/pages/ajaxstatus', function(data) { +\$('#ajaxstatus').empty().append(data[0]); \$("#mainform").attr("action", +data[1]); setTimeout(updateStatus, $timeout$); \}); \} function deploy() \{ var +v = \$('.version-item:checked'); if( v.size() == 0 ) \{ alert('You must select a +version above'); return false; \} var results = confirm('Are you sure you want +to deploy version ' + v.val() + '? This will stop the EQUELLA App Server +service.'); if( results != true ) \{ return false; \} //find out which version +was selected? var checked; \$('.version-item').each(function() \{ if( +this.checked ) checked = this; \}); document.location = '/deploy/deploy/' + +checked.value; } \$(function() \{ \$('#deploy').tabs(\{ fx: \{ height: 'toggle', +opacity: 'toggle' \}, selected: $tab_index$ \}); \$('#deploy').tabs('option', +'selected', $tab_index$); updateStatus(); \}); }, content={ +
+
+
Deployed Version:
+
+ $version.displayName$ + ($version.semanticVersion$) +
+
Server Status:
+
...
+
+
- function deploy() \{ - var v = \$('.version-item:checked'); - if( v.size() == 0 ) \{ - alert('You must select a version above'); - return false; - \} - - var results = confirm('Are you sure you want to deploy version ' + v.val() + '? This will stop the EQUELLA App Server service.'); - if( results != true ) \{ - return false; - \} - - //find out which version was selected? - var checked; - \$('.version-item').each(function() \{ - if( this.checked ) - checked = this; - \}); - document.location = '/deploy/deploy/' + checked.value; - } - - \$(function() \{ - \$('#deploy').tabs(\{ - fx: \{ - height: 'toggle', - opacity: 'toggle' - \}, - selected: $tab_index$ - \}); - \$('#deploy').tabs('option', 'selected', $tab_index$); - - updateStatus(); - \}); -}, content={ -
-
-
Deployed Version:
-
$version.displayName$ ($version.mmr$)
-
Server Status:
-
...
-
-
- - + })$ diff --git a/Source/Tools/UpgradeManager/resources/templates/version-set.st b/Source/Tools/UpgradeManager/resources/templates/version-set.st index 86bf7facbf..e34ae89f83 100644 --- a/Source/Tools/UpgradeManager/resources/templates/version-set.st +++ b/Source/Tools/UpgradeManager/resources/templates/version-set.st @@ -1,9 +1,18 @@ -$("templates/heading-content")(heading=heading, content={ - $if(versions)$ -
    - $versions:{
  • }$ -
- $else$ - No versions found - $endif$ -})$ \ No newline at end of file +$("templates/heading-content")(heading=heading, content={ $if(versions)$ +
    + $versions:{ +
  • + +
  • + }$ +
+$else$ No versions found $endif$ })$ diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java index fbf1bf8cbd..8b89a73862 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/ManagerConfig.java @@ -55,7 +55,6 @@ public class ManagerDetails { private static final String LOADING_TIME_OUT_DEFAULT = "6000"; private static final String SERVER_PORT_DEFAULT = "3000"; - private static final String VERSION_MM = "version.mm"; private static final String VERSION_DISPLAY = "version.display"; private static final String VERSION_COMMIT = "version.commit"; @@ -80,10 +79,7 @@ protected ManagerDetails(File managerConfigFile, InputStream inputStream) throws vp.load(inputStream); fullVersion = MessageFormat.format( - "{0} {1} ({2})", - vp.getProperty(VERSION_MM), - vp.getProperty(VERSION_DISPLAY), - vp.getProperty(VERSION_COMMIT)); + "{0} ({1})", vp.getProperty(VERSION_DISPLAY), vp.getProperty(VERSION_COMMIT)); } else { fullVersion = "Unknown"; } diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java index cca9020f93..cdcac09c67 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java @@ -38,7 +38,7 @@ public final class Utils { @Override public String convertToString(WebVersion wv) { - return wv.getMmr(); + return wv.getSemanticVersion(); } }); diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java index 8c3e28627a..d72d95c4c1 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java @@ -158,33 +158,33 @@ public void run() { public static class WebVersion { private String displayName; - private String mmr; + private String semanticVersion; private String filename; - public WebVersion(String dn, String mmr, String fn) { + public WebVersion(String dn, String semanticVersion, String fn) { this.displayName = dn; - this.mmr = mmr; this.filename = fn; + this.semanticVersion = semanticVersion; } public WebVersion() { // Nothing } - public String getDisplayName() { - return displayName; + public void setSemanticVersion(String semanticVersion) { + this.semanticVersion = semanticVersion; } - public void setDisplayName(String displayName) { - this.displayName = displayName; + public String getSemanticVersion() { + return semanticVersion; } - public String getMmr() { - return mmr; + public String getDisplayName() { + return displayName; } - public void setMmr(String mmr) { - this.mmr = mmr; + public void setDisplayName(String displayName) { + this.displayName = displayName; } public String getFilename() { diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java index 1ce6f388b4..f5f5671d6e 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java @@ -77,7 +77,8 @@ public String apply(String filename) { public String apply(String filename) { Matcher m1 = Utils.VERSION_EXTRACT.matcher(filename); if (m1.matches()) { - return m1.group(1); + String displayName = m1.group(2); + return displayName.substring(0, displayName.indexOf("-")); } return null; } @@ -101,12 +102,15 @@ public WebVersion getDeployedVersion() { try (FileInputStream in = new FileInputStream(versionFile)) { Properties p = new Properties(); p.load(in); - version.setDisplayName(p.getProperty("version.display")); - // As mmr is removed from `version.properties`, replace mmr with mm - String mmr = p.getProperty("version.mm"); - version.setMmr(mmr); + + String displayName = p.getProperty("version.display"); + String semanticVersion = displayName.substring(0, displayName.indexOf("-")); + + version.setDisplayName(displayName); + version.setSemanticVersion(semanticVersion); version.setFilename( - MessageFormat.format("tle-upgrade-{0} ({1}).zip", mmr, p.getProperty("version.display"))); + MessageFormat.format( + "tle-upgrade-{0} ({1}).zip", semanticVersion, p.getProperty("version.display"))); } catch (IOException ex) { version.setDisplayName(Utils.UNKNOWN_VERSION); } diff --git a/autotest/build.sbt b/autotest/build.sbt index 9903a551fb..b2d0f7d4af 100644 --- a/autotest/build.sbt +++ b/autotest/build.sbt @@ -69,14 +69,14 @@ installOptions := { def optPath(bc: Config, p: String) = if (bc.hasPath(p)) Some(file(bc.getString(p))) else None autotestInstallerZip := { - val bc = autotestBuildConfig.value - val equellaFullVersion = equellaVersion.value - val installerFileName = s"equella-installer-${equellaFullVersion.semanticVersion}.zip" - val installerDirectory = (target in LocalProject("Installer")).value - val installerAbsoloutePath = installerDirectory / installerFileName + val bc = autotestBuildConfig.value + val equellaFullVersion = equellaVersion.value + val installerFileName = s"equella-installer-${equellaFullVersion.semanticVersion}.zip" + val installerDirectory = (target in LocalProject("Installer")).value + val installerAbsolutePath = installerDirectory / installerFileName // If the Installer named as installerFileName exists then return it, otherwise returns the default Installer - if (installerAbsoloutePath.exists) { - Some(installerAbsoloutePath) + if (installerAbsolutePath.exists) { + Some(installerAbsolutePath) } else { optPath(bc, "install.zip").orElse(optPath(bc, "install.dir").map(d => (d * "equella-installer-*.zip").get.head)) diff --git a/build.sbt b/build.sbt index 42f387d995..a8047c80b9 100644 --- a/build.sbt +++ b/build.sbt @@ -136,7 +136,6 @@ versionProperties in ThisBuild := { val props = new Properties props.putAll( Map( - "version.mm" -> s"${eqVersion.major}.${eqVersion.minor}", "version.display" -> s"${eqVersion.semanticVersion}-${eqVersion.releaseType}", "version.commit" -> eqVersion.sha ).asJava) diff --git a/project/EquellaVersion.scala b/project/EquellaVersion.scala index 1436685522..240d29dac9 100644 --- a/project/EquellaVersion.scala +++ b/project/EquellaVersion.scala @@ -4,7 +4,7 @@ case class EquellaVersion(major: Int, minor: Int, patch: Int, releaseType: Strin } object EquellaVersion { - val RegEx = """(\d+).(\d+).(\d+)-(.*)-(.*)""".r + val RegEx = """(\d+).(\d+).(\d+)-(.+)-(.+)""".r def apply(s: String): EquellaVersion = s match { case RegEx(major, minor, patch, rt, sha) => EquellaVersion(major.toInt, minor.toInt, patch.toInt, rt, sha) From 84a1764a55e03abbda6dfe5ca7178ec6f96870c0 Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 5 Sep 2019 13:51:41 +1000 Subject: [PATCH 09/18] Revert `st` files to right format --- .../resources/templates/main.st | 91 ++++++++++++------- .../resources/templates/version-set.st | 27 ++---- .../tle/upgrademanager/helpers/Version.java | 9 +- 3 files changed, 73 insertions(+), 54 deletions(-) diff --git a/Source/Tools/UpgradeManager/resources/templates/main.st b/Source/Tools/UpgradeManager/resources/templates/main.st index 3ad303fa24..e2af5ad865 100644 --- a/Source/Tools/UpgradeManager/resources/templates/main.st +++ b/Source/Tools/UpgradeManager/resources/templates/main.st @@ -1,36 +1,59 @@ -$("templates/page")(script={ function updateStatus() \{ -\$.getJSON('/pages/ajaxstatus', function(data) { -\$('#ajaxstatus').empty().append(data[0]); \$("#mainform").attr("action", -data[1]); setTimeout(updateStatus, $timeout$); \}); \} function deploy() \{ var -v = \$('.version-item:checked'); if( v.size() == 0 ) \{ alert('You must select a -version above'); return false; \} var results = confirm('Are you sure you want -to deploy version ' + v.val() + '? This will stop the EQUELLA App Server -service.'); if( results != true ) \{ return false; \} //find out which version -was selected? var checked; \$('.version-item').each(function() \{ if( -this.checked ) checked = this; \}); document.location = '/deploy/deploy/' + -checked.value; } \$(function() \{ \$('#deploy').tabs(\{ fx: \{ height: 'toggle', -opacity: 'toggle' \}, selected: $tab_index$ \}); \$('#deploy').tabs('option', -'selected', $tab_index$); updateStatus(); \}); }, content={ -
-
-
Deployed Version:
-
- $version.displayName$ - ($version.semanticVersion$) -
-
Server Status:
-
...
-
-
+$("templates/page")(script={ + function updateStatus() \{ + \$.getJSON('/pages/ajaxstatus', function(data) { + \$('#ajaxstatus').empty().append(data[0]); + \$("#mainform").attr("action", data[1]); + setTimeout(updateStatus, $timeout$); + \}); + \} - + function deploy() \{ + var v = \$('.version-item:checked'); + if( v.size() == 0 ) \{ + alert('You must select a version above'); + return false; + \} + + var results = confirm('Are you sure you want to deploy version ' + v.val() + '? This will stop the EQUELLA App Server service.'); + if( results != true ) \{ + return false; + \} + + //find out which version was selected? + var checked; + \$('.version-item').each(function() \{ + if( this.checked ) + checked = this; + \}); + document.location = '/deploy/deploy/' + checked.value; + } + + \$(function() \{ + \$('#deploy').tabs(\{ + fx: \{ + height: 'toggle', + opacity: 'toggle' + \}, + selected: $tab_index$ + \}); + \$('#deploy').tabs('option', 'selected', $tab_index$); + + updateStatus(); + \}); +}, content={ +
+
+
Deployed Version:
+
$version.displayName$ ($version.semanticVersion$)
+
Server Status:
+
...
+
+
+ + })$ diff --git a/Source/Tools/UpgradeManager/resources/templates/version-set.st b/Source/Tools/UpgradeManager/resources/templates/version-set.st index e34ae89f83..24662f3c68 100644 --- a/Source/Tools/UpgradeManager/resources/templates/version-set.st +++ b/Source/Tools/UpgradeManager/resources/templates/version-set.st @@ -1,18 +1,9 @@ -$("templates/heading-content")(heading=heading, content={ $if(versions)$ -
    - $versions:{ -
  • - -
  • - }$ -
-$else$ No versions found $endif$ })$ +$("templates/heading-content")(heading=heading, content={ + $if(versions)$ +
    + $versions:{
  • }$ +
+ $else$ + No versions found + $endif$ +})$ diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java index f5f5671d6e..4131669ee6 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java @@ -57,6 +57,11 @@ public SortedSet getVersions() { return versions; } + private static String getSemanticVersion(String displayName) { + // semanticVersion is part of displayName, e.g. 2019.1.1-Stable.OSE + return displayName.substring(0, displayName.indexOf("-")); + } + private WebVersion getWebVersionFromFile(String fn) { return new WebVersion( DISPLAY_NAME_ONLY.apply(fn), VERSION_NUMBER_ONLY.apply(fn), FULL_FILENAME.apply(fn)); @@ -78,7 +83,7 @@ public String apply(String filename) { Matcher m1 = Utils.VERSION_EXTRACT.matcher(filename); if (m1.matches()) { String displayName = m1.group(2); - return displayName.substring(0, displayName.indexOf("-")); + return getSemanticVersion(displayName); } return null; } @@ -104,7 +109,7 @@ public WebVersion getDeployedVersion() { p.load(in); String displayName = p.getProperty("version.display"); - String semanticVersion = displayName.substring(0, displayName.indexOf("-")); + String semanticVersion = getSemanticVersion(displayName); version.setDisplayName(displayName); version.setSemanticVersion(semanticVersion); From fdfa6f50168c9a065601098aecf6e226cb83dbd7 Mon Sep 17 00:00:00 2001 From: Penghai Date: Wed, 11 Sep 2019 16:54:54 +1000 Subject: [PATCH 10/18] Tidy up work for two `Version` Java files * Replace mmr with semanticVersion in the Version used in oEQ and Admin Console * Refactor code of the Version used in the Upgrade Manager * Add one more Pattern to validate TLE upgrade file name --- .../impl/QtiAssessmentResultServiceImpl.java | 2 +- .../tle/web/institution/tab/HealthTab.java | 2 +- .../tle/web/resources/ResourcesService.java | 2 +- .../web/template/section/FooterSection.java | 3 +- .../impl/ClusteredTaskServiceImpl.java | 2 +- .../src/com/dytech/edge/common/Version.java | 30 ++++--- .../src/com/tle/upgrademanager/Utils.java | 5 +- .../upgrademanager/handlers/PagesHandler.java | 6 +- .../tle/upgrademanager/helpers/Version.java | 79 +++++++------------ 9 files changed, 54 insertions(+), 77 deletions(-) diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/core/qti/service/impl/QtiAssessmentResultServiceImpl.java b/Source/Plugins/Core/com.equella.core/src/com/tle/core/qti/service/impl/QtiAssessmentResultServiceImpl.java index 026ab57d4a..812c388905 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/core/qti/service/impl/QtiAssessmentResultServiceImpl.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/core/qti/service/impl/QtiAssessmentResultServiceImpl.java @@ -65,7 +65,7 @@ @Singleton public class QtiAssessmentResultServiceImpl implements QtiAssessmentResultService { private static final URI URI_SOURCE = - URI.create("uri://equella/" + ApplicationVersion.get().getMmr()); + URI.create("uri://equella/" + ApplicationVersion.get().getSemanticVersion()); @Inject private QtiAssessmentResultDao dao; diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/web/institution/tab/HealthTab.java b/Source/Plugins/Core/com.equella.core/src/com/tle/web/institution/tab/HealthTab.java index 25bd42506d..0e204b47e0 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/web/institution/tab/HealthTab.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/web/institution/tab/HealthTab.java @@ -273,7 +273,7 @@ public SectionResult renderHtml(RenderEventContext context) throws Exception { .getBody() .addReadyStatements( CHECK_VERSION, - version.getMmr(), + version.getSemanticVersion(), version.getCommit(), version.getDisplay(), VERSION_SERVER_URL, diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/web/resources/ResourcesService.java b/Source/Plugins/Core/com.equella.core/src/com/tle/web/resources/ResourcesService.java index 3739be0ed4..d5a07e822e 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/web/resources/ResourcesService.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/web/resources/ResourcesService.java @@ -26,7 +26,7 @@ @SuppressWarnings("nls") @NonNullByDefault public class ResourcesService { - private static String baseUrl = "p/r/" + ApplicationVersion.get().getMmr() + '/'; + private static String baseUrl = "p/r/" + ApplicationVersion.get().getSemanticVersion() + '/'; private static Map renamed = ImmutableMap.builder() diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/web/template/section/FooterSection.java b/Source/Plugins/Core/com.equella.core/src/com/tle/web/template/section/FooterSection.java index cb7dbbbe0e..1ce94a4563 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/web/template/section/FooterSection.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/web/template/section/FooterSection.java @@ -65,7 +65,8 @@ public SectionResult renderHtml(RenderEventContext context) { if (!guest) { Version version = ApplicationVersion.get(); model.setDisplayVersion(version.getDisplay()); - model.setFullVersion(MessageFormat.format("{0} {1}", version.getMmr(), version.getCommit())); + model.setFullVersion( + MessageFormat.format("{0} {1}", version.getSemanticVersion(), version.getCommit())); } model.setDisplayLinks(!guest); diff --git a/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/services/impl/ClusteredTaskServiceImpl.java b/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/services/impl/ClusteredTaskServiceImpl.java index 180fc6daf0..5f9ab4da50 100644 --- a/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/services/impl/ClusteredTaskServiceImpl.java +++ b/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/services/impl/ClusteredTaskServiceImpl.java @@ -130,7 +130,7 @@ public void init() { if (version.isDevelopment()) { prefix = "tasksdev/"; } else { - prefix = "tasks-" + version.getMmr() + '/'; + prefix = "tasks-" + version.getSemanticVersion() + '/'; } ZK_TASKPATH = prefix + ZK_TASKPATH; ZK_GLOBALTASKPATH = prefix + ZK_GLOBALTASKPATH; diff --git a/Source/Plugins/Platform/com.tle.platform.equella/src/com/dytech/edge/common/Version.java b/Source/Plugins/Platform/com.tle.platform.equella/src/com/dytech/edge/common/Version.java index d0e24468b4..8c006121bc 100644 --- a/Source/Plugins/Platform/com.tle.platform.equella/src/com/dytech/edge/common/Version.java +++ b/Source/Plugins/Platform/com.tle.platform.equella/src/com/dytech/edge/common/Version.java @@ -27,8 +27,8 @@ @SuppressWarnings("nls") public final class Version { - private final String mmr; // MMR = major.minor.revision - private final String display; + private final String displayName; + private final String semanticVersion; private final String commit; private boolean dev; @@ -49,17 +49,15 @@ public static Version load(Properties p) { if (p == null) { return new Version("dev" + new Random().nextInt(1000), "Development", "dev (dev)", true); } else { - return new Version( - p.getProperty("version.mmr"), - p.getProperty("version.display"), - p.getProperty("version.commit"), - false); + String displayName = p.getProperty("version.display"); + String semanticVersion = displayName.substring(0, displayName.indexOf("-")); + return new Version(semanticVersion, displayName, p.getProperty("version.commit"), false); } } - private Version(String mmr, String display, String commit, boolean dev) { - this.mmr = mmr; - this.display = display; + private Version(String semanticVersion, String displayName, String commit, boolean dev) { + this.semanticVersion = semanticVersion; + this.displayName = displayName; this.commit = commit; this.dev = dev; } @@ -72,16 +70,16 @@ public String getCommit() { return commit; } - public String getMmr() { - return mmr; + public String getSemanticVersion() { + return semanticVersion; } public String getDisplay() { - return display; + return displayName; } public String getFull() { - return MessageFormat.format("{0} ({1})", mmr, display); + return MessageFormat.format("{0} ({1})", semanticVersion, displayName); } /** @@ -111,11 +109,11 @@ public boolean greaterVersionThan(String otherVersion) { // Empty or non-digit this.version? Allow anything. Either way return // false. - if (Check.isEmpty(mmr) || !Character.isDigit(mmr.charAt(0))) { + if (Check.isEmpty(semanticVersion) || !Character.isDigit(semanticVersion.charAt(0))) { return false; } - return getMajorMinorValue(mmr) > getMajorMinorValue(otherVersion); + return getMajorMinorValue(semanticVersion) > getMajorMinorValue(otherVersion); } /** diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java index cdcac09c67..43c3d66b4d 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Utils.java @@ -29,7 +29,10 @@ public final class Utils { // as well as the newer semver hotfix scheme (.. - `2019.1.1`). Hence the optional // `r?`. public static final Pattern VERSION_EXTRACT = - Pattern.compile("^tle-upgrade-(\\d+\\.\\d+\\.r?\\d+) \\((.+)\\)\\.zip$"); // $NON-NLS-1$ + Pattern.compile("^tle-upgrade-(\\d+\\.\\d+\\.r?\\d+) \\((.+)\\)\\.zip$"); + + /** Support display versions such as 2019.1.1-Stable.OSE or 6.6-Stable.OSE. */ + public static final Pattern VERSION_DISPLAY = Pattern.compile("^[\\d.]+-[\\w.]+$"); public static final Comparator VERSION_COMPARATOR = new InverseComparator( diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java index d72d95c4c1..95a375a030 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/handlers/PagesHandler.java @@ -161,9 +161,9 @@ public static class WebVersion { private String semanticVersion; private String filename; - public WebVersion(String dn, String semanticVersion, String fn) { - this.displayName = dn; - this.filename = fn; + public WebVersion(String displayName, String semanticVersion, String filename) { + this.displayName = displayName; + this.filename = filename; this.semanticVersion = semanticVersion; } diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java index 4131669ee6..612c112385 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/helpers/Version.java @@ -18,7 +18,6 @@ package com.tle.upgrademanager.helpers; -import com.google.common.base.Function; import com.tle.upgrademanager.ManagerConfig; import com.tle.upgrademanager.Utils; import com.tle.upgrademanager.handlers.PagesHandler.WebVersion; @@ -44,7 +43,7 @@ public SortedSet getVersions() { final SortedSet versions = new TreeSet(Utils.VERSION_COMPARATOR); final File upgradeFolder = config.getUpdatesDir(); - if (upgradeFolder.exists()) { + if (upgradeFolder.isDirectory()) { for (String file : upgradeFolder.list()) { if (file != null && Utils.VERSION_EXTRACT.matcher(file).matches()) { versions.add(getWebVersionFromFile(file)); @@ -57,50 +56,6 @@ public SortedSet getVersions() { return versions; } - private static String getSemanticVersion(String displayName) { - // semanticVersion is part of displayName, e.g. 2019.1.1-Stable.OSE - return displayName.substring(0, displayName.indexOf("-")); - } - - private WebVersion getWebVersionFromFile(String fn) { - return new WebVersion( - DISPLAY_NAME_ONLY.apply(fn), VERSION_NUMBER_ONLY.apply(fn), FULL_FILENAME.apply(fn)); - } - - public static final Function FULL_FILENAME = - new Function() { - @Override - public String apply(String filename) { - Matcher m1 = Utils.VERSION_EXTRACT.matcher(filename); - return m1.matches() ? filename : null; - } - }; - - public static final Function VERSION_NUMBER_ONLY = - new Function() { - @Override - public String apply(String filename) { - Matcher m1 = Utils.VERSION_EXTRACT.matcher(filename); - if (m1.matches()) { - String displayName = m1.group(2); - return getSemanticVersion(displayName); - } - return null; - } - }; - - public static final Function DISPLAY_NAME_ONLY = - new Function() { - @Override - public String apply(String filename) { - Matcher m = Utils.VERSION_EXTRACT.matcher(filename); - if (m.matches()) { - return m.group(2); - } - return null; - } - }; - public WebVersion getDeployedVersion() { WebVersion version = new WebVersion(); File versionFile = new File(getVersionPropertiesDirectory(), "version.properties"); @@ -114,18 +69,13 @@ public WebVersion getDeployedVersion() { version.setDisplayName(displayName); version.setSemanticVersion(semanticVersion); version.setFilename( - MessageFormat.format( - "tle-upgrade-{0} ({1}).zip", semanticVersion, p.getProperty("version.display"))); + MessageFormat.format("tle-upgrade-{0} ({1}).zip", semanticVersion, displayName)); } catch (IOException ex) { version.setDisplayName(Utils.UNKNOWN_VERSION); } return version; } - private File getVersionPropertiesDirectory() { - return new File(config.getInstallDir(), Utils.EQUELLASERVER_DIR); - } - public File getUpgradeFile(String filename) { File vdir = config.getUpdatesDir(); if (vdir.exists()) { @@ -137,4 +87,29 @@ public File getUpgradeFile(String filename) { return null; } + + private File getVersionPropertiesDirectory() { + return new File(config.getInstallDir(), Utils.EQUELLASERVER_DIR); + } + + private static String getSemanticVersion(String displayName) { + // semanticVersion is part of displayName, e.g. 2019.1.1-Stable.OSE + Matcher matcher = Utils.VERSION_DISPLAY.matcher(displayName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Provided display name (" + displayName + ") is invalid."); + } + + return displayName.substring(0, displayName.indexOf("-")); + } + + private WebVersion getWebVersionFromFile(String filename) { + Matcher matcher = Utils.VERSION_EXTRACT.matcher(filename); + + if (!matcher.matches()) { + throw new IllegalArgumentException("Unrecognised filename format for: " + filename); + } + + final String displayName = matcher.group(2); + return new WebVersion(displayName, getSemanticVersion(displayName), filename); + } } From 0fb31222ae3bac06cf23b12c631cdfe89fbb145d Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 12 Sep 2019 09:54:44 +1000 Subject: [PATCH 11/18] Update simpleDBA to 0.1.9 --- Source/Server/equellaserver/build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index 92001263f3..d14e39b125 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -18,7 +18,7 @@ val axis2Version = "1.6.2" val TomcatVersion = "8.5.41" val SwaggerVersion = "1.5.22" val RestEasyVersion = "3.5.0.Final" -val simpledbaVersion = "0.1.8-SNAPSHOT" +val simpledbaVersion = "0.1.9" val circeVersion = "0.11.1" val jsoupVersion = "1.11.3" val sttpVersion = "1.5.11" From ce599d147a4a981e9b6732ec337dd1387fcf2901 Mon Sep 17 00:00:00 2001 From: PenghaiZhang <47203811+PenghaiZhang@users.noreply.github.com> Date: Wed, 28 Aug 2019 16:05:34 +1000 Subject: [PATCH 12/18] Fix ECS registration token issue * Use plain get to ensure the institution cache is checked PR #1189 --- .../impl/ReplicatedCacheServiceImpl.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/replicatedcache/impl/ReplicatedCacheServiceImpl.java b/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/replicatedcache/impl/ReplicatedCacheServiceImpl.java index 5376f82243..9cba3cff8d 100644 --- a/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/replicatedcache/impl/ReplicatedCacheServiceImpl.java +++ b/Source/Plugins/Core/com.equella.serverbase/src/com/tle/core/replicatedcache/impl/ReplicatedCacheServiceImpl.java @@ -51,9 +51,12 @@ import java.io.Serializable; import java.util.Date; import java.util.Iterator; +import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; @Singleton @NonNullByDefault @@ -71,6 +74,8 @@ public class ReplicatedCacheServiceImpl /** Caches identified by cacheId. */ private final Cache> caches = CacheBuilder.newBuilder().build(); + private static final Log LOGGER = LogFactory.getLog(ReplicatedCacheServiceImpl.class); + @Override public synchronized ReplicatedCache getCache( String cacheId, long maxLocalCacheSize, long ttl, TimeUnit ttlUnit) { @@ -144,15 +149,21 @@ public Optional> load(String key) @Override public synchronized Optional get(@NonNull String key) { checkNotNull(key); + if (zookeeperService.isCluster()) { + cache.refresh(CurrentInstitution.get()); + } - LoadingCache>> c = - cache.getIfPresent(CurrentInstitution.get()); - if (c != null) { + LoadingCache>> c; + try { + c = cache.get(CurrentInstitution.get()); Optional> op = c.getUnchecked(key); if (op.isPresent()) { V ev = op.get().getValue(); return Optional.fromNullable(ev); } + + } catch (ExecutionException e) { + LOGGER.error("Fail to access cache of institution " + CurrentInstitution.get()); } return Optional.absent(); } From 642020db4dfafbb0700a75cb624f4cedf99fe54e Mon Sep 17 00:00:00 2001 From: PenghaiZhang <47203811+PenghaiZhang@users.noreply.github.com> Date: Thu, 8 Aug 2019 17:23:36 +1000 Subject: [PATCH 13/18] Fix the slow typing issue in new search UI PR #1158 --- .../Core/com.equella.core/js/package.json | 22 ++++++------ .../js/tsrc/components/AppBarQuery.tsx | 35 ++++++++++++++++--- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/Source/Plugins/Core/com.equella.core/js/package.json b/Source/Plugins/Core/com.equella.core/js/package.json index fd4eafb868..120a5dc798 100644 --- a/Source/Plugins/Core/com.equella.core/js/package.json +++ b/Source/Plugins/Core/com.equella.core/js/package.json @@ -24,19 +24,20 @@ "bundleps:langbundle": "cross-env-shell \"purs bundle \"${npm_package_config_psglob}\" -m Tools.GenLangStrings --main Tools.GenLangStrings -o target/genlang.js\"" }, "dependencies": { - "@date-io/luxon": "1.3.5", + "@date-io/luxon": "1.3.7", "@material-ui/core": "3.9.3", "@material-ui/icons": "3.0.2", "@material-ui/lab": "3.0.0-alpha.30", "@material-ui/styles": "3.0.0-alpha.10", - "@tinymce/tinymce-react": "3.1.1", + "@tinymce/tinymce-react": "3.2.0", "axios": "0.19.0", "create-react-class": "15.6.3", "downshift": "2.2.3", "es6-object-assign": "1.1.0", - "history": "4.7.2", + "history": "4.9.0", "jspolyfill-array.prototype.find": "0.1.3", - "luxon": "1.11.4", + "luxon": "1.16.0", + "lodash": "4.17.11", "material-ui-pickers": "2.2.4", "oeq-cloudproviders": "git+https://github.com/apereo/openEQUELLA-cloudprovidersdk.git#32d958ddfff64ca748e7e1b2eae0f0487946a487", "parcel-bundler": "1.12.1", @@ -66,16 +67,17 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "22.2.3", - "@types/luxon": "1.11.1", + "@types/luxon": "1.15.1", + "@types/lodash": "4.14.136", "@types/tinymce": "4.5.22", - "@types/node": "9.6.48", - "@types/react": "16.8.19", - "@types/react-autosuggest": "9.3.8", + "@types/node": "9.6.49", + "@types/react": "16.8.23", + "@types/react-autosuggest": "9.3.9", "@types/react-color": "2.17.0", "@types/react-dom": "16.8.4", "@types/react-redux": "5.0.21", - "@types/react-router": "5.0.1", - "@types/react-router-dom": "4.3.3", + "@types/react-router": "5.0.2", + "@types/react-router-dom": "4.3.4", "@types/react-swipeable-views": "0.12.2", "@types/redux-logger": "3.0.7", "@types/sprintf-js": "1.1.2", diff --git a/Source/Plugins/Core/com.equella.core/js/tsrc/components/AppBarQuery.tsx b/Source/Plugins/Core/com.equella.core/js/tsrc/components/AppBarQuery.tsx index dbc379eaf8..abd35f5a24 100644 --- a/Source/Plugins/Core/com.equella.core/js/tsrc/components/AppBarQuery.tsx +++ b/Source/Plugins/Core/com.equella.core/js/tsrc/components/AppBarQuery.tsx @@ -3,13 +3,16 @@ import { WithStyles, Icon, withStyles, Theme } from "@material-ui/core"; import { fade } from "@material-ui/core/styles/colorManipulator"; import { createStyles } from "@material-ui/core/styles"; import { commonString } from "../util/commonstrings"; +import { debounce } from "lodash"; interface AppBarQueryProps { onSearch?: (query?: string) => void; onChange: (query: string) => void; query: string; } - +interface AppBarQueryState { + searchText: string; +} const styles = (theme: Theme) => createStyles({ queryWrapper: { @@ -46,17 +49,39 @@ const styles = (theme: Theme) => }); class AppBarQuery extends React.Component< - AppBarQueryProps & WithStyles<"queryWrapper" | "queryIcon" | "queryField"> + AppBarQueryProps & WithStyles<"queryWrapper" | "queryIcon" | "queryField">, + AppBarQueryState > { constructor( props: AppBarQueryProps & WithStyles<"queryWrapper" | "queryIcon" | "queryField"> ) { super(props); + this.state = { + searchText: "" + }; } + // Do a search after user stops typing for 500 milliseconds. + // Purescript passes a concrete search function to onChange. + debouncedSearch = debounce(() => { + this.props.onChange(this.state.searchText); + }, 500); + + handleTextChange = (e: React.ChangeEvent) => { + this.setState( + { + searchText: e.target.value + }, + () => { + this.debouncedSearch(); + } + ); + }; + render() { - const { classes, onChange, query } = this.props; + const { classes } = this.props; + const { searchText } = this.state; return (
@@ -66,8 +91,8 @@ class AppBarQuery extends React.Component< type="text" aria-label={commonString.action.search} className={classes.queryField} - value={query} - onChange={e => onChange(e.target.value)} + value={searchText} + onChange={this.handleTextChange} />
); From cd1880b27ec0c476c09dc8345c2d8393a278c526 Mon Sep 17 00:00:00 2001 From: SammyIsConfused Date: Fri, 6 Sep 2019 13:05:09 +1000 Subject: [PATCH 14/18] Add NoCache to wizard state update api (#1217) --- .../scalasrc/com/tle/web/api/wizard/WizardApi.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala index 66e62eabb2..ed4de0e79a 100644 --- a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala +++ b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala @@ -45,6 +45,7 @@ import javax.servlet.http.HttpServletRequest import javax.ws.rs._ import javax.ws.rs.core.Response.{ResponseBuilder, Status} import javax.ws.rs.core.{Context, Response, StreamingOutput, UriInfo} +import org.jboss.resteasy.annotations.cache.NoCache import scala.collection.JavaConverters._ import scala.concurrent.ExecutionContext.Implicits @@ -82,6 +83,7 @@ class WizardApi { } @GET + @NoCache @Path("state") def getState(@PathParam("wizid") wizid: String, @Context req: HttpServletRequest): ItemState = { withWizardState(wizid, req, false) { wsi => From fc4d32da397c6264950b558fbc1650c71af5b273 Mon Sep 17 00:00:00 2001 From: SammyIsConfused Date: Mon, 9 Sep 2019 09:06:10 +1000 Subject: [PATCH 15/18] Add NoCache to wizard state provider api (#1228) --- .../scalasrc/com/tle/web/api/wizard/WizardApi.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala index ed4de0e79a..af2af88cd0 100644 --- a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala +++ b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/wizard/WizardApi.scala @@ -184,6 +184,7 @@ class WizardApi { } + @NoCache @GET @Path("provider/{providerId}/{serviceId}") def proxyGET(@PathParam("wizid") wizid: String, From 0f313e2125a0f2313e3853e040c191b919de5443 Mon Sep 17 00:00:00 2001 From: Penghai Date: Mon, 16 Sep 2019 09:42:50 +1000 Subject: [PATCH 16/18] Update S3 security credentials for Travis CI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 764b2334d4..41d8729532 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,6 @@ after_success: - aws s3 --region us-east-1 cp --recursive s3://edalexdev/equella_artifacts/$TRAVIS_BRANCH/$TRAVIS_BUILD_NUMBER/ s3://edalexdev/equella_artifacts/$TRAVIS_BRANCH/latest/ env: global: - - secure: t1XK7R/R3+gYgJCL+YNFPfpew+QZXl5b7jFkfNOwKDG+gGEApZCrx5NNkA+anPbK4VLnmjGz4EgIItfsSOmEQL6W4jr1MiD6cQV8RV9tYHhPmfPiJy0aDWOgIWIxPtpzAcSvgkZzCheHxY8PGbTi+XStRMfF6/Iat6cN7erHcO9Ur3ri10uas01xPaJJC+naXZGx0JZDTRLmGc8GFzgOwaiIUWOzPZyqsqnBEytvyuJFGe1BUfVEvr4UUb/LBiH0UgpganncFy2WHX+CWT8VFemIoNCM7jAp5oKCTHWyEH72WzGGo6+RCnmJs3Loc+6IUT2M7qNhEm8+PmQwWL9d5ihb6OSnJG9u+Pmq88E+E0eOzZnhQ3XpRjI1CRYYOKi8RBPAjlGDYBMSOo0HRzDJnuU+ZdwdJCZ0x7a/2xCgpxA2YpH+FycGWQo9b+n5JYl++n7gfaJhVcbxrob5TfcgDyj4M3Mkr0bsAwueYG1hY9vFNq9wbgFXA5UPL/khJt9OtR3akEBnrx9lySK0tXtq7zj+KKit92Ty+EfhtEF29IHHHn/pyvFBzWjO1VqsRm+cnOIyY2nLz9D8SZGaaJy7elbXc+PLjd8eHSwX/dY7DyB4MO0td4E40H+Wwxy0pfZXW5x+tdo0UGLBb9i5OoLuKFcRjmj02WcIi6TqJ3EbNdQ= - - secure: fao/RBFgwO/kaxMGbAsR2xuQgnXebRSPgIrASx/W7ELrZoHB3Jvz5ES7danGYXfONUKaPCdqe1/JTm34aDrp/sER6CMYlz4LvlzzhxV+ajo1kFqgzaUWquzGtQ3STXu5BiPEITVqm4CYOZ8bB7yr3HnmPRBOPvJIG0xg3Cehwz0Ux8Yc/YFJbfpr9p97U+x+JJfa+g1sRRXTQHUPdTl3uBJOtk5shCWoDSJl0Axe1gJ37gNUnJOZUwL6Ejb2Hlv2CuxBjglIZ7mhJkOiL9ALbNDOsjp+Xx6ieSSEVAEmqtQdzAVO63GmXVBQcyWIrisgLzTRbMM0ZPtraUXgN6b44ijw6kS5miQvd0vDenFVailgyizjqO28n1xhYyX+uEqz+BMFS4VybTKSdZHjDHRHhFXK6oSqcmKN941X+LsGu7rWp5aVyu1hJjaKz3InjheZphILY7sbLEzoOckicH3TikliwxNEbUCFUOtkmutY+B3SVy9SNyoCW2vjhbiP9ZeXW0hxjG0SvJxOXzWJknY4cnpO7ee5UcBDYmlSdOlA192FO4UfyqgHrL5hVRCYKGB2xD+XHy+XYKFUV+VpWiiMQXCxV1FmRHeZlS144/07H+DIlkeUapLn7Cdj/NhDjSn9fXnSNbA/qbs9aIYm1Wx4pRoj0S2iVRe4FE6RFJWMgyk= + - secure: m/3VbdtVnnEb8J4MrEhH4w8ELHTu4yGPkHcLQ9WSVNnZ6PskuHvxxpsAVVHz9WKj/9WVI4RJdpv5iouj+gugYUOo2cRGcg9hW9He554fbRfudnkAzBLUV4an71vnoxbSTdc+doGNpyF4rt/jdgVDzpGEsgv61By8C+oPpPjZiXcnjPmuVUyPaJWaJpp9/BpQusAiRjFqcphWeHAAd5Gp76D7OhEGL+y8q4fWXsvN58kbDKMXzs8F3aGyZ0QIApHDdT4FdgVFrt2kjrw/4V8ZaB4poR/8slK1pbsiklY+oamXk+e0Xkwf/B23KEWZZObWlUGIZX40EuzVBSGGq1eLWE96SM+HXN39PYvGPSRJ2lGuGvAr1NSlFwFIukTpW58ZiOVsK/IDoahj1zmhr1xvPmoc6YceSpVqqh2g4UDWJU3mQwNnGwhfn2K/td4pDsazaWYhnm2DjW5e7a03uA5ccf4Cfb2AaqE5ED7hGnTifkQbnykaNXtVLyDVzHf44022FM6ldpEWP2yWrLUhKJ9yNMsmMeYYdWRj/itSdZ895hzXtFO4kcY4NR8MF+7njTx1rwFk1kTsLZ0OX6Z36LUvnVpisLxaRuiN+LGSoTRzPpzVDnGa3lL9TQw3eVbqEUuRDlg1rDOf42KNMhT6nttCwqTthKTewuXA9QuYV5VTuXs= + - secure: kUfo8ful+ObyD6zPttIxB5dHwCbvUhgZBhvb7cJQ+6xnqdI5WPnSDes2zYyPklh9+p7bt00v3vGLhNem719a3Me3Ju2QjTSZiOtLvZod3klZRokNsgDkJNjNRhtgflThSvcYUbclNZe9pyQ6lz1EOffbTSMJx09OcdkF/gN7B0xK04ha+pWyNb6lqPeKx6q44k+qVotflpFh56eiyNoC4VZ6MgF+N51A/dDQyJJpPhqWkIup7Q8uD2bzPWcz5PN4YBqezrwT4qxbdeejzQ+fwCIT0Ls7B59rivyDp7Esp35TamTbZLK24Je0/Lg/hsW5ybA3/PmFOU2QUdzc2YZ8aT6p9QQjr1F3EDRsyMYmqYUtuFI9KzROoNaQ21If1HoGXZkL83RvCuE36xTDOuLifVWNiEOdII2hb62lW2s/JBcSUS0BlFd2UoxsrPzohBF4gQjQTbWwV9HW+sdHxk20YpU4IG7pyEiQO2Hsuau/M9iCdp0lsgKo6My43kzQSGZTPgESNKWg+YKxy07mgptttErHuDyVrVq6qMMFX+OI8QmUb31GR5j0g3lTPrfpAYyL/Vzlg/T9b8BUc7WYWWL5P41TIb9WMIgmLtARsGkEz/fsa1Cb9tMiZ7jOQLRxq455f54tC55LzhgrO+2elFku8a/cbWXguHzyKf301qHoZGI= - NODE_JS_VERSION=8.11.3 From 1172a1d40bf35f8802f99a06734acd13322d455b Mon Sep 17 00:00:00 2001 From: Penghai Date: Wed, 18 Sep 2019 14:24:06 +1000 Subject: [PATCH 17/18] Rename TLEUpgrader to support upgrading from 2019.1 --- Source/Server/equellaserver/build.sbt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index d14e39b125..0be0fdec3d 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -327,11 +327,14 @@ additionalPlugins := { } } +import java.time.LocalDate +import java.time.format.DateTimeFormatter upgradeZip := { - val log = streams.value.log - val ver = equellaVersion.value + val log = streams.value.log + val ver = equellaVersion.value + var releaseDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) val outZip - : File = target.value / s"tle-upgrade-${ver.major}.${ver.minor}.r${ver.patch} (${ver.semanticVersion}-${ver.releaseType}).zip" + : File = target.value / s"tle-upgrade-${ver.major}.${ver.minor}.r${releaseDate} (${ver.semanticVersion}-${ver.releaseType}).zip" val plugVer = ver.fullVersion val zipFiles = Seq( assembly.value -> "equella-server.jar", From faf11cfd78fd422c3ad4fce9267b80fc94b9f272 Mon Sep 17 00:00:00 2001 From: Penghai Date: Wed, 18 Sep 2019 15:47:38 +1000 Subject: [PATCH 18/18] Move imports to the file top --- Source/Server/equellaserver/build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index 0be0fdec3d..183e13f7cc 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -1,4 +1,6 @@ import Path.rebase +import java.time.LocalDate +import java.time.format.DateTimeFormatter javacOptions ++= Seq("-source", "1.8") @@ -327,8 +329,6 @@ additionalPlugins := { } } -import java.time.LocalDate -import java.time.format.DateTimeFormatter upgradeZip := { val log = streams.value.log val ver = equellaVersion.value