Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
92fb560
Update README.md
ihuoxin Jul 12, 2026
db77132
Update build.gradle
ihuoxin Jul 12, 2026
20348a6
Update actions.yml
ihuoxin Jul 12, 2026
73346cc
Update actions.yml
ihuoxin Jul 12, 2026
6c66506
Update actions.yml
ihuoxin Jul 12, 2026
62c7e9c
Update actions.yml
ihuoxin Jul 12, 2026
93216e5
Update actions.yml
ihuoxin Jul 13, 2026
8fadb85
Update actions.yml
ihuoxin Jul 13, 2026
981c25b
Update actions.yml
ihuoxin Jul 13, 2026
ef23161
Update actions.yml
ihuoxin Jul 13, 2026
49f89cf
Update actions.yml
ihuoxin Jul 13, 2026
06e25cb
Update actions.yml
ihuoxin Jul 13, 2026
935e792
Update actions.yml
ihuoxin Jul 13, 2026
9698266
Update build.gradle
ihuoxin Jul 13, 2026
2f149ac
Update build.gradle
ihuoxin Jul 13, 2026
8cc19b5
Create ComposeMainActivity.kt
ihuoxin Jul 14, 2026
4ed8c52
Update AndroidManifest.xml
ihuoxin Jul 14, 2026
00589bc
Update actions.yml
ihuoxin Jul 14, 2026
f7f65c1
Update build.gradle
ihuoxin Jul 14, 2026
b27b4f2
Update build.gradle
ihuoxin Jul 14, 2026
14417fe
Update build.gradle
ihuoxin Jul 14, 2026
ee80b35
Update build.gradle
ihuoxin Jul 14, 2026
9996070
Update actions.yml
ihuoxin Jul 14, 2026
274a1ef
Update build.gradle
ihuoxin Jul 14, 2026
afbd1a1
Update build.gradle
ihuoxin Jul 14, 2026
e91888b
Update build.gradle
ihuoxin Jul 14, 2026
6faed5c
Update build.gradle
ihuoxin Jul 15, 2026
c2649e7
Update build.gradle
ihuoxin Jul 15, 2026
6775ac6
Update build.gradle
ihuoxin Jul 15, 2026
77ea033
Update build.gradle
ihuoxin Jul 15, 2026
3c34e4d
Update build.gradle
ihuoxin Jul 15, 2026
03a93c8
Update build.gradle
ihuoxin Jul 15, 2026
48d284a
Update build.gradle
ihuoxin Jul 15, 2026
7de0c89
Update build.gradle
ihuoxin Jul 15, 2026
c7050d1
Update build.gradle
ihuoxin Jul 15, 2026
024ac86
Update build.gradle
ihuoxin Jul 15, 2026
ae1c1ae
Update build.gradle
ihuoxin Jul 15, 2026
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
31 changes: 27 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- feature/compose-ui
- test/**
pull_request:
types: [opened, synchronize, reopened]
Expand Down Expand Up @@ -48,6 +49,8 @@ jobs:

- name: Setup Android SDK
uses: android-actions/setup-android@v4
with:
cmdline-tools-version: '9477386'

- name: Install Android SDK components
run: |
Expand All @@ -66,21 +69,29 @@ jobs:
echo "${{ secrets.RUNALYZE }}" > $GITHUB_WORKSPACE/runalyze.properties
chmod +x gradlew

- name: Build bundle
run: ./gradlew :app:bundleLatestRelease :wear:bundleRelease
- name: Build AAB and APK
run: ./gradlew :app:bundleLatestRelease :app:assembleLatestRelease :wear:bundleRelease --stacktrace --info

- name: Find APK files
run: |
echo "Searching for all APK files..."
find app/build -name "*.apk" -type f
echo "Listing apk directory structure..."
ls -la app/build/outputs/apk/ || echo "APK directory not found"

- name: Upload build logs
if: always()
uses: actions/upload-artifact@v7
with:
name: build-bundle
# possibly include: app/build/outputs/bundle/latestRelease/ wear/build/outputs/bundle/release/
path: |
**/build/outputs/logs/
app/build/outputs/bundle/latestRelease/*.aab
app/build/outputs/apk/latest/release/*.apk
wear/build/outputs/bundle/release/*.aab

- name: Test
run: ./gradlew test

- name: Upload test logs
if: always()
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -128,3 +139,15 @@ jobs:
name: fdroid-logs
path: |
build/reports/problems/

- name: List F-Droid APK (for debug)
run: ls -la app/build/outputs/apk/latestRelease/ || echo "Directory not found"
Comment on lines +143 to +144

- name: Upload F-Droid APK
if: always()
uses: actions/upload-artifact@v7
with:
name: fdroid-apk
path: |
app/build/outputs/apk/latest/release/*.apk

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
20260712
RunnerUp
========
Comment on lines +1 to 3

Expand Down
13 changes: 11 additions & 2 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,23 @@
tools:ignore="UnusedAttribute"
android:dataExtractionRules="@xml/data_extraction_rules">
<meta-data android:name="android.webkit.WebView.MetricsOptOut" android:value="true" />
<activity
android:name=".compose.ComposeMainActivity"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:exported="true"
android:name=".view.MainLayout"
android:theme="@style/MainLayoutTheme">
<intent-filter>
<!-- <intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</intent-filter> -->

<intent-filter android:autoVerify="false">
<action android:name="android.intent.action.VIEW"/>
Expand Down
44 changes: 24 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
apply plugin: 'com.android.application'
// 已移除 'kotlin-kapt' 插件

def getGitHash = providers.exec {
commandLine('git', 'rev-parse', '--short', 'HEAD')
}.standardOutput.asText.get().strip()

android {
compileSdk 34
buildToolsVersion = rootProject.ext.buildToolsVersion
namespace = 'org.runnerup'

Expand Down Expand Up @@ -34,7 +36,6 @@ android {
} else {
java.srcDirs += ['src/osmdroid']
}
// renderscript.srcDirs = java.srcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
Expand All @@ -45,7 +46,6 @@ android {
productFlavors {
latest {
dimension = "all"
// multidexing support, min play support
minSdk = rootProject.ext.minSdk
compileSdk = rootProject.ext.compileSdk
targetSdk = rootProject.ext.targetSdk
Expand All @@ -55,10 +55,6 @@ android {
}

defaultConfig {
// Set a separate applicationId to allow variant installations
// The applicationId is also used in some xml files (android:targetPackage)
// The packageId (in the manifest) is never changed
// See also applicationIdFull in common/build.gradle, must be in sync
applicationId = rootProject.ext.applicationId
vectorDrawables.useSupportLibrary = true
}
Expand All @@ -70,20 +66,19 @@ android {

buildTypes {
debug {
// Separate the debug build, sync with common/build.gradle
applicationIdSuffix ".debug"
versionNameSuffix = "-${getGitHash}"
}
release {
debuggable = false
applicationIdSuffix = ""

minifyEnabled = rootProject.ext.allowNonFree
shrinkResources = rootProject.ext.allowNonFree
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.txt'
signingConfig = signingConfigs.release
}
}

buildTypes.configureEach {
buildConfigField 'boolean', 'MAPBOX_ENABLED', "${rootProject.ext.mapboxEnabled}"
buildConfigField 'String', 'MAPBOX_ACCESS_TOKEN', "\"${rootProject.ext.mapboxAccessToken}\""
Expand All @@ -97,6 +92,7 @@ android {
buildConfigField 'String', 'DROPBOX_ID', "\"${rootProject.ext.dropboxId}\""
buildConfigField 'String', 'DROPBOX_SECRET', "\"${rootProject.ext.dropboxSecret}\""
}

lint {
baseline = file('lint-baseline.xml')
checkReleaseBuilds = true
Expand All @@ -106,43 +102,44 @@ android {
lintConfig = file('lint-osmdroid.xml')
}
showAll = true
//textOutput = 'stdout'
textReport = true
// Treat all warnings as errors
warningsAsErrors = true
// Halt the build if any errors are found
abortOnError = true
}

bundle {
language {
// Language can be set for audio cues, include all locales
enableSplit = false
}
}

buildFeatures {
aidl = true
buildConfig = true
resValues = true
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.4"
}
Comment on lines +156 to +158

androidResources {
generateLocaleConfig = true
}
}

repositories {
google()
mavenCentral() //MapBox GraphView
mavenCentral()
if (rootProject.ext.mapboxEnabled) {
maven {
url = 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
def props = new Properties()
props.load(new FileInputStream(rootProject.file("mapbox.properties")))
password = props.mapboxDownloadToken
Expand All @@ -169,7 +166,6 @@ dependencies {

implementation "com.squareup.okhttp3:okhttp:5.4.0"
if (rootProject.ext.allowNonFree) {
// MapBox uses telemetry, without Play there may be exceptions from mapbox (OK to ignore)
latestImplementation "com.google.android.gms:play-services-location:${rootProject.ext.googlePlayServicesVersion}"
}
if (rootProject.ext.mapboxEnabled) {
Expand All @@ -181,22 +177,30 @@ dependencies {

testImplementation "junit:junit:${rootProject.ext.junitVersion}"
testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoVersion}"

// Jetpack Compose 依赖
implementation platform('androidx.compose:compose-bom:2024.04.01')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.runtime:runtime-livedata'

debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
}

allprojects {
tasks.withType(JavaCompile).tap {
configureEach {
// options.compilerArgs << "-Xlint:deprecation";
options.compilerArgs << "-Xlint:unchecked"
}
}
}

def props = new Properties()
// For locally signed builds only, Google Play signs the bundle
if (rootProject.file("release.properties").exists()) {
props.load(new FileInputStream(rootProject.file("release.properties")))

android.signingConfigs.release.storeFile rootProject.file(props.keyStore)
android.signingConfigs.release.storePassword props.keyStorePassword
android.signingConfigs.release.keyAlias props.keyAlias
Expand Down
28 changes: 28 additions & 0 deletions app/src/main/org/runnerup/compose/ComposeMainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.runnerup.compose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview

class ComposeMainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting("RunnerUp")
}
}
}

@Composable
fun Greeting(name: String) {
Text(text = "Hello, $name!")
}

@Preview
@Composable
fun PreviewGreeting() {
Greeting("RunnerUp")
}
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:9.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0"
}
}

plugins {
id "com.diffplug.spotless" version "8.6.0"
// 移除了错误的 'org.jetbrains.kotlin.kapt' 插件声明
}

repositories {
Expand All @@ -27,7 +29,7 @@ project.ext {
appcompat_version = "1.7.1"
annotation_version = "1.9.1"
preference_version = "1.2.1"
googlePlayServicesVersion = '21.3.0'
googlePlayServicesVersion = '21.4.0'
googlePlayServicesWearableVersion = '20.0.1'
googleWearVersion = '2.9.0'

Expand Down Expand Up @@ -105,6 +107,10 @@ project.ext {
} else {
applicationId = "org.runnerup"
}

// 保留了 Compose 版本变量,供 app/build.gradle 引用
composeBomVersion = '2024.04.01'
kotlinCompilerExtensionVersion = '1.5.4'
}

// Special setup for antPlusLib, not allowed to copy the .aar and create mavenLocal
Expand Down Expand Up @@ -132,4 +138,4 @@ allprojects {
google()
mavenCentral()
}
}
}