Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
./gradlew spotlessCheck \
bundleRelease \
-Pheron.versionCode=${{ github.run_number }} \
-Pheron.isPlayStore=true \
-Pheron.isRelease=true \
-Pheron.endpoint="$HERON_ENDPOINT"

- name: Sign AAB
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ persisted across app restarts.
The following properties can be set in `~/.gradle/gradle.properties` or passed via `-P` flags.
None are required for basic development builds.

| Property | Description |
|---|---|
| `heron.versionCode` | Integer version code. Managed by CI via `github.run_number`. |
| `heron.endpoint` | Backend endpoint URL for the app. |
| `heron.isPlayStore` | Set to `true` when building for Play Store distribution. |
| `heron.releaseBranch` | Branch prefix (`bugfix/`, `feature/`, `release/`) controlling version increments. |
| Property | Description |
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `heron.versionCode` | Integer version code. Managed by CI via `github.run_number`. |
| `heron.endpoint` | Backend endpoint URL for the app. |
| `heron.isRelease` | Set to `true` when building release artifacts. |
| `heron.releaseBranch` | Branch prefix (`bugfix/`, `feature/`, `release/`) controlling version increments. |
| `heron.macOS.signing.identity` | Name of the Developer ID Application certificate in your Keychain (e.g. `Developer ID Application: Name (TEAM_ID)`). When present, the macOS DMG will be code signed. |
macOS signing is only configured when `heron.macOS.signing.identity` is present,
so contributors without an Apple Developer account can still build unsigned DMGs with
Expand Down
2 changes: 1 addition & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ android {
}
val releaseSigning = when {
// Do not sign the build output, it will be signed on CI
providers.gradleProperty("heron.isPlayStore").orNull.toBoolean() -> null
providers.gradleProperty("heron.isRelease").orNull.toBoolean() -> null
file("debugKeystore.properties").exists() -> signingConfigs.create("release") {
val props = Properties()
file("debugKeystore.properties")
Expand Down
1 change: 1 addition & 0 deletions data/logging/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation(project(":data:platform"))
}
}
androidMain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.tunjid.heron.data.logging

import android.content.Context
import com.tunjid.heron.data.platform.Platform
import com.tunjid.heron.data.platform.current
import logcat.AndroidLogcatLogger
import logcat.LogPriority as SquareLogPriority
import logcat.LogcatLogger
Expand All @@ -28,12 +30,7 @@ class AndroidLogger(
) : Logger {

override fun install() {
val shouldLog = when (context.packageName.split(".").lastOrNull()?.lowercase()) {
DEBUG,
STAGING,
-> true
else -> false
}
val shouldLog = !Platform.current.isRelease
if (!LogcatLogger.isInstalled && shouldLog) {
LogcatLogger.install()
LogcatLogger.loggers += AndroidLogcatLogger(SquareLogPriority.VERBOSE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@

package com.tunjid.heron.data.logging

import com.tunjid.heron.data.platform.Platform
import com.tunjid.heron.data.platform.current
import logcat.LogPriority as SquareLogPriority
import logcat.LogcatLogger
import logcat.PrintLogger
import logcat.asLog as squareAsLog
import logcat.logcat as squareLogcat

class JvmLogger : Logger {
override fun install() {
// no-op on JVM
val shouldLog = !Platform.current.isRelease
if (!LogcatLogger.isInstalled && shouldLog) {
LogcatLogger.install()
LogcatLogger.loggers += PrintLogger
}
}
}

Expand Down
18 changes: 18 additions & 0 deletions data/platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,26 @@
plugins {
id("android-library-convention")
id("kotlin-library-convention")
alias(libs.plugins.buildConfig)
}

android {
namespace = "com.tunjid.heron.data.platform"
}

buildConfig {
packageName("com.tunjid.heron.data.platform")

useKotlinOutput {
internalVisibility = true
}

forClass("Build") {
buildConfigField(
name = "isRelease",
value = providers.gradleProperty("heron.isRelease")
.map(String::toBoolean)
.orElse(false),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package com.tunjid.heron.data.platform

interface Platform {
val name: String
val isRelease: Boolean
get() = Build.isRelease

companion object
}
Expand Down
Loading