There are a few modules in this project:
Pocket The Pocket app
pocket-ui Reusable Pocket UI/UX components and views.
utils and utils-android Utilities and classes that several modules share.
sync-parser Parses GraphQL schema and creates an in-memory model (called "figments") for sync-gen
.
sync-gen Generates sync engine code from schema.
sync and sync-android General sync engine.
sync-pocket and sync-pocket-android Parts of the sync engine specific to the Pocket app.
analytics Wraps Snowplow Android tracker and exposes internal API that allows to declaratively annotate the UI and code to enable automatically picking up and sending analytic events most of the time (and manually send whatever you need in edge cases).
project-tools Some utilities for doing tasks in this project like bulk importing vectors
See each module's README file for more details.
flowchart TD
Pocket ---> sync-pocket-android
subgraph sync-engine [Sync Engine]
sync-pocket-android --> sync-pocket & sync-android
sync-pocket -.-> sync-gen --> sync-parser
sync-pocket & sync-android --> sync
end
sync-android --> utils-android
sync & utils-android --> utils
Pocket --> pocket-ui
Pocket & pocket-ui --> analytics
analytics & pocket-ui ---> utils-android
project-tools
Use the checked in code style as the default, but in general, be reasonable and use the code base as a guide. For Kotlin we use the official Kotlin style.
We're using Renovate to automatically update dependencies declared in a version catalog.
Because JSON doesn't support comments, here's some documentation on our renovate.json:
{
"extends": [
"local>Pocket/renovate-config"
]
}
Use a set of Pocket-wide defaults. See Pocket/renovate-config for more details and documentation.
{
"ignorePaths": ["buildSrc/src/main/kotlin/Deps.kt"]
}
Ignore our legacy dependency definitions in buildSrc
, while we gradually migrate to version catalog.
{
"ignorePresets": [":dependencyDashboardApproval"]
}
Ignore the default setting from Pocket/renovate-config and allow opening PRs without approval.
{
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
]
}
Amend the default config from Pocket/renovate-config and allow auto-merging minor version updates as well. This means only major updates will stay open to let a human decide before merging.
{
"packageRules": [
{
"matchManagers": ["gradle", "gradle-wrapper"],
"commitMessageTopic": "{{depName}}"
}
]
}
Tweak the default commit message a bit to cut a redundant word from already pretty long messages.
{
"packageRules": [
{
"matchDepNames": ["plugin-*"],
"semanticCommitType": "chore"
}
]
}
Update semantic commit rules to account for our custom plugin definitions
(because of defining them in buildSrc
).
We have a lot of documentation about the Sync Engine, but you kind of have to know where to look for it. Here's some examples to get you started:
- sync modules' READMEs: /sync-gen/README, /sync-parser/README,
- sync packages'
package-info.java
files: com.pocket.sync, com.pocket.sync.print.java (code generation), - sync class docs: Pocket, AppSource, V3Source, ClientApiSource (Pocket Graph source/client), MutableSpace (persistence/"database"), etc.
- API documentation on the generated classes or in the schema files (
v3.graphqls
,local.graphqls
, etc.) - Figment repo which is deprecated, but I left a note in the main README about pieces that might still be relevant to the Android Sync Engine