Building
This page is a quick reference for building all paperman components. See Development for prerequisites and project layout, and Paperman Mobile App for Flutter-specific setup (Java, Flutter SDK, Android SDK).
Environment
Make sure these are set before building:
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
export ANDROID_HOME=~/android-sdk
export PATH="$HOME/flutter/bin:$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
Build Everything
A plain make in the project root builds all components – the desktop app,
server, Flutter app and Sphinx documentation:
make
The GNUmakefile wraps the qmake-generated Makefile and adds the extra
targets listed below.
Flutter Builds
Always use make targets (make app, make app-linux, etc.) for
Flutter builds rather than running flutter directly. The makefile sets
up Dart defines (BUILD_DATE and others) that the app needs at runtime.
Running flutter build directly skips these, causing the app to show
“Built: unknown”.
Build Targets
Target |
Description |
|---|---|
|
Build everything (desktop app, server, Flutter app, docs) |
|
Build the Qt desktop app only |
|
Build the standalone search server |
|
Build the Flutter app (Android APK + Linux) |
|
Build the Android APK only |
|
Build the Android App Bundle only |
|
Build the Flutter Linux binary only |
|
Generate demo assets (PDFs + thumbnails) |
|
Build the Sphinx documentation |
Test targets:
Target |
Description |
|---|---|
|
Run all tests (builds desktop app and server first) |
|
Generate test files without running tests |
|
Run progressive-loading tests |
|
Run parallel tests |
Publishing and upload targets:
Target |
Description |
|---|---|
|
Build AAB and upload to Play Store internal testing |
|
Build APK and upload to Google Drive via rclone |
|
Build APK and copy to a web server via scp |
|
Copy a previously built APK without rebuilding |
Clean targets:
Target |
Description |
|---|---|
|
Remove all build artefacts |
|
Clean Flutter build outputs only |
|
Clean Sphinx build outputs only |
Other:
Target |
Description |
|---|---|
|
List built binaries and their sizes |
|
Print a summary of all targets |
Output Locations
paperman Desktop app
paperman-server Search server
app/build/app/outputs/flutter-apk/app-release.apk Android APK
app/build/app/outputs/bundle/release/app-release.aab Android App Bundle
app/build/linux/x64/release/bundle/paperman Linux Flutter binary
doc/_build/html/ Documentation