Skip to content

Commit

Permalink
clean up libs and fix AOSP build
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Aug 28, 2024
1 parent 48aea1d commit 639577d
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ android_app {
"com.google.android.material_material",
"kotlinx-coroutines-android",
"kotlinx-coroutines-core",
// storage backup lib
// our own gradle module libs
"seedvault-lib-core",
"seedvault-lib-storage",
// koin
"seedvault-lib-koin-core-jvm", // did not manage to add this as transitive dependency
Expand All @@ -36,7 +37,6 @@ android_app {
// WebDAV
"seedvault-lib-dav4jvm",
"seedvault-lib-okhttp",
"seedvault-lib-okio",
],
manifest: "app/src/main/AndroidManifest.xml",

Expand Down
31 changes: 31 additions & 0 deletions core/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// SPDX-FileCopyrightText: 2021 The Calyx Institute
// SPDX-License-Identifier: Apache-2.0
//

android_library {
name: "seedvault-lib-core",
sdk_version: "current",
srcs: [
"src/main/java/**/*.kt",
"src/main/java/**/*.java",
],
static_libs: [
"androidx.core_core-ktx",
"androidx.documentfile_documentfile",
"kotlinx-coroutines-android",
"kotlinx-coroutines-core",
"seedvault-lib-kotlin-logging-jvm",
// WebDAV
"seedvault-lib-dav4jvm",
"seedvault-lib-okhttp",
"okio-lib",
],
manifest: "src/main/AndroidManifest.xml",
optimize: {
enabled: false,
},
kotlincflags: [
"-opt-in=kotlin.RequiresOptIn",
],
}
7 changes: 3 additions & 4 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ android {
dependencies {
val aospLibs: FileTree by rootProject.extra
compileOnly(aospLibs)
compileOnly("org.ogce:xpp3:1.1.6")
compileOnly(kotlin("test"))
implementation(libs.bundles.kotlin)
implementation(libs.bundles.coroutines)
implementation(libs.androidx.documentfile)
implementation(libs.androidx.core.ktx)
// implementation(fileTree("${rootProject.rootDir}/libs/dav4jvm").include("okio-jvm-3.7.0.jar"))
implementation(libs.squareup.okio)
implementation(fileTree("${rootProject.rootDir}/libs/dav4jvm").include("*.jar"))
implementation("io.github.oshai:kotlin-logging-jvm:6.0.3")
implementation("org.slf4j:slf4j-simple:2.0.3")
implementation(libs.kotlin.logging)

testImplementation(kotlin("test"))
testImplementation("org.ogce:xpp3:1.1.6")
testImplementation("org.slf4j:slf4j-simple:2.0.3")
}
7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dokka = "1.9.20" # Dokka has no releases after 1.9.20

# Lint versions
lint-rules = { strictly = "0.1.0" }
logging = { strictly = "6.0.3" }

# Google versions
# https://android.googlesource.com/platform/external/protobuf/+/refs/tags/android-14.0.0_r53/java/pom.xml#7
Expand Down Expand Up @@ -73,6 +74,9 @@ androidx-documentfile = { strictly = "1.1.0-alpha01" } # 1.1.0-alpha02 in AOSP b
# https://android.googlesource.com/platform/prebuilts/sdk/+/android-14.0.0_r53/current/androidx/m2repository/androidx/work/work-runtime-ktx?autodive=0
androidx-work-runtime = { strictly = "2.10.0-alpha01" }

# https://android.googlesource.com/platform/external/okio/+/refs/tags/android-14.0.0_r53/CHANGELOG.md
squareup-okio = { strictly = "3.7.0" }

[libraries]
# Kotlin standard dependencies
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
Expand Down Expand Up @@ -104,6 +108,9 @@ androidx-documentfile = { module = "androidx.documentfile:documentfile", version
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work-runtime" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }

squareup-okio = { module= "com.squareup.okio:okio", version.ref = "squareup-okio" }
kotlin-logging = { module = "io.github.oshai:kotlin-logging-jvm", version.ref = "logging" }

[bundles]
kotlin = ["kotlin-stdlib", "kotlin-stdlib-jdk8", "kotlin-stdlib-common"]
coroutines = ["kotlinx-coroutines-core-jvm", "kotlinx-coroutines-android"]
Expand Down
6 changes: 6 additions & 0 deletions libs/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ java_import {
jars: ["kotlin-bip39-jvm-1.0.6.jar"],
sdk_version: "current",
}

java_import {
name: "seedvault-lib-kotlin-logging-jvm",
jars: ["kotlin-logging-jvm-6.0.3.jar"],
sdk_version: "current",
}
6 changes: 0 additions & 6 deletions libs/dav4jvm/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ java_import {
jars: ["okhttp-4.12.0.jar"],
sdk_version: "current",
}

java_import {
name: "seedvault-lib-okio",
jars: ["okio-jvm-3.7.0.jar"],
sdk_version: "current",
}
Binary file removed libs/dav4jvm/okio-jvm-3.7.0.jar
Binary file not shown.
Binary file added libs/kotlin-logging-jvm-6.0.3.jar
Binary file not shown.
1 change: 1 addition & 0 deletions storage/lib/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android_library {
local_include_dirs: ["src/main/proto"],
},
static_libs: [
"seedvault-lib-core",
"seedvault-lib-tink-android",
"libprotobuf-java-lite",
"androidx.core_core-ktx",
Expand Down
3 changes: 0 additions & 3 deletions storage/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ dependencies {
implementation(libs.androidx.room.runtime)
implementation(libs.google.protobuf.javalite)
implementation(libs.google.tink.android)
// TODO include via gradle and AOSP
// https://android.googlesource.com/platform/external/okio/+/refs/tags/android-14.0.0_r53/CHANGELOG.md
implementation(fileTree("${rootProject.rootDir}/libs/dav4jvm").include("okio-jvm-3.7.0.jar"))

ksp(group = "androidx.room", name = "room-compiler", version = libs.versions.room.get())
lintChecks(libs.thirdegg.lint.rules)
Expand Down

0 comments on commit 639577d

Please sign in to comment.