Skip to content

Commit 17e90d0

Browse files
committed
fix: claude fixed the build
1 parent 935a422 commit 17e90d0

File tree

13 files changed

+303
-32
lines changed

13 files changed

+303
-32
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build APK
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build Debug APK
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
cache: 'gradle'
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.22'
30+
cache: true
31+
32+
- name: Install gomobile
33+
run: |
34+
go install golang.org/x/mobile/cmd/gomobile@latest
35+
gomobile init
36+
37+
- name: Make Go build script executable
38+
run: chmod +x app/src/main/go/build.sh
39+
40+
- name: Setup Android SDK
41+
uses: android-actions/setup-android@v3
42+
43+
- name: Install build dependencies
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y cmake ninja-build
47+
48+
- name: Install NDK
49+
id: setup-ndk
50+
uses: nttld/setup-ndk@v1
51+
with:
52+
ndk-version: r26c
53+
54+
- name: Create required directories
55+
run: |
56+
mkdir -p app/src/main/go/third_party
57+
mkdir -p app/src/main/libs
58+
59+
- name: Build with Gradle
60+
run: ./gradlew assembleDebug --info
61+
env:
62+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
63+
64+
- name: Upload APK
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: app-debug
68+
path: app/build/outputs/apk/debug/app-debug.apk
69+
retention-days: 14

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
17+
# Go library dependencies and third-party code
18+
**/third_party/
19+
app/src/main/libs/
20+
app/build/go-lib/

app/build.gradle.kts

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ android {
1919
vectorDrawables {
2020
useSupportLibrary = true
2121
}
22+
23+
// Configure native build ABIs
24+
ndk {
25+
abiFilters.add("armeabi-v7a")
26+
abiFilters.add("arm64-v8a")
27+
abiFilters.add("x86")
28+
abiFilters.add("x86_64")
29+
}
2230
}
2331

