256: Upgrade Dagger and fix dependency mess r=msfjarvis a=msfjarvis

Fixes #255

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
bors[bot] 2021-05-26 03:51:21 +00:00 committed by GitHub
commit c1bd679046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 52 deletions

View File

@ -27,7 +27,7 @@ jobs:
- name: Build release app
uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
with:
arguments: :app:assembleDebug
arguments: :app:assembleRelease
- name: Clean secrets
run: scripts/signing-cleanup.sh

View File

@ -15,7 +15,3 @@ The codebase is fairly simple, and the package structure follows [Buffer's](http
- `:database`: Database layer implemented using SQLDelight to persist saved posts
- `:desktop`: Proof-of-concept desktop client that needs significantly more love than it has received so far
## Handling Compose dependencies
The app currently uses JetBrains' [compose-jb](https://github.com/JetBrains/compose-jb) as the upstream for our builds of Compose, so each Compose-depending library we pull in must be added through the `composeDependency` helper rather than `implementation` directly.

View File

@ -12,35 +12,20 @@ plugins {
android { defaultConfig { applicationId = "dev.msfjarvis.lobsters" } }
dependencies {
// We explicitly make all AndroidX Compose-depending artifacts exclude
// all the Google coordinates so that the same classes can be provided
// by JetBrains' repository.
fun composeDependency(notation: Provider<MinimalExternalModuleDependency>) {
implementation(notation) {
exclude(group = "androidx.compose.animation")
exclude(group = "androidx.compose.compiler")
exclude(group = "androidx.compose.foundation")
exclude(group = "androidx.compose.material")
exclude(group = "androidx.compose.runtime")
exclude(group = "androidx.compose.ui")
}
}
kapt(libs.androidx.hilt.daggerCompiler)
implementation(projects.api)
implementation(projects.common)
implementation(projects.database)
implementation(compose.animation)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.browser)
implementation(libs.androidx.datastore)
composeDependency(libs.androidx.compose.activity)
composeDependency(libs.androidx.compose.lifecycleViewModel)
composeDependency(libs.androidx.compose.navigation)
composeDependency(libs.androidx.compose.paging)
composeDependency(libs.androidx.compose.uiTooling)
implementation(libs.androidx.compose.activity)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.lifecycleViewModel)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.compose.paging)
implementation(libs.androidx.compose.uiTooling)
implementation(libs.androidx.hilt.dagger)
implementation(libs.bundles.androidxLifecycle)
implementation(libs.kotlin.coroutines.android)

View File

