Skip to content

Commit 0f9f5ea

Browse files
authored
Add explanations of Tonel format versions
1 parent 0d6f975 commit 0f9f5ea

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

General/ExportFormats.md

+29
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This page will present formats from the most recommended for new projects to the
1212
- [Tonel](#tonel)
1313
* [Tonel Pros and Cons](#tonel-pros-and-cons)
1414
* [Tonel supported Pharo versions](#tonel-supported-pharo-versions)
15+
* [Tonel versions](#tonel-versions)
1516
- [FileTree metadata less](#filetree-metadata-less)
1617
* [FileTree metadata less Pros and Cons](#filetree-metadata-less-pros-and-cons)
1718
* [FileTree metadata less supported Pharo versions](#filetree-metadata-less-supported-pharo-versions)
@@ -85,6 +86,34 @@ Metacello new
8586
load.
8687
```
8788

89+
### Tonel versions
90+
91+
Tonel got multiple versions over the years, each tweaking the export format:
92+
- version 1.0: original tonel export format
93+
- version 2.0: this version ensure that in the metadatas the keys are symbols and the values are strings. This change happened in order to be compatible with Gemstone. Note that this format was never used as a default export format of Pharo
94+
- version 3.0: this version has the changes of the 2.0 but it also adds the properties `package` and `tag` to replace the `category` property for class definitions. This is to remove same ambiguity in the class definitions. The `category` property is kept by default for backward compatibility, but the TonelWriter can be configured to not export this property. This format can also be improved to export more metadata. For example, it is planned to export a property `deprecatedAliases` to manage some class deprecations in the future.
95+
96+
If you want to change you export format and convert all the files of a repository at once to avoid to have multiple PR with format changes you can use this script and commit the resulting files:
97+
98+
```st
99+
| projectName |
100+
projectName := 'ProjectNameInIceberg'.
101+
repository := IceRepository repositories detect: [ :repo | repo name = projectName ].
102+
repository workingCopy packages do: [ :pkg |
103+
IceLibgitTonelWriter forInternalStoreFileOut: pkg latestVersion mcVersion on: repository ]
104+
```
105+
106+
Since Pharo 12, it is also possible to indicate in a Tonel project which version of Tonel to use to export some code. The file to update is the `.properties` file that is in the source folder and it should look like this:
107+
108+
```
109+
{
110+
#format : #tonel,
111+
#version: #'1.0' //could be 2.0 or 3.0
112+
}
113+
```
114+
115+
This is useful for example if a project has contributors on P11 using v1 format and contributors in P12 using v3 format since P11 is unable to export Tonel v3 format.
116+
88117
## FileTree metadata less
89118

90119
FileTree ([https://github.com/dalehenrich/filetree](https://github.com/dalehenrich/filetree)) is the first export format that was integrated in the goal to use Pharo with Git. The first version had a lot of metadata (see section Filetree metadata full), the second was a new version with metadata less format.

0 commit comments

Comments
 (0)