[
https://issues.apache.org/jira/browse/MYNEWT-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175008#comment-15175008
]
Christopher Collins edited comment on MYNEWT-141 at 3/2/16 6:46 PM:
--------------------------------------------------------------------
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.
* As before, Newt expects a single string value for each target variable. This
is unwieldy for certain variables that are inherently a list of values, such as
cflags. We should accept a single string or a list of strings for most (all?)
target variables.
was (Author: ccollins476):
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.
* As before, Newt expects a single string value for each target variable. This
is unwieldy for certain variables that are inherently a list of values, such as
cflags. We should accept a single string or a list of strings for most (all?)
target variables.
> 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)