From f92f7d26b1d5f5a056e4cc719ac0b927e633b897 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 29 Apr 2021 19:59:08 -0700 Subject: [PATCH] Renamed ReleaseInfo.mustache to version.mustache. Added deploy script. --- ReleaseInfo.mustache | 32 ----------- deploy.sh | 13 +++++ .../net/thauvin/erik/mobibot/Mobibot.kt | 2 +- version.mustache | 54 +++++++++---------- version.properties | 6 +-- 5 files changed, 42 insertions(+), 65 deletions(-) delete mode 100644 ReleaseInfo.mustache create mode 100755 deploy.sh diff --git a/ReleaseInfo.mustache b/ReleaseInfo.mustache deleted file mode 100644 index b2672e4..0000000 --- a/ReleaseInfo.mustache +++ /dev/null @@ -1,32 +0,0 @@ -/* -* This file is automatically generated. -* Do not modify! -- ALL CHANGES WILL BE ERASED! -*/ -package {{packageName}} - -import java.time.LocalDateTime -import java.time.ZoneId -import java.time.Instant - -/** -* Provides semantic version information. -* -* @author [Semantic Version Annotation Processor](https://github.com/ethauvin/semver) -*/ -object ReleaseInfo{ - const val PROJECT = "{{project}}" - const val VERSION = "{{version}}" - - @JvmField - val BUILDDATE = LocalDateTime.ofInstant(Instant.ofEpochMilli({{epoch}}L), ZoneId.systemDefault()) - - const val MAJOR = {{major}} - const val MINOR = {{minor}} - const val PATCH = {{patch}} - const val BUILDMETA = "{{buildMeta}}" - const val PRERELEASE = "{{preRelease}}" - - const val WEBSITE = "https://www.mobitopia.org/mobibot/" - const val AUTHOR = "Erik C. Thauvin" - const val AUTHOR_URL = "https://erik.thauvin.net/" -} diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..9ac698d --- /dev/null +++ b/deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +DEPLOYDIR=/home/erik/mobitopia/mobibot + +if [ -f "deploy/mobibot.jar" ] +then + /bin/cp deploy/mobibot.jar $DEPLOYDIR + rm -rf $DEPLOYDIR/lib/*.jar + cp deploy/lib/*.jar $DEPLOYDIR/lib + chmod 755 $DEPLOYDIR/*.jar $DEPLOYDIR/lib/*.jar +else + echo "mobibot.jar not found." +fi diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt index a6e4be9..a230ec3 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt @@ -106,7 +106,7 @@ import kotlin.system.exitProcess /** * Implements the #mobitopia bot. */ -@Version(properties = "version.properties", className = "ReleaseInfo", template = "ReleaseInfo.mustache", type = "kt") +@Version(properties = "version.properties", className = "ReleaseInfo", template = "version.mustache", type = "kt") class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Properties) : PircBot() { // Commands and Modules private val addons = Addons() diff --git a/version.mustache b/version.mustache index a090f01..b2672e4 100644 --- a/version.mustache +++ b/version.mustache @@ -1,36 +1,32 @@ /* - * This file is automatically generated. - * Do not modify! -- ALL CHANGES WILL BE ERASED! - */ -package {{packageName}}; +* This file is automatically generated. +* Do not modify! -- ALL CHANGES WILL BE ERASED! +*/ +package {{packageName}} -import java.time.*; +import java.time.LocalDateTime +import java.time.ZoneId +import java.time.Instant /** - * Provides semantic version information. - * - * @author Semantic Version Annotation Processor - */ -public final class {{className}} { - public static final String PROJECT = "{{project}}"; - public static final String VERSION = "{{version}}"; - public static final LocalDateTime BUILDDATE = - LocalDateTime.ofInstant(Instant.ofEpochMilli({{epoch}}L), ZoneId.systemDefault()); +* Provides semantic version information. +* +* @author [Semantic Version Annotation Processor](https://github.com/ethauvin/semver) +*/ +object ReleaseInfo{ + const val PROJECT = "{{project}}" + const val VERSION = "{{version}}" + + @JvmField + val BUILDDATE = LocalDateTime.ofInstant(Instant.ofEpochMilli({{epoch}}L), ZoneId.systemDefault()) - public static final int MAJOR = {{major}}; - public static final int MINOR = {{minor}}; - public static final int PATCH = {{patch}}; - public static final String BUILDMETA = "{{buildMeta}}"; - public static final String PRERELEASE = "{{preRelease}}"; + const val MAJOR = {{major}} + const val MINOR = {{minor}} + const val PATCH = {{patch}} + const val BUILDMETA = "{{buildMeta}}" + const val PRERELEASE = "{{preRelease}}" - public static final String WEBSITE = "https://www.mobitopia.org/mobibot/"; - public static final String AUTHOR = "Erik C. Thauvin"; - public static final String AUTHOR_URL = "https://erik.thauvin.net/"; - - /** - * Disables the default constructor. - */ - private {{className}}() { - throw new UnsupportedOperationException("Illegal constructor call."); - } + const val WEBSITE = "https://www.mobitopia.org/mobibot/" + const val AUTHOR = "Erik C. Thauvin" + const val AUTHOR_URL = "https://erik.thauvin.net/" } diff --git a/version.properties b/version.properties index b0273e9..4842225 100644 --- a/version.properties +++ b/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Thu Apr 29 18:56:59 PDT 2021 -version.buildmeta=526 +#Thu Apr 29 19:35:53 PDT 2021 +version.buildmeta=528 version.major=0 version.minor=8 version.patch=0 version.prerelease=beta version.project=mobibot -version.semver=0.8.0-beta+526 +version.semver=0.8.0-beta+528