@ -17,10 +17,12 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavType
import androidx.navigation.compose.KEY_ROUTE
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.navArgument
import androidx.navigation.compose.navigate
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navDeepLink
import androidx.paging.LoadState
@ -49,7 +51,8 @@ fun LobstersApp() {
val newestPostsListState = rememberLazyListState()
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route ?: Destination.startDestination.route
val currentRoute =
navBackStackEntry?.arguments?.getString(KEY_ROUTE) ?: Destination.startDestination.route
val currentDestination = Destination.getDestinationFromRoute(currentRoute)
val navigateToDestination: (destination: Destination) -> Unit = { destination ->
navController.navigate(destination.route) { launchSingleTop = true }

View File

@ -4,9 +4,6 @@ repositories {
google()
gradlePluginPortal()
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") {
content { includeGroup("com.google.dagger") }
}
}
gradlePlugin {
@ -27,13 +24,12 @@ gradlePlugin {
}
dependencies {
implementation("com.android.tools.build:gradle:7.1.0-alpha01")
// https://github.com/google/dagger/issues/2634
implementation("com.google.dagger:hilt-android-gradle-plugin:HEAD-SNAPSHOT")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
implementation("com.google.devtools.ksp:symbol-processing-gradle-plugin:1.5.0-1.0.0-alpha10")
implementation("com.android.tools.build:gradle:7.0.0-alpha15")
implementation("com.google.dagger:hilt-android-gradle-plugin:2.36")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32")
implementation("com.google.devtools.ksp:symbol-processing-gradle-plugin:1.4.32-1.0.0-alpha08")
implementation("com.github.zafarkhaja:java-semver:0.9.0")
implementation("com.diffplug.spotless:spotless-plugin-gradle:5.12.4")
implementation("com.squareup.sqldelight:gradle-plugin:1.5.0")
implementation("org.jetbrains.compose:compose-gradle-plugin:0.4.0-build209")
implementation("org.jetbrains.compose:compose-gradle-plugin:0.4.0-build188")
}

View File

@ -1,21 +1,21 @@
# Centralized versions for dependencies that share versions
[versions]
accompanist = "0.10.0"
accompanist = "0.9.1"
androidx_test = "1.4.0-alpha05"
compose = "1.0.0-beta07"
coroutines = "1.5.0"
dagger_hilt = "2.35.1"
jb_compose = "0.4.0-build209"
kotlin = "1.5.0"
ksp = "1.5.0-1.0.0-alpha10"
compose = "1.0.0-beta06"
coroutines = "1.4.3"
dagger_hilt = "2.36"
jb_compose = "0.4.0-build190"
kotlin = "1.4.32"
ksp = "1.4.32-1.0.0-alpha08"
lifecycle = "2.4.0-alpha01"
moshix = "0.11.0"
moshix = "0.10.0"
retrofit = "2.9.0"
sqldelight = "1.5.0"
[libraries]
# buildSrc dependencies, they are not used from here for now so manually update buildSrc/build.gradle.kts as well
androidGradlePlugin = "com.android.tools.build:gradle:7.1.0-alpha01"
androidGradlePlugin = "com.android.tools.build:gradle:7.0.0-alpha15"
composeGradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jb_compose" }
hiltGradlePlugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "dagger_hilt" }
jsemverGradlePlugin = "com.github.zafarkhaja:java-semver:0.9.0"
@ -30,7 +30,7 @@ kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-co
kotlin-coroutines-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "coroutines" }
# AndroidX dependencies
androidx-appcompat = "androidx.appcompat:appcompat:1.4.0-alpha01"
androidx-appcompat = "androidx.appcompat:appcompat:1.3.0-rc01"
androidx-browser = "androidx.browser:browser:1.3.0"
androidx-coreLibraryDesugaring = "com.android.tools:desugar_jdk_libs:1.0.10"
androidx-datastore = "androidx.datastore:datastore-preferences:1.0.0-beta01"
@ -38,10 +38,12 @@ androidx-lifecycle-runtimeKtx = { module = "androidx.lifecycle:lifecycle-runtime
androidx-lifecycle-viewmodelKtx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
# Compose dependencies
androidx-compose-activity = "androidx.activity:activity-compose:1.3.0-alpha08"
androidx-compose-lifecycleViewModel = "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha05"
androidx-compose-navigation = "androidx.navigation:navigation-compose:2.4.0-alpha01"
androidx-compose-paging = "androidx.paging:paging-compose:1.0.0-alpha09"
androidx-compose-activity = "androidx.activity:activity-compose:1.3.0-alpha07"
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
androidx-compose-lifecycleViewModel = "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha04"
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
androidx-compose-navigation = "androidx.navigation:navigation-compose:1.0.0-alpha10"
androidx-compose-paging = "androidx.paging:paging-compose:1.0.0-alpha08"
androidx-compose-uiTooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
# Hilt dependencies

View File

@ -9,6 +9,6 @@ mkdir -p "$SSHDIR"
echo "$ACTIONS_DEPLOY_KEY" > "$SSHDIR/key"
chmod 600 "$SSHDIR/key"
mkdir -p "$GITHUB_WORKSPACE/Claw"
cp -v ./app/build/outputs/apk/debug/app-debug.apk "$GITHUB_WORKSPACE/Claw/Claw-${VERSION_NAME}.apk"
cp -v ./app/build/outputs/apk/release/app-release.apk "$GITHUB_WORKSPACE/Claw/Claw-${VERSION_NAME}.apk"
cd "$GITHUB_WORKSPACE/Claw"
rsync -ahvcr --omit-dir-times --progress --delete --no-o --no-g -e "ssh -i $SSHDIR/key -o StrictHostKeyChecking=no -p $SSH_PORT" . "$SERVER_DEPLOY_STRING"