Hi,
as requested, here a list of the goals that the 1.5 library specification aims to solve.
1) hardware dependencies: there should be some metadata that tells the user if the library can compile successfully on his board or not.
This goal is due to the increasing number of people asking "why this library doesn't compile on my XXXXX-NON-AVR Board?"
The specification started with the "architecture" field only, without going in deeper detail. This is not a complete solution: we've seen, also from your comments, that it can't completely solve the problem but, at least, its preparatory to let people understand that a library made for "AVR" (Uno) will not run on "SAM" (Due), or "KINETIS" (Teensy). It's a raw categorization, but its simple to understand and its what we tried to achieve.
BTW I'm really happy to see other proposal discussed:
from Bill: "arch/cpu/board" selection
from Paul: "arch/features/requires" or simply "features/requires"
Every proposal has its pro and cons, and choosing one is very difficult, I'm looking with interest every proposal, I have a no final answer ATM, and I would like to see other opinions as well.
2) library dependencies: add some metadata to allow automatic dependencies resolution and avoid the user need to #include every dependency manually on the sketch.
* This is not yet implemented on the IDE.
And probably the metadata needs some refinements.
3) core dependencies: something similar to library dependencies, but this time on the cores.
* Also this one is not yet implemented on the IDE.
Same here: the metadata needs some refinements.
Bill already proposed: instead of "core" use "mantainer/core"
4) put some metadata about the library: name, author, description, etc. to be used by a future library manager GUI.
5) solve some of the weirdness of the 1.0 library format
some of the following was requested many times from 3rd party libraries developers:
- recursive subfolder compile: with 1.0 you can't use subfolders to organize your source code, with 1.5 yes
- "utility" folder treated in special way: I guess this anomaly was introduced to partly solve the missing recursive subfolder compile, the 1.5 remove this anomaly
- Source code mixed with everything else: with the 1.0 the source code is mixed with everything, with the 1.5 the source code is moved in its own "src" folder. This makes possible to add recursive compile and remove the "utility" folder but it makes the 1.5 format incompatible with 1.0.
- Add the "arch" folder facility.
Again this doesn't add any "new" feature from the 1.0, it aims only to increase code readability and to reduce maintenance efforts (to library developers, not tool mantainer). Since its an 1.0 incompatible format, it seemed nice to have it.
- Put everything in their place: if you read carefully the specification you can notice that everything has its place (documentation, example, extras, source code) the specification is made to be extendable, so in the future we can release a 1.6 library spec. with, say, schematics, photos, and whatever else we want, without being incompatible with previous versions.
If we want to keep 1.0 compatibilty we will lose *all* this benefits. Again, I didn't have a final answer here, I understand Bill concerns about compatibilty, and avenue33 and jantje about "arch" library, and would like to see as much opinions as possible. I've no problem to move back to an 1.0 compatible library
C
If we want to keep 1.0 compatibilty we will lose *all* this benefits.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
Bill, I changed the specification as you suggested, but I'm not sure if I've done it correctly. Feel free to change or add. When I say "GUI" I mean a future Library Manager GUI that will help the user to manage libraries: download, search & install from a repository, etc.
[done] means that the requirement is currently implemented.
general requirements
REQUIREMENT: There must be a file that contains all the metadata. The metadata field is the same on the current 1.5 specification [done]
The metadata information will be used in a GUI. For example, a user may search through "descriptions" to easily find a library suitable for his project.
REQUIREMENT: Backward compatibility, IDE >=1.5.0 must support 1.0 libraries [done]
REQUIREMENT: Forward compatibility: 1.0.x IDEs must work with 1.5 libraries
hardware dependencies
REQUIREMENT: There must be metadata to determine if the library can compile successfully on a selected board. The IDE will show only the libraries that compiles on the user's target board. [done, architecture only]
REQUIREMENT: The metadata must be designed to not be "exclusive": users must not be blocked, by a too strict dependency check, to do a legitimate operation. (for example specifing that a library works only with board "A" but the user has a board "B" that is compatible).
library dependencies:
FUTURE-REQUIREMENT: There must be metadata to allow automatic dependencies resolution, i.e. to determine a list of libraries needed by the current library to work properly. This metadata may be used by the GUI to download and install missing dependencies.
FUTURE-REQUIREMENT: The IDE will use the metadata to automatically #include every dependency in the sketch (and avoid this task to the user).
core dependencies:
FUTURE-REQUIREMENT: There must be metadata to allow automatic core-dependencies resolution, i.e. to determine if a library may work with the core used on the user's target board. Will be used in the IDE to show only the libraries that works on the user's target board.
FUTURE-REQUIREMENT: The metadata must be designed to not be "exclusive": users must not be blocked, by a too strict dependency check, to do a legitimate operation. (for example specifing that a library works only with core "A" but the user has a board using a core "B" that is compatible with "A").
solve the weirdness of the 1.0 library format
Since we have the chance to change the library structure, I think it is the right time to also make a proper format that support some of the most requested features:
GOAL: Design the specification in a way that is easily extendable in the future [done]
GOAL: Allow recursive subfolders compile [done]
GOAL: Remove "utility" folder anomaly [done]
GOAL: Source code not mixed with everything else [done]
and also to add facilities that help library authors to write better libraries:
GOAL: Add "arch" folder facility [done]
C
An obvious, easy and elegant way to implement my first point above is to
explicitely name a library in the library.properties file and drop the
requirements on the directory it is in. However, if we want to do that,
we should think about this _now_ and probably even include an explicit
mention of this fact (so users as well as third party tool developers
realize this).
I've already written too many lengthy messages in this conversation. It's hard to imagine more will help.I think more than enough information is available for a new writeup that can be put forward for validation.