-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Migrate codebase to Navigation 3 #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
app/src/main/kotlin/com/google/samples/apps/nowinandroid/di/BackStackProvider.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/google/samples/apps/nowinandroid/di/BackStackProvider.kt
Outdated
Show resolved
Hide resolved
...n/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt
Outdated
Show resolved
Hide resolved
...n/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt
Outdated
Show resolved
Hide resolved
feature/topic/api/src/main/res/drawable/feature_topic_api_ic_topic_placeholder.xml
Outdated
Show resolved
Hide resolved
...lin/com/google/samples/apps/nowinandroid/feature/topic/impl/navigation/TopicEntryProvider.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/NiaNavDisplay.kt
Show resolved
Hide resolved
9b9cfe5
to
b85823d
Compare
...n/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt
Show resolved
Hide resolved
b85823d
to
ce87666
Compare
ba573cc
to
2ab0dde
Compare
2ab0dde
to
f75b028
Compare
app/src/main/kotlin/com/google/samples/apps/nowinandroid/di/BackStackProvider.kt
Show resolved
Hide resolved
app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt
Outdated
Show resolved
Hide resolved
app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/TestUtil.kt
Outdated
Show resolved
Hide resolved
f75b028
to
0b7f506
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is redundant can be deleted. IIRC when I ran the dependency graph generation script I excluded the benchmarks
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the command I use:
./generateModuleGraphs.sh --exclude-module :benchmarks --exclude-module :lint --exclude-module :ui-test-hilt-manifest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did run that particular command but it still generated this. Tried rerunning again after rebasing to main and im getting these errors
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'nowinandroid'.
> Could not create task ':generateModulesGraphvizText'.
> 'org.gradle.api.Project org.gradle.api.artifacts.ProjectDependency.getDependencyProject()'
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 983ms
4 actionable tasks: 4 up-to-date
Configuration cache entry stored.
Error: dot: can't open /tmp/dep_graph_core_common.gv: No such file or directory
Done in 1 ms!
0 KiB - NaN% = 0 KiB
rm: /tmp/dep_graph_core_common.gv: No such file or directory
Parallel Configuration Cache is an incubating feature.
Calculating task graph as no cached configuration is available for tasks: generateModulesGraphvizText
Type-safe project accessors is an incubating feature.
The newly generated svg graphs are not showing properly as a result. Any idea what may be causing this?
benchmarks/README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can exclude this one
apply(plugin = "org.jetbrains.kotlin.plugin.serialization") | ||
|
||
dependencies { | ||
"api"(project(":core:navigation")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"api"(project(":core:navigation")) | |
"implementation"(project(":core:navigation")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all impls
need it as well, so api
can just expose it to them
|
||
dependencies { | ||
"api"(project(":core:navigation")) | ||
"implementation"(project(":core:data")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this dependency? I thought the api
modules only needed to depend on :core:navigation
for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this dependency after moving TopicScreen/TopicViewModel to impl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why this needs to be in the api
module - it shouldn't be used by any other module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to impl
. It was in api
due to the old ListDetailPane implementation which has since been replaced with the ListDetailScene.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why this needs to be in the api
module - it shouldn't be used by any other module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to impl
. It was in api
due to the old ListDetailPane implementation which has since been replaced with the ListDetailScene. Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why this was moved into the api
module - so that interests
can depend on it, however, this raises an interesting question: should the list own its placeholder?
In this case, I would say yes, because the Interests
module was originally designed to contain more than one type of list item (the 2 being "authors" which was deprecated, and the still current "topics".
Let's move TopicDetailPlaceholder
into the Interests
module and rename it to InterestsListPlaceholder
.
This should simplify the dependency graphs, and keeps the :feature:api
modules consistently simple, containing only the navigation routes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, Interests
could be merged into the Topics
module. I've been meaning to do this since we removed Authors
, however, I don't want to add more complexity to an already complex PR. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to Interests impl
and renamed to InterestsDetailPlaceholder
. Also moved the resources (drawable & string) referenced by InterestsDetailPlaceholder to Interests api
res.
Source code is still left in api module. impl module is empty at this point.
Bump agp versions and add navigation 3 dependency
73fc68b
to
f87e507
Compare
f87e507
to
08f9dd0
Compare
Is there a |
[WIP] This PR migrates the codebase to using Jetpack Navigation 3.
More details to follow...