Adopt Template Updates

Generated projects can compare themselves with newer Baselines releases using baselines_migrate.sh.

This is not a blind overwrite tool. It produces a migration report first and only applies changes automatically when Git confirms the patch is clean.

Run A Migration Report

From the generated project:

bash
1../baselines-kmp/baselines_migrate.sh \
2 --target . \
3 --template ../baselines-kmp \
4 --to-rev v1.4.0

The script uses .baselines/template.properties to understand which Baselines revision the project came from.

Reports are written to:

text
1.baselines/migrations/<timestamp>

Report Files

Important files:

  • README.md - migration summary, file lists, and recommended steps
  • apply.patch - safe template changes that can be checked with git apply --check
  • template.properties.next - replacement metadata to commit after the migration is adopted
  • apply.log - apply failure details, present only when --apply could not apply the safe patch

Use --debug-report to keep raw diffs, status files, and generation logs under debug/.

Without --apply, template.properties.next is only a report artifact. With --apply, it overwrites .baselines/template.properties only after git apply --check succeeds and the patch is applied.

Safe Automatic Apply

bash
1../baselines-kmp/baselines_migrate.sh \
2 --target . \
3 --template ../baselines-kmp \
4 --to-rev v1.4.0 \
5 --apply

--apply refuses to modify the target unless:

  • the target is a Git repository
  • the worktree is clean
  • git apply --check succeeds

If those checks fail, the project is left unchanged. Review apply.log, then port the relevant hunks manually from apply.patch.

Older Projects Without Metadata

Older generated projects may not have .baselines/template.properties. Create it once before running normal migrations:

bash
1../baselines-kmp/baselines_migrate.sh \
2 --target . \
3 --template ../baselines-kmp \
4 --init-metadata \
5 --from-rev v1.3.0 \
6 --package com.example.myapp \
7 --name MyApp \
8 --display-name "My App"

Use the Baselines tag or commit that most closely matches the project starting point.

Free To Pro

This migration helper is for adopting newer releases of the same Baselines foundation. It does not automatically convert a Free project into a Pro project. Free-to-Pro remains a deliberate manual migration or fresh-start decision.