build type

This commit is contained in:
Aria Moradi 2021-05-25 19:23:47 +04:30
parent d2f6a33f0a
commit 4ef32d8037
6 changed files with 15 additions and 11 deletions

View File

@ -61,6 +61,8 @@ jobs:
- name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1
env:
TachideskBuildType: "Preview"
with:
build-root-directory: master
wrapper-directory: master

View File

@ -60,6 +60,8 @@ jobs:
- name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1
env:
TachideskBuildType: "Stable"
with:
build-root-directory: master
wrapper-directory: master

View File

@ -109,16 +109,14 @@ val tachideskRevision = Runtime
}
buildConfig {
appName = rootProject.name
clsName = "BuildConfig"
packageName = "ir.armor.tachidesk.server"
version = tachideskVersion
buildConfigField("String", "name", rootProject.name) // alias for BuildConfig.NAME
buildConfigField("String", "version", tachideskVersion) // alias for BuildConfig.VERSION
buildConfigField("String", "revision", tachideskRevision)
buildConfigField("boolean", "debug", project.hasProperty("debugApp").toString())
buildConfigField("String", "NAME", rootProject.name)
buildConfigField("String", "VERSION", tachideskVersion)
buildConfigField("String", "REVISION", tachideskRevision)
buildConfigField("String", "BUILD_TYPE", if (System.getenv("TachideskBuildType") == "Stable") "Stable" else "Preview")
}
tasks {

View File

@ -40,7 +40,7 @@ val systemTrayInstance by lazy { systemTray() }
val androidCompat by lazy { AndroidCompat() }
fun applicationSetup() {
logger.info("Running Tachidesk ${BuildConfig.version} revision ${BuildConfig.revision}")
logger.info("Running Tachidesk ${BuildConfig.VERSION} revision ${BuildConfig.REVISION}")
// Application dirs
val applicationDirs = ApplicationDirs()

View File

@ -12,13 +12,15 @@ import ir.armor.tachidesk.server.BuildConfig
data class AboutDataClass(
val version: String,
val revision: String,
val buildType: String,
)
object About {
fun getAbout(): AboutDataClass {
return AboutDataClass(
BuildConfig.version,
BuildConfig.revision,
BuildConfig.VERSION,
BuildConfig.REVISION,
BuildConfig.BUILD_TYPE,
)
}
}

View File

@ -22,9 +22,9 @@ object SystemTray {
// ref: https://github.com/dorkbox/SystemTray/blob/master/test/dorkbox/TestTray.java
SystemTray.DEBUG = serverConfig.debugLogsEnabled
CacheUtil.clear(BuildConfig.name)
CacheUtil.clear(BuildConfig.NAME)
val systemTray = SystemTray.get(BuildConfig.name) ?: return null
val systemTray = SystemTray.get(BuildConfig.NAME) ?: return null
val mainMenu = systemTray.menu
mainMenu.add(