Personal template and reference for developing apps with the Light SDK. (WIP)
- Structure
- Includes a Nix development shell. It is catered toward headless development and on-device testing.
light-sdkis a top-level submodule, and custom application code lives intool/.- Sample tool is updated to my preferred defaults and code style.
- Automations
- CI:
:tool:assembleDebug,:tool:teston every push/PR to main - Nightly SDK update check: Dependabot checks the
light-sdksubmodule daily, opening/updating a PR when there's a new commit. - Releases: pushing a
v*tag (e.g.v0.2.0) builds a signed release APK and creates a GitHub Release with it attached. - Template propagation (TODO): Each child repo will keep
light-sdk-templateas a remote; GH action will check it nightly.
- CI:
Requires Github PAT read:packages scope for resolving the private Github Packages dependency.
- Local: put it in
local.propertiesasgpr.user/gpr.key(gitignored). - CI: add it as repo secrets:
GH_PACKAGES_USER,GH_PACKAGES_TOKENunder Settings -> Secrets.
git checkout -b refactor/light-sdk-rewrite
# Wipe everything!
# rm -rf *export LIGHT_SDK_TEMPLATE_PATH=~/Github/light/light-sdk-template
# 1. Submodule
git submodule add https://github.com/lightphone/light-sdk.git light-sdk
# 2. Gradle wiring + devshell + gitignore
cp $LIGHT_SDK_TEMPLATE_PATH/settings.gradle.kts .
cp $LIGHT_SDK_TEMPLATE_PATH/build.gradle.kts .
cp $LIGHT_SDK_TEMPLATE_PATH/gradle.properties .
cp -r $LIGHT_SDK_TEMPLATE_PATH/gradle .
cp $LIGHT_SDK_TEMPLATE_PATH/gradlew .
cp $LIGHT_SDK_TEMPLATE_PATH/gradlew.bat .
chmod +x gradlew
cp $LIGHT_SDK_TEMPLATE_PATH/flake.nix .
cp $LIGHT_SDK_TEMPLATE_PATH/.gitignore .
# 3. Demo tool scaffold as a starting point
cp -r $LIGHT_SDK_TEMPLATE_PATH/tool .
# 4. CI + Dependabot + release automation
mkdir -p .github/workflows
cp $LIGHT_SDK_TEMPLATE_PATH/.github/workflows/*.yml .github/workflows/
cp $LIGHT_SDK_TEMPLATE_PATH/.github/dependabot.yml .github/
# 5. Helper script + license
mkdir -p scripts
cp $LIGHT_SDK_TEMPLATE_PATH/scripts/new-project.sh scripts/
chmod +x scripts/new-project.sh
cp $LIGHT_SDK_TEMPLATE_PATH/LICENSE .For updating the flake, custom scripts, or custom gradle wiring (not light-sdk).
# One-time setup
git remote add template [email protected]:garado/light-sdk-template.git
# Pull in template improvements
git fetch template
git merge template/main --allow-unrelated-histories
# This will conflict on files meant to stay project-specific
# TODO Add script to autoresolve# Enter Nix development shell
nix develop
# Run interactive project setup script (auto-renames stuff)
./scripts/new-project.sh
# Build
./gradlew :tool:installDebugFor personal reference
- Components
- Layout/Nav:
LightTopBar,LightBottomBar(up to 5 icons, or 3 if mixing in text),LightFullscreenModal,LightScrollView,LightGrid(spacing constants) - Text:
LightText(variants: Title, Subtitle, Heading, Subheading, Copy, Button, Paragraph, ParagraphWide, Detail, Fine, Superfine, Micro),LightFont - Input:
LightTextField(read-only, opens editor on tap),LightTextInputEditor,LightEmbeddedLp3Keyboard - Icons/media:
LightIcon/LightIcons(full icon set),LightQrCodeScanner - Interaction/theming:
lightClickable(no press ripple),LightTheme/LightThemeColors/LightThemeController/LightThemeTokens
- Layout/Nav:
- Permissions
INTERNETACCESS_NETWORK_STATEWAKE_LOCKVIBRATEPOST_NOTIFICATIONSCAMERARECORD_AUDIOREAD_MEDIA_AUDIOACCESS_FINE_LOCATIONACCESS_COARSE_LOCATIONNFC