-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,93 @@ | ||
# Migrate from v0.8 to v0.9 | ||
|
||
Heta compiler of **version 0.9** follows the [Heta standard](https://hetalang.github.io/#/specifications/) of **version 0.5.0**. | ||
# Migration from v0.8 to v0.9 | ||
|
||
To use the newer Heta compiler you should make some updates to the platform files. To see the other updates see [change log](./CHANGELOG). | ||
The v0.9 release of Heta includes improvements in export flexibility, support for new formats, and better tooling for the declaration files. | ||
|
||
See also [Migrate to v0.6](./migrate-to-v0.6), [Migrate to v0.7](./migrate-to-v0.7), [Migrate to v0.8](./migrate-to-v0.8). | ||
The **v0.9** version of the Heta compiler adheres to the [Heta standard](https://hetalang.github.io/#/specifications/) **v0.5.0**. | ||
|
||
## Changes in declaration (platform.json) file | ||
To use the latest Heta compiler, you will need to update some platform files. For other updates, refer to the [changelog](./CHANGELOG). | ||
|
||
The new version uses YAML format (instead of JSON) for declaration file. The new format is more flexible and allows to use comments and multiline strings. | ||
You may also want to check the previous migration guides: [Migrate to v0.6](./migrate-to-v0.6), [Migrate to v0.7](./migrate-to-v0.7), and [Migrate to v0.8](./migrate-to-v0.8). | ||
|
||
Users can use JSON format for declaration file without restrictions but default YAML files will be generated with `heta init`. | ||
## Changes to the Declaration (platform.json) File | ||
|
||
## Replacement of inline #export actions by export array in declaration | ||
The new version uses the YAML format (instead of JSON) for the declaration file. YAML is more flexible, supporting comments and multiline strings. | ||
|
||
The new version uses `export` array in declaration file to define the list of actions which should be exported. | ||
You can still use JSON format for declaration files without restrictions, but YAML files will now be generated by default when using `heta init`. | ||
|
||
Another option is to use `--export` property in CLI command. See details in [CLI documentation](./cli-references.md). | ||
## Replacement of Inline `#export` Actions with an `export` Array in Declarations | ||
|
||
The old inline export syntax will be supported in the current version (as depricated) but it will be removed in the future. | ||
In this version, the `export` array is used in the declaration file to specify the list of actions to be exported. | ||
|
||
## Update platforms to support new features | ||
Alternatively, you can use the `--export` option in CLI commands. For more details, refer to the [CLI documentation](./cli-references.md). | ||
|
||
1. **Check** that your platform can be build without errors in the current builder v0.8.x. | ||
The old inline export syntax will be deprecated but supported in the current version. However, it will be removed in future versions. | ||
|
||
*If you use Git you should commit the latest changes before updating formats.* | ||
## Updating Platforms to Support New Features | ||
|
||
1. Install the latest version of **Heta compiler**. | ||
1. **Ensure** your platform builds without errors using the current v0.8.x builder. | ||
|
||
```bash | ||
npm install -g heta-compiler | ||
heta -v | ||
# must be v0.9.0 or newer | ||
``` | ||
*If you're using Git, it is recommended to commit the latest changes before updating the formats.* | ||
|
||
1. If you use declaration file **platform.json** update the property to `builderVersion: ^0.9.0` and change file name to **platform.yml** (optional). | ||
2. Install the latest version of the **Heta compiler**: | ||
|
||
```yml | ||
# in platform.yml | ||
{ | ||
"builderVersion": "^0.9.0", | ||
"id": "my-platform", | ||
"notes": "platform notes", | ||
"version": "v0.1.0", | ||
... | ||
} | ||
``` | ||
```bash | ||
npm install -g heta-compiler | ||
heta -v | ||
# should return v0.9.0 or newer | ||
``` | ||
|
||
1. Remove unnecessary properties from the declaration file if you used them before: | ||
3. If you're using the **platform.json** declaration file, update the `builderVersion` property to `^0.9.0`, and optionally rename the file to **platform.yml**. | ||
|
||
```yml | ||
# in platform.yml | ||
{ | ||
"builderVersion": "^0.9.0", | ||
"id": "my-platform", | ||
"notes": "platform notes", | ||
"version": "v0.1.0", | ||
... | ||
} | ||
``` | ||
|
||
4. Remove any unnecessary properties from the declaration file if you had used them previously: | ||
|
||
- `options.skipExport`: use `export: []` instead | ||
- `options.juliaOnly`: use `export: [{format: Julia}]` instead | ||
|
||
1. If you used command line options to supress export with `heta build --no-export` then you should use now `heta build --export ''`. | ||
|
||
If you used line options to build julia code only with `heta build --julia-only` then you should use now `heta build --export 'Julia'`. | ||
|
||
1. Remove all inline `#export` actions from the .heta files and add them to the `export` array in the declaration file. | ||
|
||
See details in [export formats](./export-formats.md) | ||
|
||
**Before** | ||
```hetas | ||
// in index.heta | ||
#export {format: DBSolve, filepath: model, powTransform: function}; | ||
#export {format: SBML, version: L3V2}; | ||
``` | ||
|
||
**After** | ||
```yaml | ||
# in platform.yml | ||
... | ||
export: [ | ||
{format: DBSolve, filepath: model, powTransform: function}, | ||
{format: SBML, version: L3V2} | ||
] | ||
``` | ||
|
||
**Or After** | ||
```json | ||
# in platform.json | ||
... | ||
"export": [ | ||
{"format": "DBSolve", "filepath": "model", "powTransform": "function"}, | ||
{"format": "SBML", "version": "L3V2"} | ||
] | ||
``` | ||
|
||
1. Check building with `heta build` and make a commit if you use git. | ||
- `options.skipExport`: replace with `export: []` | ||
- `options.juliaOnly`: replace with `export: [{format: Julia}]` | ||
|
||
5. If you were using command line options to suppress export with `heta build --no-export`, now use `heta build --export ''`. | ||
|
||
If you previously used `heta build --julia-only` to build only Julia code, now use `heta build --export 'Julia'`. | ||
|
||
6. Remove all inline `#export` actions from your `.heta` files and move them to the `export` array in the declaration file. | ||
|
||
Refer to [export formats](./export-formats.md) for more details. | ||
|
||
**Before:** | ||
```heta | ||
// in index.heta | ||
#export {format: DBSolve, filepath: model, powTransform: function}; | ||
#export {format: SBML, version: L3V2}; | ||
``` | ||
|
||
**After (YAML format):** | ||
```yaml | ||
# in platform.yml | ||
... | ||
export: [ | ||
{format: DBSolve, filepath: model, powTransform: function}, | ||
{format: SBML, version: L3V2} | ||
] | ||
``` | ||
|
||
**Or After (JSON format):** | ||
```json | ||
# in platform.json | ||
... | ||
"export": [ | ||
{"format": "DBSolve", "filepath": "model", "powTransform": "function"}, | ||
{"format": "SBML", "version": "L3V2"} | ||
] | ||
``` | ||
|
||
7. Test the build with `heta build`, and if you're using Git, make a commit. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters