Skip to content
Merged
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
21 changes: 20 additions & 1 deletion apps/mobile/android/wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ if (major > 99 || minor > 99 || patch > 99) {
throw new GradleException("Wear versionCode mapping requires major/minor/patch <= 99. Found: $mobileVersionName")
}
def wearVersionCode = (rootProject.ext.targetSdkVersion as int) * 1_000_000 + major * 10_000 + minor * 100 + patch
def isReleaseBuildRequested = gradle.startParameter.taskNames.any { taskName ->
taskName.toLowerCase().contains("release")
Comment on lines +27 to +28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Limit release-signing guard to :wear release tasks

This check treats any Gradle task name containing release as a wear release build, so running unrelated commands like :app:assembleRelease will still throw [wear] Missing release signing config if wear signing props are absent. Because wear/build.gradle is evaluated during configuration, this can block non-wear release workflows that previously did not require wear credentials; the guard should be scoped to :wear release tasks (or task graph entries for the wear module) rather than global task names.

Useful? React with 👍 / 👎.

}
def hasInjectedReleaseSigning = project.hasProperty("android.injected.signing.store.file") &&
project.hasProperty("android.injected.signing.store.password") &&
project.hasProperty("android.injected.signing.key.alias") &&
project.hasProperty("android.injected.signing.key.password")

if (isReleaseBuildRequested && !hasInjectedReleaseSigning) {
throw new GradleException("[wear] Missing release signing config. Provide Android signing credentials (for EAS, configure Android credentials for this project) before building :wear release artifacts.")
}

android {
namespace "com.lallimaven.eclipsetimer.wear"
Expand All @@ -44,14 +55,22 @@ android {
keyAlias "androiddebugkey"
keyPassword "android"
}
release {
if (hasInjectedReleaseSigning) {
storeFile file(project.property("android.injected.signing.store.file"))
storePassword project.property("android.injected.signing.store.password")
keyAlias project.property("android.injected.signing.key.alias")
keyPassword project.property("android.injected.signing.key.password")
}
}
}

buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled false
}
}
Expand Down