add current commit of build to about

This commit is contained in:
julian 2024-05-24 13:56:14 -06:00
parent f1b0e4e119
commit fc631bf866
6 changed files with 71 additions and 2 deletions

View file

@ -10,6 +10,7 @@ abstract class AppConfig {
static const suffix = _suffix;
static String get appDefaultDataDirName => _appDataDirName;
static String get commitHash => _commitHash;
static ({String light, String dark})? get appIconAsset => _appIconAsset;

View file

@ -134,6 +134,29 @@ class AboutView extends ConsumerWidget {
const SizedBox(
height: 12,
),
RoundedWhiteContainer(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
Text(
"Build commit",
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
),
SelectableText(
GitStatus.appCommitHash,
style:
STextStyles.itemSubtitle(context),
),
],
),
),
const SizedBox(
height: 12,
),
RoundedWhiteContainer(
child: Column(
crossAxisAlignment:

View file

@ -207,7 +207,7 @@ class DesktopAboutView extends ConsumerWidget {
],
),
const SizedBox(
width: 64,
width: 16,
),
Column(
mainAxisSize: MainAxisSize.min,
@ -240,6 +240,40 @@ class DesktopAboutView extends ConsumerWidget {
),
],
),
const SizedBox(
width: 16,
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Build commit",
style: STextStyles
.desktopTextExtraExtraSmall(
context,
).copyWith(
color: Theme.of(
context,
)
.extension<
StackColors>()!
.textDark,
),
),
const SizedBox(
height: 2,
),
SelectableText(
GitStatus.appCommitHash,
style:
STextStyles.itemSubtitle(
context,
),
),
],
),
],
),
const SizedBox(height: 32),

View file

@ -9,6 +9,7 @@ import 'package:lelantus/git_versions.dart' as firo_versions;
import '../../../themes/stack_colors.dart';
import '../../../utilities/logger.dart';
import '../../../utilities/text_styles.dart';
import '../app_config.dart';
const kGithubAPI = "https://api.github.com";
const kGithubSearch = "/search/commits";
@ -21,6 +22,8 @@ abstract class GitStatus {
static String get epicCashCommit => epic_versions.getPluginVersion();
static String get moneroCommit => monero_versions.getPluginVersion();
static String get appCommitHash => AppConfig.commitHash;
static CommitStatus? _cachedFiroStatus;
static Future<CommitStatus> getFiroCommitStatus() async {
if (_cachedFiroStatus != null) {

View file

@ -23,6 +23,10 @@ else
sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}"
fi
pushd "${APP_PROJECT_ROOT_DIR}"
BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H")
popd
APP_CONFIG_DART_FILE="${APP_PROJECT_ROOT_DIR}/lib/app_config.g.dart"
rm -f "$APP_CONFIG_DART_FILE"
cat << EOF > "$APP_CONFIG_DART_FILE"
@ -34,6 +38,7 @@ const _prefix = "Stack";
const _separator = " ";
const _suffix = "Duo";
const _appDataDirName = "stackduo";
const _commitHash = "$BUILT_COMMIT_HASH";
const ({String light, String dark})? _appIconAsset = (
light: "assets/in_app_logo_icons/stack-duo-icon_light.svg",

View file

@ -23,7 +23,9 @@ else
sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}"
fi
pushd "${APP_PROJECT_ROOT_DIR}"
BUILT_COMMIT_HASH=$(git log -1 --pretty=format:"%H")
popd
APP_CONFIG_DART_FILE="${APP_PROJECT_ROOT_DIR}/lib/app_config.g.dart"
rm -f "$APP_CONFIG_DART_FILE"
@ -36,6 +38,7 @@ const _prefix = "Stack";
const _separator = " ";
const _suffix = "Wallet";
const _appDataDirName = "stackwallet";
const _commitHash = "$BUILT_COMMIT_HASH";
const ({String light, String dark})? _appIconAsset = null;