You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Christopher Collins (JIRA)" <ji...@apache.org> on 2016/03/02 05:27:18 UTC

[jira] [Resolved] (MYNEWT-141) Newt tool - Replace SQLite targets with directories / yml files.

     [ https://issues.apache.org/jira/browse/MYNEWT-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Collins resolved MYNEWT-141.
----------------------------------------
    Resolution: Fixed

h3. Summary

Targets definitions are now contained in YAML files.  Targets must have the following directory / file structure:

{{targets/<target-name>/pkg.yml}}

That is:
* Newt only searches for targets in the targets directory.
* No additional nesting is allowed; pkg.yml must be in the target-name directory, which must be a child of "targets".

These restrictions are there to allow the user to refer to targets by their name, rather than being forced to specify their full path.  There are some simple enhancements we can make in the future to lift these restrictions.

h3. Backwards compatibility
Newt preserves backwards compatibility by executing the following
procedure whenever a "target" command is issued:
# Read the contents of the legacy sqlite database.  If the database doesn't exist, the procedure is complete.
# For each target T in the database: If T does not exist with the modern structure, create the corresponding directory and yml file, and populate the yml file as appropriate.
# The database is renamed from .app/app.db to .app/legacy-app.db.  The migration procedure will not be executed again as long as the database has the new name.

Regarding step 3: I didn't want newt to delete the database entirely; the database will be useful if we decide we don't like this feature, or when using code from older branches.  On the other hand, the file has to be renamed to prevent the migration procedure from restoring deleted targets.

h3. Notes

The "autotarget" procedure (create the bin2img target from larva's autotarget file) has been removed from Newt.  Now, the bin2img target resides in the larva repository.

h3. Issues

* When a target is modified, Newt rewrites the yml file "from scratch."  If the previous version of the file had some custom formatting or contained any comments, they are lost.


> Newt tool - Replace SQLite targets with directories / yml files.
> ----------------------------------------------------------------
>
>                 Key: MYNEWT-141
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-141
>             Project: Mynewt
>          Issue Type: Improvement
>            Reporter: Christopher Collins
>            Assignee: Christopher Collins
>             Fix For: v0_8_0_beta2
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)