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 - name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1 uses: eskatos/gradle-command-action@v1
env:
TachideskBuildType: "Preview"
with: with:
build-root-directory: master build-root-directory: master
wrapper-directory: master wrapper-directory: master

View File

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

View File

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

View File

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

View File

@ -12,13 +12,15 @@ import ir.armor.tachidesk.server.BuildConfig
data class AboutDataClass( data class AboutDataClass(
val version: String, val version: String,
val revision: String, val revision: String,
val buildType: String,
) )
object About { object About {
fun getAbout(): AboutDataClass { fun getAbout(): AboutDataClass {
return AboutDataClass( return AboutDataClass(
BuildConfig.version, BuildConfig.VERSION,
BuildConfig.revision, 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 // ref: https://github.com/dorkbox/SystemTray/blob/master/test/dorkbox/TestTray.java
SystemTray.DEBUG = serverConfig.debugLogsEnabled 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 val mainMenu = systemTray.menu
mainMenu.add( mainMenu.add(