google / horologist

Horologist is a group of libraries that aim to supplement Wear OS developers with features that are commonly required by developers but not yet available.
https://google.github.io/horologist/
Apache License 2.0
543 stars 87 forks source link

horologist-datalayer-watch dependencies #2241

Open Tolriq opened 1 month ago

Tolriq commented 1 month ago

The module horologist-datalayer-watch have a dependency on libs.androidx.complications.datasource.ktx that have tons of other dependencies, just to extract the name of the ComplicationType in one function.

I'm not sure this is really necessary for this simple need. (One might also wonder why that wear dep embeds so many side dependencies but that's for another repo)

By side effect it will load appcompat, fragment, drawerlayout, recylerview, .... all those with proguard rules preventing them to be properly stripped.

|    +--- com.google.android.horologist:horologist-datalayer-watch:0.6.12
|    |    +--- com.google.android.horologist:horologist-datalayer:0.6.12 (*)
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.0.0 (*)
|    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 (*)
|    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.8.1 (*)
|    |    +--- androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1
|    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    +--- androidx.wear.watchface:watchface-complications-data-source:1.2.1
|    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    |    +--- androidx.preference:preference:1.1.0
|    |    |    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.6.1
|    |    |    |    |    |    +--- androidx.activity:activity:1.6.0 -> 1.9.0 (*)
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.3.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.appcompat:appcompat-resources:1.6.1 (*)
|    |    |    |    |    |    +--- androidx.collection:collection:1.0.0 -> 1.4.0 (*)
|    |    |    |    |    |    +--- androidx.core:core:1.9.0 -> 1.13.1 (*)
|    |    |    |    |    |    +--- androidx.core:core-ktx:1.8.0 -> 1.13.1 (*)
|    |    |    |    |    |    +--- androidx.cursoradapter:cursoradapter:1.0.0
|    |    |    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.drawerlayout:drawerlayout:1.0.0
|    |    |    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.8.0 (*)
|    |    |    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.13.1 (*)
|    |    |    |    |    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    |    |    +--- androidx.emoji2:emoji2:1.2.0 -> 1.3.0 (*)
|    |    |    |    |    |    +--- androidx.emoji2:emoji2-views-helper:1.2.0 -> 1.3.0
|    |    |    |    |    |    |    +--- androidx.collection:collection:1.1.0 -> 1.4.0 (*)
|    |    |    |    |    |    |    +--- androidx.core:core:1.3.0 -> 1.13.1 (*)
|    |    |    |    |    |    |    +--- androidx.emoji2:emoji2:1.3.0 (*)
|    |    |    |    |    |    |    \--- androidx.emoji2:emoji2:1.3.0 (c)
|    |    |    |    |    |    +--- androidx.fragment:fragment:1.3.6 -> 1.5.1 (*)
|    |    |    |    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.5.1 -> 2.8.0 (*)
|    |    |    |    |    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 -> 2.8.0 (*)
|    |    |    |    |    |    +--- androidx.resourceinspection:resourceinspection-annotation:1.0.1
|    |    |    |    |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.savedstate:savedstate:1.2.0 -> 1.2.1 (*)
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.10 -> 2.0.0 (*)
|    |    |    |    |    |    \--- androidx.appcompat:appcompat-resources:1.6.1 (c)
|    |    |    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    |    |    +--- androidx.fragment:fragment:1.1.0 -> 1.5.1 (*)
|    |    |    |    |    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    |    |    |    +--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    |    |    \--- androidx.collection:collection:1.0.0 -> 1.4.0 (*)
|    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    \--- androidx.collection:collection:1.0.0 -> 1.4.0 (*)
|    |    |    |    +--- androidx.wear.watchface:watchface-complications:1.2.1
|    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
|    |    |    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    |    |    +--- androidx.wear.watchface:watchface-complications-data:1.2.1
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
|    |    |    |    |    |    +--- androidx.core:core:1.1.0 -> 1.13.1 (*)
|    |    |    |    |    |    +--- androidx.preference:preference:1.1.0 (*)
|    |    |    |    |    |    +--- androidx.versionedparcelable:versionedparcelable:1.1.0 -> 1.1.1 (*)
|    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression:1.0.0-beta01
|    |    |    |    |    |    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
|    |    |    |    |    |    |    +--- androidx.annotation:annotation-experimental:1.3.0 -> 1.4.0 (*)
|    |    |    |    |    |    |    +--- androidx.collection:collection:1.2.0 -> 1.4.0 (*)
|    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-proto:1.0.0-beta01
|    |    |    |    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression:1.0.0-beta01 (c)
|    |    |    |    |    |    |    |    \--- androidx.wear.protolayout:protolayout-expression-pipeline:1.0.0-beta01 (c)
|    |    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
|    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression-pipeline:1.0.0-beta01 (c)
|    |    |    |    |    |    |    \--- androidx.wear.protolayout:protolayout-proto:1.0.0-beta01 (c)
|    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression-pipeline:1.0.0-beta01
|    |    |    |    |    |    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
|    |    |    |    |    |    |    +--- androidx.annotation:annotation-experimental:1.3.0 -> 1.4.0 (*)
|    |    |    |    |    |    |    +--- androidx.collection:collection:1.2.0 -> 1.4.0 (*)
|    |    |    |    |    |    |    +--- androidx.concurrent:concurrent-futures:1.1.0 (*)
|    |    |    |    |    |    |    +--- androidx.core:core:1.7.0 -> 1.13.1 (*)
|    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression:1.0.0-beta01 (*)
|    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-proto:1.0.0-beta01 (*)
|    |    |    |    |    |    |    +--- androidx.wear.protolayout:protolayout-expression:1.0.0-beta01 (c)
|    |    |    |    |    |    |    \--- androidx.wear.protolayout:protolayout-proto:1.0.0-beta01 (c)
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
|    |    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1 -> 1.8.1 (*)
|    |    |    |    |    |    +--- androidx.wear.watchface:watchface-complications:1.2.1 (c)
|    |    |    |    |    |    +--- androidx.wear.watchface:watchface-complications-data-source:1.2.1 (c)
|    |    |    |    |    |    \--- androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1 (c)
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
|    |    |    |    |    +--- androidx.wear.watchface:watchface-complications-data:1.2.1 (c)
|    |    |    |    |    +--- androidx.wear.watchface:watchface-complications-data-source:1.2.1 (c)
|    |    |    |    |    \--- androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1 (c)
|    |    |    |    +--- androidx.wear.watchface:watchface-complications-data:1.2.1 (*)
|    |    |    |    +--- androidx.wear.watchface:watchface-complications:1.2.1 (c)
|    |    |    |    +--- androidx.wear.watchface:watchface-complications-data:1.2.1 (c)
|    |    |    |    \--- androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1 (c)
|    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
|    |    |    +--- androidx.wear.watchface:watchface-complications-data-source:1.2.1 (c)
|    |    |    +--- androidx.wear.watchface:watchface-complications:1.2.1 (c)
|    |    |    \--- androidx.wear.watchface:watchface-complications-data:1.2.1 (c)
Tolriq commented 1 month ago

So not opening a new issue but:

(Yes I know I'm obsessed with APK size and unneeded deps :) )

yschimke commented 1 month ago

I'll take a look at how this is possible. It's valid and hopefully something to improve.

On the other hand it's convenient to not have more tiny module. Ultimately I wish the androidx API had tight dependencies :)

Tolriq commented 1 month ago

androidx API had tight dependencies

So do I, in the end until they split media router I doubt most people will care, it's a pain to maintain a fork just to do it, despite not much to do. But a few other androidX deps should also be updated for better support of full Compose apps, specially when every one says hey now you should do it in Compose. And still force appcompat, fragments and even drawerlayout for no reason and the proguard rules preventing proper stripping.

Anyway just a quick rant :p

Tolriq commented 3 weeks ago

In the same continuation, any reason why tiles have a complication part and all the deps? They seems at first sight pretty unrelated.

yschimke commented 3 weeks ago

@Tolriq a bad judgement call? I think my thinking was that having a whole another module for 1-2 classes was overkill, and I'd expect apps with Tiles to also have Complications.

Let me review. We can move things around when we bump to 0.7.x.

Tolriq commented 3 weeks ago

In my case for music it seems the media session already publish the complication data no? Everything seems to work on the watch faces.