ThreadCount Community edition
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from e2d6d42 on 2026-09-13. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
// Release signing. The keystore and its password live in ~/threadcount-keys, outside the repo —
|
||||
// nothing secret is ever committed. Without either file the release build is simply unsigned, so a
|
||||
// fresh clone still builds.
|
||||
//
|
||||
// staff-keystore.properties wins if it exists, so this app can be given its own upload key later
|
||||
// without touching the build; until then it shares the counter app's, which is what Play expects
|
||||
// anyway — with Play App Signing the upload key only authenticates the upload, and two listings
|
||||
// from one publisher sharing one is ordinary. Splitting them is a decision worth making
|
||||
// deliberately, not by default.
|
||||
def keystoreProps = new Properties()
|
||||
def staffKeys = file("${System.getProperty('user.home')}/threadcount-keys/staff-keystore.properties")
|
||||
def sharedKeys = file("${System.getProperty('user.home')}/threadcount-keys/keystore.properties")
|
||||
def keystorePropsFile = staffKeys.exists() ? staffKeys : sharedKeys
|
||||
if (keystorePropsFile.exists()) {
|
||||
keystorePropsFile.withInputStream { keystoreProps.load(it) }
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "tech.threadcount.staff"
|
||||
compileSdk rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "tech.threadcount.staff"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
// Play permanently reserves a version code the moment a bundle is ingested, even into a
|
||||
// discarded draft — it can never be reused. Bump this for EVERY upload, not every release.
|
||||
// 1 was spent on the first bundle, before the sign-in rework, app links and the video.
|
||||
// 2 was uploaded before the sign-out fixes. Play keeps a code the moment it ingests a
|
||||
// bundle, so neither can ever be reused.
|
||||
versionCode 8
|
||||
versionName "1.3"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
if (keystoreProps['storeFile']) {
|
||||
storeFile file(keystoreProps['storeFile'])
|
||||
storePassword keystoreProps['storePassword']
|
||||
keyAlias keystoreProps['keyAlias']
|
||||
keyPassword keystoreProps['keyPassword']
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
if (keystoreProps['storeFile']) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
// R8 shrinks and obfuscates, and Gradle folds the resulting mapping.txt into the
|
||||
// bundle, which is what lets Play symbolicate a stack trace instead of showing
|
||||
// a.b.c(). Capacitor ships its plugin keep-rules as consumerProguardFiles, so the
|
||||
// classes the bridge loads reflectively survive; proguard-rules.pro pins the rest.
|
||||
//
|
||||
// Resource shrinking is deliberately left off, as in the counter app: the bundled
|
||||
// splash and welcome are plain files under assets/, which resource shrinking never
|
||||
// inspects, so it would trade a real risk for almost no bytes.
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
|
||||
// This app ships no native code at all — the barcode scanner and its MLKit/CameraX
|
||||
// .so files are stripped out by scripts/build-staff-aab.sh before the build. The
|
||||
// block stays so that the day it does, the symbols go with it without anyone having
|
||||
// to remember.
|
||||
ndk {
|
||||
debugSymbolLevel 'FULL'
|
||||
}
|
||||
}
|
||||
}
|
||||
// Devices from Android 15 can run 16 KB memory pages, and Play refuses uploads whose native
|
||||
// libraries are only 4 KB-aligned. Uncompressed + page-aligned .so files satisfy both.
|
||||
packaging {
|
||||
jniLibs {
|
||||
useLegacyPackaging false
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
// WebViewCompat / WebViewFeature, for MainActivity.giveTheSiteTheBridge(). The Capacitor
|
||||
// module has this as an implementation dependency, which does not reach this module.
|
||||
implementation "androidx.webkit:webkit:$androidxWebkitVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
Reference in New Issue
Block a user