Skip to content

Commit

Permalink
Change default strategies and application load to simplify use
Browse files Browse the repository at this point in the history
  • Loading branch information
eMaringolo committed May 29, 2020
1 parent f231159 commit 05f8cc5
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 143 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ You can load individual Tonel packages as Applications or export VAST Applicatio

![Application Manager](docs/img/application-manager.png)

When loading apps using this GUI the _loader_ will attempt to detect whether the files are in a Git repository, and if a git repository is detected it will configure itself to use [git versioning](docs/strategies.md), otherwise it will use the default settings (or leave all editions open without version).

#### Configuration Maps

You can also export and load Configuration Maps together with their applications from the Configuration Maps Browser.
Expand Down
12 changes: 6 additions & 6 deletions docs/strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ The _loader_ will instantiate a separate `TonelApplicationLoader` (aka _applicat

When loading an `Application` the _loader_ will read it's prerequisites from the `vaPrerequisites` metadata in the `.package` file, but there could be the case where you need to specify some other prerequisite at load time.

### `TonelLoaderInteractivePrereqStrategy` (interactive, default)
### `TonelLoaderInteractivePrereqStrategy` (interactive)

This strategy will display an `EtPrerequisiteCollectingPrompter` enabling the user to add/remove prerequisites before loading the application

### `TonelLoaderComputedPrerequisitesStrategy` (unattended)
### `TonelLoaderComputedPrerequisitesStrategy` (unattended, default)

This strategy uses the prequisites specified in the metadata plus the ones computed by the loader.

Expand All @@ -34,7 +34,7 @@ aTonelLoader useComputedPrerequisites

The version strategy handles both the versioning, and also the creation of editions prior to versioning.

### `TonelLoaderInteractiveVersionStrategy` (interactive, default)
### `TonelLoaderInteractiveVersionStrategy` (interactive)

This will prompt the user to specify a version name _for each application_ using the default version name prompter, leaving the option to not define any, and so only the edition will be created, but without versioning it.

Expand All @@ -43,7 +43,7 @@ This will prompt the user to specify a version name _for each application_ using
aTonelLoader useInteractiveVersioning
```

### `TonelLoaderNoVersionStrategy` (unattended)
### `TonelLoaderNoVersionStrategy` (unattended, default)

This strategy will create an new edition but won't version it. It is useful when you are developing and want to control manually the versioning and/or don't want to version at all.

Expand Down Expand Up @@ -104,12 +104,12 @@ When loading the base edition, the application might need to load its prerequisi
You can also specify whether the lookup of base editions will lookup only for versioned editions, to avoid selecting an edition that might be a draft or broken but that it is more recent than the latest "valid" edition (usually a versioned one).


### `TonelLoaderInteractiveBaseEditionStrategy` (interactive, default)
### `TonelLoaderInteractiveBaseEditionStrategy` (interactive)

This is the default strategy, that will display a list of base editions to choose, and prompt the user to select one from the list.


### `TonelLoaderLatestBaseEditionStrategy` (unattended)
### `TonelLoaderLatestBaseEditionStrategy` (unattended, default)

This will automatically select the latest (newest) edition as the base edition for the App/Subapp being loaded.

Expand Down
Binary file modified envy/Tonel.dat
Binary file not shown.
20 changes: 10 additions & 10 deletions source/.configmaps
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]
}
],
#ts : 3767954973,
#ts : 3768234608,
#comment : '',
#formatVersion : '1.1',
#applications : OrderedCollection [
Expand All @@ -33,8 +33,8 @@
},
{
#name : 'TonelLoaderModel',
#versionName : '1.68',
#ts : 3767947668
#versionName : '1.69',
#ts : 3768231942
},
{
#name : 'TonelReaderModel',
Expand All @@ -43,8 +43,8 @@
},
{
#name : 'TonelTools',
#versionName : '1.14',
#ts : 3767953884
#versionName : '1.15',
#ts : 3768231806
},
{
#name : 'TonelWriterModel',
Expand All @@ -53,7 +53,7 @@
}
],
#name : 'Tonel',
#versionName : '1.63'
#versionName : '1.64'
},
{
#conditions : [
Expand All @@ -62,8 +62,8 @@
#requiredMaps : [
{
#name : 'Tonel',
#versionName : '1.63',
#ts : 3767954973
#versionName : '1.64',
#ts : 3768234608
},
{
#name : 'z.ST: SUnit',
Expand All @@ -73,7 +73,7 @@
]
}
],
#ts : 3767954994,
#ts : 3768234611,
#comment : '',
#formatVersion : '1.1',
#applications : OrderedCollection [
Expand All @@ -94,6 +94,6 @@
}
],
#name : 'Test Tonel',
#versionName : '1.14'
#versionName : '1.15'
}
]
8 changes: 0 additions & 8 deletions source/TonelLoaderModel/TonelLoader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,6 @@ TonelLoader >> forceCreationOfEditions [
self versionStrategy alwaysCreateEditions: true
]

{ #category : 'initializing',
#vaVisibility : 'private' }
TonelLoader >> initialize [
super initialize.
self beInteractive.
self useDefaultNaming
]

{ #category : 'initializing',
#vaVisibility : 'private' }
TonelLoader >> initializeApplications [
Expand Down
13 changes: 10 additions & 3 deletions source/TonelLoaderModel/TonelLoaderSettings.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TonelLoaderSettings >> appSuperGroupSetting: superGroup [
{ #category : 'strategies' }
TonelLoaderSettings >> baseEditionStrategy [

^self strategyAt: #baseEdition ifAbsentPut: [TonelLoaderInteractiveBaseEditionStrategy new]
^self strategyAt: #baseEdition ifAbsentPut: [TonelLoaderLatestBaseEditionStrategy new]
]

{ #category : 'strategies' }
Expand Down Expand Up @@ -148,7 +148,7 @@ TonelLoaderSettings >> postCopy [
{ #category : 'strategies' }
TonelLoaderSettings >> prerequisitesStrategy [

^self strategyAt: #prerequisites ifAbsentPut: [TonelLoaderInteractivePrereqStrategy new]
^self strategyAt: #prerequisites ifAbsentPut: [TonelLoaderComputedPrerequisitesStrategy new]
]

{ #category : 'strategies' }
Expand All @@ -171,6 +171,13 @@ TonelLoaderSettings >> strategyAt: aSymbol [
^self strategies at: aSymbol
]

{ #category : 'strategies',
#vaVisibility : 'private' }
TonelLoaderSettings >> strategyAt: aSymbol ifAbsent: aBlock [

^self strategies at: aSymbol ifAbsent: aBlock
]

{ #category : 'strategies',
#vaVisibility : 'private' }
TonelLoaderSettings >> strategyAt: aSymbol ifAbsentPut: anObject [
Expand All @@ -188,7 +195,7 @@ TonelLoaderSettings >> strategyAt: aSymbol put: anObject [
{ #category : 'strategies' }
TonelLoaderSettings >> versionStrategy [

^self strategyAt: #version ifAbsentPut: [TonelLoaderInteractiveVersionStrategy new]
^self strategyAt: #version ifAbsentPut: [TonelLoaderNoVersionStrategy new]
]

{ #category : 'strategies' }
Expand Down
Loading

0 comments on commit 05f8cc5

Please sign in to comment.