Skip to content

Commit 0a82dee

Browse files
committed
refactor: 移除构建时间展示
- 从 Android MainActivity 移除构建时间显示 - 从 Mac ContentView 移除构建时间显示 - 从 build.gradle.kts 移除 BUILD_TIME buildConfigField - 从 GitHub Actions workflow 移除生成构建时间的步骤 - 删除 BuildTime.swift 文件 - 简化版本信息展示
1 parent f1f8c86 commit 0a82dee

5 files changed

Lines changed: 6 additions & 40 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ jobs:
4646

4747
- name: Build Android APK
4848
working-directory: VoiceSyncAndroid
49-
run: |
50-
BUILD_TIME=$(date '+%Y-%m-%d %H:%M:%S')
51-
./gradlew assembleRelease -PBUILD_TIME="$BUILD_TIME"
49+
run: ./gradlew assembleRelease
5250

5351
- name: Rename Android APK
5452
run: |
@@ -60,12 +58,6 @@ jobs:
6058
- name: Select Xcode version
6159
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
6260

63-
- name: Update Mac build time
64-
working-directory: VoiceSyncMac/VoiceSyncMac
65-
run: |
66-
BUILD_TIME=$(date '+%Y-%m-%d %H:%M:%S')
67-
echo "let buildTime = \"$BUILD_TIME\"" > BuildTime.swift
68-
6961
- name: Build Mac app (Archive)
7062
working-directory: VoiceSyncMac
7163
run: |

VoiceSyncAndroid/app/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ android {
6969
applicationIdSuffix = ".dev"
7070
resValue("string", "app_name", "VoiceSync (Dev)")
7171
buildConfigField("int", "SYNC_PORT", "4501")
72-
buildConfigField("String", "BUILD_TIME", "\"${project.findProperty("BUILD_TIME") ?: "Unknown"}\"")
7372
}
7473
release {
7574
isMinifyEnabled = false
@@ -80,7 +79,6 @@ android {
8079
signingConfig = signingConfigs.getByName("release")
8180
resValue("string", "app_name", "VoiceSync")
8281
buildConfigField("int", "SYNC_PORT", "4500")
83-
buildConfigField("String", "BUILD_TIME", "\"${project.findProperty("BUILD_TIME") ?: "Unknown"}\"")
8482
}
8583
}
8684
compileOptions {

VoiceSyncAndroid/app/src/main/java/com/sedationh/voicesync/MainActivity.kt

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,11 @@ class MainActivity : ComponentActivity() {
119119
style = MaterialTheme.typography.titleLarge,
120120
color = MaterialTheme.colorScheme.primary
121121
)
122-
Row(
123-
horizontalArrangement = Arrangement.spacedBy(8.dp),
124-
verticalAlignment = Alignment.CenterVertically
125-
) {
126-
Text(
127-
text = "v${BuildConfig.VERSION_NAME}",
128-
style = MaterialTheme.typography.labelSmall,
129-
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f)
130-
)
131-
Text(
132-
text = "",
133-
style = MaterialTheme.typography.labelSmall,
134-
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f)
135-
)
136-
Text(
137-
text = BuildConfig.BUILD_TIME,
138-
style = MaterialTheme.typography.labelSmall,
139-
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f)
140-
)
141-
}
122+
Text(
123+
text = "v${BuildConfig.VERSION_NAME}",
124+
style = MaterialTheme.typography.labelSmall,
125+
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f)
126+
)
142127
}
143128
// 检查更新按钮
144129
OutlinedButton(

VoiceSyncMac/VoiceSyncMac/BuildTime.swift

Lines changed: 0 additions & 4 deletions
This file was deleted.

VoiceSyncMac/VoiceSyncMac/ContentView.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ struct ContentView: View {
189189

190190
Spacer()
191191

192-
// 构建时间
193-
Text("构建: \(BUILD_TIME)")
194-
.font(.system(size: 9))
195-
.foregroundColor(.secondary.opacity(0.6))
196-
197192
if !appState.syncManager.history.isEmpty {
198193
Text("\(appState.syncManager.history.count)")
199194
.font(.system(size: 11, weight: .semibold))

0 commit comments

Comments
 (0)