We need to handle updates for 3 different versions:
- helidon
- build-tools maven plugin
- cli
metadata.properties:
helidon.version=2.0.0-RC2
build-tools.version=2.0.0-RC3
cli.version=2.0.0-RC1
cli.2.0.0-M2.message=Major devloop enhancements
cli.2.0.0-M4.message=Helidon archetype support
cli.2.0.0-RC1.message=Perf improvements
The cli changelog is encoded with properties with format cli.{cli-version}.message.
The message is optional, version resolution is required to compile the list of message to display the notification.
data.zip:
|- metadata.properties
|- archetype-catalog.xml
|- archetypeX
https://helidon.io/cli-data/latest (contains '2.0.0-RC3')
https://helidon.io/cli-data/2.0.0-RC3/cli-data.zip
https://helidon.io/cli-data/2.0.0-RC2/cli-data.zip
E.g. "https://helidon.io/cli-data/latest/cli-data.zip"
- Lookup latest helidon version "https://helidon.io/cli-init/latest" (skipped if --version is passed explicitly)
- Download data.zip https://helidon.io/cli-init/{version}/data.zip
- Delete ~/.helidon/cache/{version}
- Unpack data.zip to ~/.helidon/cache/{version}
- Update ~/.helidon/cache/latest to contain {version}
- Delete all temp files
.helidon
|- cache/
|- latest (contains '2.0.0-RC2')
|- 2.0.0-RC2
|- .last_update (contains etag + timestamp of last check time) (TODO find a better name)
|- metadata.properties
|- archetype-catalog.xml
|- archetypeX
|- 2.0.0-RC1
|- metadata.properties
|- archetype-catalog.xml
|- archetypeX
# --version is not passed, "latest" Helidon needs to be resolved
helidon init
# --version is explicitly passed to an "older" version that is not the latest
helidon init --version 2.0.0-RC1
- Update https://helidon.io/cli-init/latest
- Publish new https://helidon.io/cli-init/{helidon-version}/data.zip
- Update https://helidon.io/cli-init/latest
- Update https://helidon.io/cli-init/{helidon-version}/data.zip
- Update cli.version entry in metadata.properties
- Update cli-changelog entry in metadata.properties (If worthy)
- Update CLI downloads
- Update https://helidon.io/cli-init/latest
- Update https://helidon.io/cli-init/{helidon-version}/data.zip
- Only update build-tools.version entry in metadata.properties