Skip to content

Commit 1c706c8

Browse files
author
Simon Schubert
committed
Upgrade sdks and refactor app version storing
1 parent b4aab47 commit 1c706c8

File tree

12 files changed

+45
-30
lines changed

12 files changed

+45
-30
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Icon](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandLibrary/master/art/web_hi_res_144.png)
44

5-
The app currently has **6724** manual pages, **22+** basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
5+
The app currently has **6766** manual pages, **22+** basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
66

77
[![Play Store](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/play_store_badge.png)](https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca)
88
[![F-Droid](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/fdroid_badge.png)](https://f-droid.org/en/packages/com.inspiredandroid.linuxcommandbibliotheca/)

android/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55
}
66

77
group = "com.inspiredandroid.linuxcommandbibliotheca"
8-
version = parent!!.version
98

109
repositories {
1110
mavenCentral()
@@ -39,8 +38,11 @@ android {
3938
applicationId = "com.inspiredandroid.linuxcommandbibliotheca"
4039
minSdk = 24
4140
targetSdk = 35
42-
versionCode = 103
43-
versionName = project.version.toString()
41+
versionCode =
42+
libs.versions.androidVersionCode
43+
.get()
44+
.toInt()
45+
versionName = libs.versions.appVersion.get()
4446
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4547
}
4648

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/screens/AppInfoDialog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import androidx.compose.ui.res.stringResource
3030
import androidx.compose.ui.tooling.preview.Preview
3131
import androidx.compose.ui.unit.dp
3232
import androidx.compose.ui.window.Dialog
33-
import com.inspiredandroid.linuxcommandbibliotheca.BuildConfig
3433
import com.inspiredandroid.linuxcommandbibliotheca.R
3534
import com.inspiredandroid.linuxcommandbibliotheca.ui.theme.LinuxTheme
35+
import com.linuxcommandlibrary.shared.*
3636

3737
/* Copyright 2022 Simon Schubert
3838
*
@@ -91,7 +91,7 @@ fun AppInfoDialog(
9191
}
9292
}
9393
Text(
94-
"Version: ${BuildConfig.VERSION_NAME}",
94+
"Version: ${Version.appVersion}",
9595
style = MaterialTheme.typography.caption,
9696
modifier = Modifier.padding(8.dp),
9797
)

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ buildscript {
2020
}
2121

2222
group = "com.inspiredandroid"
23-
version = "3.3.9"
2423

2524
allprojects {
2625
repositories {

cli/src/main/kotlin/com/linuxcommandlibrary/cli/ConsoleApplication.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.linuxcommandlibrary.cli
22

3+
import com.linuxcommandlibrary.shared.Version
34
import com.linuxcommandlibrary.shared.databaseHelper
4-
import com.linuxcommandlibrary.shared.getCurrentVersion
55
import com.linuxcommandlibrary.shared.initDatabase
66
import com.linuxcommandlibrary.shared.sortedSearch
77
import kotlin.system.exitProcess
@@ -27,7 +27,7 @@ fun showIntro() {
2727
println(" _ _ _____ _____ ____ _____ __ __")
2828
println("| |__ | || () )| () ) / () \\ | () )\\ \\/ /")
2929
println("|____||_||_()_)|_|\\_\\/__/\\__\\|_|\\_\\ |__|")
30-
println("Version: ${getCurrentVersion()}")
30+
println("Version: ${Version.appVersion}")
3131
}
3232

3333
fun showStartMenu() {

cli/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

common/build.gradle.kts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ plugins {
1111
}
1212

1313
group = "com.linuxcommandlibrary"
14-
version = "1.0"
1514

1615
kotlin {
1716
androidTarget()
@@ -28,6 +27,7 @@ kotlin {
2827
dependencies {
2928
implementation(libs.runtime)
3029
}
30+
kotlin.srcDir(layout.buildDirectory.dir("generated/src/commonMain/kotlin"))
3131
}
3232
commonTest {
3333
dependencies {
@@ -72,3 +72,27 @@ sqldelight {
7272
}
7373
}
7474
}
75+
76+
class VersionGeneratorPlugin : Plugin<Project> {
77+
override fun apply(project: Project) {
78+
project.afterEvaluate {
79+
val versionFile =
80+
layout.buildDirectory
81+
.file("generated/src/commonMain/kotlin/com/linuxcommandlibrary/shared/Version.kt")
82+
.get()
83+
.asFile
84+
versionFile.parentFile?.mkdirs()
85+
versionFile.writeText(
86+
"""
87+
package com.linuxcommandlibrary.shared
88+
89+
object Version {
90+
const val appVersion = "${libs.versions.appVersion.get()}"
91+
}
92+
""".trimIndent(),
93+
)
94+
}
95+
}
96+
}
97+
98+
apply<VersionGeneratorPlugin>()

common/src/jvmMain/kotlin/com/linuxcommandlibrary/shared/Platform.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import app.cash.sqldelight.db.SqlDriver
44
import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver
55
import com.linuxcommandlibrary.CommandDatabase
66
import java.io.File
7-
import java.io.IOException
8-
import java.util.Properties
97

108
/* Copyright 2022 Simon Schubert
119
*
@@ -32,14 +30,3 @@ fun initDatabase() {
3230
}
3331
databaseHelper.setupDriver(driver)
3432
}
35-
36-
fun getCurrentVersion(): String {
37-
val prop = Properties()
38-
try {
39-
val input = EmptyClass::class.java.classLoader?.getResource("application.properties")
40-
prop.load(input?.openStream())
41-
} catch (io: IOException) {
42-
io.printStackTrace()
43-
}
44-
return prop["version"].toString()
45-
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add commands
2+
Upgrade sdks

fastlane/metadata/android/en-US/full_description.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The app currently has <b>6724</b> manual pages, <b>22</b> basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
1+
The app currently has <b>6766</b> manual pages, <b>22</b> basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
22

33
<b>Categories</b>
44

0 commit comments

Comments
 (0)