Skip to content

Commit f1252d4

Browse files
committed
chore: buildconfig changes
1 parent 1e98470 commit f1252d4

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

backend/jvm/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ jib {
5555
add("@/app/jib-classpath-file")
5656
add("@/app/jib-main-class-file")
5757
}
58+
args = listOf(project.name, project.version.toString())
59+
expandClasspathDependencies = true
60+
labels =
61+
mapOf(
62+
"maintainer" to project.githubUser,
63+
"org.opencontainers.image.authors" to project.githubUser,
64+
"org.opencontainers.image.title" to project.name,
65+
"org.opencontainers.image.description" to "🐳 ${project.description}",
66+
"org.opencontainers.image.version" to project.version.toString(),
67+
"org.opencontainers.image.vendor" to project.githubUser,
68+
"org.opencontainers.image.url" to project.githubRepo,
69+
"org.opencontainers.image.source" to project.githubRepo,
70+
"org.opencontainers.image.licenses" to "Apache-2.0")
5871
mainClass = application.mainClass.get()
5972
}
6073

gradle/build-logic/src/main/kotlin/common/MultiPlatformExtns.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,16 @@ fun KotlinMultiplatformExtension.wasmJsTarget() {
193193
// sourceMaps = true
194194
devServer =
195195
(devServer ?: KotlinWebpackConfig.DevServer()).apply {
196-
// open = mapOf("app" to mapOf("name" to "google chrome")),
197196
static =
198197
(static ?: mutableListOf()).apply {
199198
// Serve sources to debug inside browser
200199
add(project.rootDir.path)
201200
}
202201
}
203202
}
204-
205203
applyBinaryen()
206204

207205
runTask { sourceMaps = false }
208-
209206
testTask {
210207
enabled = true
211208
testLogging { configureLogEvents() }

gradle/build-logic/src/main/resources/BuildConfig.kte

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
@import gg.jte.support.ForSupport
44
@import kotlinx.datetime.*
55
@import java.net.InetAddress
6+
@import com.sun.management.OperatingSystemMXBean
7+
@import java.lang.management.ManagementFactory
68

79
@param className: String
810
@param pkg: String
@@ -26,15 +28,21 @@ data object ${className} {
2628

2729
val buildTimeLocal = Instant.fromEpochMilliseconds(buildTimeEpochMillis).toLocalDateTime(TimeZone.currentSystemDefault())
2830

29-
const val buildUser = "${sysProp("user.name")}"
31+
object Host {
32+
const val user = "${sysProp("user.name")}"
3033

31-
const val buildOS = "${sysProp("os.name")} ${sysProp("os.version")}-${sysProp("os.arch")}"
34+
const val os = "${sysProp("os.name")} ${sysProp("os.version")}-${sysProp("os.arch")}"
3235

33-
const val buildHost = "${InetAddress.getLocalHost().hostName}"
36+
const val name = "${InetAddress.getLocalHost().hostName}"
3437

35-
const val buildJdkVersion = "${sysProp("java.runtime.version")}"
38+
const val cpuCores = ${Runtime.getRuntime().availableProcessors()}
3639

37-
const val buildJdkVendor = "${sysProp("java.vendor")}"
40+
const val memory = ${ManagementFactory.getPlatformMXBean(OperatingSystemMXBean::class.java).totalMemorySize}
41+
42+
const val jdkVersion = "${sysProp("java.runtime.version")}"
43+
44+
const val jdkVendor = "${sysProp("java.vendor")}"
45+
}
3846

3947
@for((k,v) in projectProps)
4048
const val ${k.camelCase} = "${v}"

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ gradle-kotlin-dsl = "4.3.0"
4343
zip-prefixer = "0.3.1"
4444
ajalt-mordant = "2.2.0"
4545
ajalt-clikt = "4.1.0"
46-
ajalt-colormath = "3.3.3"
46+
ajalt-colormath = "3.4.0"
4747
compose-routing = "0.2.12"
4848
classgraph = "4.8.161"
4949
cache4k = "0.11.0"
5050
dokka = "1.9.10"
5151
intellij-coverage = "1.0.733"
5252
intellij-markdown = "0.6.1"
5353
jgit = "6.5.0.202303070854-r"
54-
jte = "3.1.6"
54+
jte = "3.1.7"
5555
jimfs = "1.3.0"
5656
junit = "5.10.1"
5757
koin = "3.4.1"
@@ -101,7 +101,7 @@ shedlock = "5.7.0"
101101
sherlock = "0.4.19"
102102
expiringmap = "0.5.10"
103103
apache-commons-imaging = "1.0-alpha3"
104-
testcontainers = "1.19.3"
104+
testcontainers = "1.19.4"
105105
sourceBuddy = "2.4.5"
106106
tcp-javanioproxy = "1.6"
107107
konsist = "0.13.0"

shared/src/commonMain/kotlin/dev/suresh/Platform.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package dev.suresh
44

55
import BuildConfig
6+
import BuildConfig.Host
67
import io.github.oshai.kotlinlogging.KotlinLogging
78
import kotlin.jvm.JvmName
89
import kotlinx.coroutines.CoroutineScope
@@ -49,12 +50,14 @@ interface Platform {
4950
mapOf(
5051
"time" to "$buildTimeLocal $tzShortId",
5152
"version" to version,
52-
"os" to buildOS,
53-
"user" to buildUser,
54-
"host" to buildHost,
55-
"jdk" to buildJdkVersion,
53+
"os" to Host.os,
54+
"user" to Host.user,
55+
"host" to Host.name,
56+
"cpu-cores" to Host.cpuCores.toString(),
57+
"memory" to "${Host.memory/(1_000 * 1_000L)} MB",
58+
"jdk" to Host.jdkVersion,
5659
"gradle" to gradle,
57-
"jdk-vendor" to buildJdkVendor,
60+
"jdk-vendor" to Host.jdkVendor,
5861
"java-release-version" to java,
5962
"kotlin-jvm-target" to kotlinJvmtarget),
6063
"runtime" to

shared/src/jvmMain/kotlin/dev/suresh/Platform.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ fun jvmRuntimeInfo(debug: Boolean = false) = buildString {
9999

100100
appendLine("✧✧✧ JVM Input Arguments ✧✧✧")
101101
appendLine(rtMxBean.inputArguments)
102+
appendLine("✧✧✧ JVM Main class & Args ✧✧✧")
103+
appendLine(System.getProperty("sun.java.command"))
102104

103105
appendLine("✧✧✧ Processes ✧✧✧")
104106
val ps = ProcessHandle.allProcesses().sorted(ProcessHandle::compareTo).toList()

0 commit comments

Comments
 (0)