2432
buildTypes {
@@ -31,23 +39,27 @@ android {
3139
}
3240
}
3341
compileOptions {
34-
sourceCompatibility = JavaVersion.VERSION_1_8
35-
targetCompatibility = JavaVersion.VERSION_1_8
42+
sourceCompatibility = JavaVersion.VERSION_17
43+
targetCompatibility = JavaVersion.VERSION_17
3644
}
3745
kotlinOptions {
38-
jvmTarget = "1.8"
46+
jvmTarget = "17"
3947
}
4048
buildFeatures {
4149
compose = true
4250
aidl = true
4351
}
4452
composeOptions {
45-
kotlinCompilerExtensionVersion = "1.4.3"
53+
kotlinCompilerExtensionVersion = "1.5.11"
4654
}
4755
packaging {
4856
resources {
4957
excludes += "/META-INF/{AL2.0,LGPL2.1}"
5058
}
59+
// Don't strip native libraries during APK build
60+
jniLibs {
61+
keepDebugSymbols += "**/*.so"
62+
}
5163
}
5264
externalNativeBuild {
5365
cmake {
@@ -57,6 +69,42 @@ android {
5769
}
5870
}
5971

72+
// Create a custom task to build the Go library
73+
tasks.register<Exec>("buildGoLibrary") {
74+
// Use a task output directory for the Go AAR
75+
val libDir = layout.buildDirectory.dir("go-lib").get().asFile
76+
mkdir(libDir)
77+
78+
workingDir = file("src/main/go")
79+
commandLine("./build.sh", libDir.absolutePath)
80+
81+
doLast {
82+
// Create the libs directory if it doesn't exist
83+
mkdir("src/main/libs")
84+
85+
// Copy the AAR to the libs directory
86+
copy {
87+
from(libDir)
88+
include("*.aar")
89+
into("src/main/libs")
90+
}
91+
println("Built and copied Go AAR to src/main/libs")
92+
}
93+
}
94+
95+
// Run buildGoLibrary after the native libraries are built
96+
// Make the mergeDebugJniLibFolders task depend on buildGoLibrary
97+
afterEvaluate {
98+
tasks.named("mergeDebugJniLibFolders").configure {
99+
dependsOn("buildGoLibrary")
100+
}
101+
102+
// Make buildGoLibrary depend on the C++ build
103+
tasks.named("buildGoLibrary").configure {
104+
dependsOn("externalNativeBuildDebug")
105+
}
106+
}
107+
60108
dependencies {
61109
implementation("androidx.core:core-ktx:1.12.0")
62110
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
@@ -75,22 +123,25 @@ dependencies {
75123

76124
implementation("androidx.navigation:navigation-compose:2.7.7")
77125

78-
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
126+
implementation(platform("androidx.compose:compose-bom:2024.04.00"))
79127
implementation("androidx.compose.ui:ui")
80128
implementation("androidx.compose.ui:ui-graphics")
81129
implementation("androidx.compose.ui:ui-tooling-preview")
82130
implementation("androidx.compose.material3:material3")
83131
implementation("androidx.compose.material:material-icons-core")
84132
implementation("androidx.compose.material:material-icons-extended")
85133
implementation("com.google.accompanist:accompanist-permissions:0.32.0")
134+
135+
// Include AAR files from src/main/libs directory
86136
implementation(fileTree(mapOf(
87-
"dir" to "src/main/go",
137+
"dir" to "src/main/libs",
88138
"include" to listOf("*.aar", "*.jar"),
89139
)))
140+
90141
testImplementation("junit:junit:4.13.2")
91142
androidTestImplementation("androidx.test.ext:junit:1.1.5")
92143
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
93-
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
144+
androidTestImplementation(platform("androidx.compose:compose-bom:2024.04.00"))
94145
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
95146
debugImplementation("androidx.compose.ui:ui-tooling")
96147
debugImplementation("androidx.compose.ui:ui-test-manifest")

app/src/main/go/build.sh

100644100755
Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
#!/bin/bash
2+
set -e
23

3-
gomobile bind -androidapi 24 .
4+
# Default values
5+
ANDROID_API=24
6+
OUTPUT_DIR=$1
7+
8+
# Check if OUTPUT_DIR is set
9+
if [ -z "$OUTPUT_DIR" ]; then
10+
echo "Error: Output directory not specified."
11+
echo "Usage: $0 <output_directory>"
12+
exit 1
13+
fi
14+
15+
mkdir -p "$OUTPUT_DIR"
16+
17+
# Change to the Go package directory
18+
cd $(dirname "$0")
19+
20+
# Check if SRT libraries have been built for all the required architectures
21+
for ABI in arm64-v8a armeabi-v7a x86 x86_64; do
22+
if [ ! -f "third_party/srt/scripts/build-android/$ABI/lib/libsrt.so" ]; then
23+
echo "Warning: SRT library not found for $ABI. The build might fail."
24+
echo "Make sure to run the native build with CMake first."
25+
fi
26+
done
27+
28+
# Ensure we have gomobile
29+
if ! command -v gomobile &> /dev/null; then
30+
echo "gomobile not found, installing..."
31+
go install golang.org/x/mobile/cmd/gomobile@latest
32+
gomobile init
33+
elif ! gomobile version > /dev/null 2>&1; then
34+
echo "Initializing gomobile..."
35+
gomobile init
36+
fi
37+
38+
# Build the AAR
39+
echo "Building kinetic AAR for Android API $ANDROID_API..."
40+
export GO111MODULE=on
41+
gomobile bind -target=android -androidapi=$ANDROID_API -o "$OUTPUT_DIR/kinetic.aar" .
42+
43+
echo "Build complete. AAR file at: $OUTPUT_DIR/kinetic.aar"

app/src/main/go/go.mod

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/kevmo314/kinetic
22

3-
go 1.21.0
3+
go 1.23.0
4+
5+
toolchain go1.23.4
46

57
require (
68
github.com/bluenviron/gortsplib/v4 v4.6.2
@@ -33,8 +35,12 @@ require (
3335
github.com/pion/turn/v3 v3.0.1 // indirect
3436
github.com/pmezard/go-difflib v1.0.0 // indirect
3537
github.com/stretchr/testify v1.8.4 // indirect
36-
golang.org/x/crypto v0.22.0 // indirect
37-
golang.org/x/net v0.24.0 // indirect
38-
golang.org/x/sys v0.19.0 // indirect
38+
golang.org/x/crypto v0.37.0 // indirect
39+
golang.org/x/mobile v0.0.0-20250408133729-978277e7eaf7 // indirect
40+
golang.org/x/mod v0.24.0 // indirect
41+
golang.org/x/net v0.39.0 // indirect
42+
golang.org/x/sync v0.13.0 // indirect
43+
golang.org/x/sys v0.32.0 // indirect
44+
golang.org/x/tools v0.32.0 // indirect
3945
gopkg.in/yaml.v3 v3.0.1 // indirect
4046
)

app/src/main/go/go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
114114
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
115115
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
116116
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
117+
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
118+
golang.org/x/mobile v0.0.0-20250408133729-978277e7eaf7 h1:8MGTx39304caZ/OMsjPfuxUoDGI2tRas92F5x97tIYc=
119+
golang.org/x/mobile v0.0.0-20250408133729-978277e7eaf7/go.mod h1:ftACcHgQ7vaOnQbHOHvXt9Y6bEPHrs5Ovk67ClwrPJA=
117120
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
118121
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
119122
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
123+
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
124+
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
120125
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
121126
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
122127
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -134,11 +139,14 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
134139
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
135140
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
136141
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
142+
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
137143
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
138144
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
139145
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
140146
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
141147
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
148+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
149+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
142150
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
143151
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
144152
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -164,6 +172,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
164172
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
165173
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
166174
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
175+
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
176+
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
167177
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
168178
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
169179
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -187,6 +197,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
187197
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
188198
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
189199
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
200+
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
201+
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
190202
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
191203
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
192204
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

app/src/main/java/com/kevmo314/kineticstreamer/SettingsScreen.kt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import androidx.compose.material.icons.filled.Add
1313
import androidx.compose.material.icons.filled.ArrowBack
1414
import androidx.compose.material3.CenterAlignedTopAppBar
1515
import androidx.compose.material3.Checkbox
16-
import androidx.compose.material3.Divider
16+
import androidx.compose.material3.HorizontalDivider
1717
import androidx.compose.material3.ExperimentalMaterial3Api
1818
import androidx.compose.material3.Icon
1919
import androidx.compose.material3.IconButton
@@ -129,8 +129,9 @@ fun SettingsScreen(
129129
) {
130130
TextField(value = url, onValueChange = setUrl, label = { Text("URL") },
131131
modifier = Modifier.weight(1f),
132-
colors = TextFieldDefaults.textFieldColors(
133-
containerColor = Color.Transparent,
132+
colors = TextFieldDefaults.colors(
133+
unfocusedContainerColor = Color.Transparent,
134+
focusedContainerColor = Color.Transparent,
134135
),
135136
)
136137
IconButton(onClick = {
@@ -147,7 +148,7 @@ fun SettingsScreen(
147148
)
148149
}
149150
}
150-
Divider()
151+
HorizontalDivider()
151152

152153
Text("Codec", modifier = Modifier.padding(16.dp))
153154

@@ -183,16 +184,16 @@ fun SettingsScreen(
183184
}
184185
Surface(onClick = { /*TODO*/ }) {
185186
ListItem(
186-
headlineText = { Text("Bitrate") },
187-
supportingText = { Text("Adaptive bitrate") },
187+
headlineContent = { Text("Bitrate") },
188+
supportingContent = { Text("Adaptive bitrate") },
188189
modifier = Modifier.fillMaxWidth()
189190
)
190191
}
191192
Surface(onClick = {
192193
navigateTo("settings/recording")
193194
}) {
194195
ListItem(
195-
headlineText = { Text("Recording settings") },
196+
headlineContent = { Text("Recording settings") },
196197
modifier = Modifier.fillMaxWidth()
197198
)
198199
}
@@ -234,8 +235,8 @@ fun RecordingSettingsScreen(
234235
) {
235236
Surface(onClick = { /*TODO*/ }) {
236237
ListItem(
237-
headlineText = { Text("Container") },
238-
supportingText = { Text("MP4") },
238+
headlineContent = { Text("Container") },
239+
supportingContent = { Text("MP4") },
239240
modifier = Modifier.fillMaxWidth()
240241
)
241242
}
@@ -244,8 +245,8 @@ fun RecordingSettingsScreen(
244245

245246
Surface(onClick = { /*TODO*/ }) {
246247
ListItem(
247-
headlineText = { Text("Maximum capacity") },
248-
supportingText = { Text(bytesToString(maxCapacity.value)) },
248+
headlineContent = { Text("Maximum capacity") },
249+
supportingContent = { Text(bytesToString(maxCapacity.value)) },
249250
modifier = Modifier.fillMaxWidth()
250251
)
251252
}

0 commit comments

Comments
 (0)