[TIMOB-9823] Tooling: Collate platform-since versions before calling generator
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-09T15:30:13.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Sprint 2012-16 Core, Release 2.1.2, Release 3.0.0 |
Components | Tooling |
Labels | core |
Reporter | Arthur Evans |
Assignee | Bill Dawson |
Created | 2012-06-27T14:47:05.000+0000 |
Updated | 2012-11-26T22:03:06.000+0000 |
Description
For the JSDuck generator, I'm trying to improve the display of the "since" dates, but the logic is complicated when dealing with per-platform since dates. For example, given:
since: { android: "2.1.0" }
The generator just gets the object. To turn it into a reasonable display, it needs to figure out:
- which platforms are supported
- the default "since" values for each of those platforms, since they're not specified
- whether the enclosing object has a since: date on it, which we should use instead of the default "since" date, if it's newer
It would be excellent if docgen could collate this information, and replace the partial "since" object with a complete one. This would make it trivial to display since.
@ARTHUR: Would it be possible for me to run your jsduck scripts (or whatever it is that gets the output) so I can see how you grab values from "my" scripts? Would make it easier to test any changes I make.
@ARTHUR: Thanks. I need access to https://github.com/appcelerator/tiduck, though, to get started.
An example for testing is the method Ti.Map.View.addRoute, which just got introduced in Android in 2.1.0, is now supported on all platforms, but has no "since" entries for iPad, iPhone or MobileWeb. iPhone and iPad should get the default "minimumstest" version number, and MobileWeb should get its first version number.
Testing Notes
This just tests the change I made, which is to be sure that a documented object (type/method/property/event/etc.) can't have a "since" version number that is lower (i.e., older) than any of its parents in the hierarchy. Example: it wouldn't make sense for a method to be since 0.9 if the type itself is only since 2.1.0. 1. Open apidoc/Titanium/Map/View.yml in your most favoritestest text editor in the whole wide world. (i.e., vi). 2. Change the View type's "since" to3. Save the file. 4. Run
python apidoc/docgen.py
. 5. When it's finished, open dist/apidoc/index.html in a browser. 6. Navigate to Titanium.Map.View. 7. Click the entry for theaddRoute
method. 8. It should show that iphone and ipad are since 0.8, mobileweb is since 2.1.0 and android is since 2.1.0. If you look at theaddRoute
doc entry, you'll see that mobileweb's "since" is not specified. Normally that would mean it defaults to 1.8, when mobileweb came into existence. But because View is set to mobileweb: "2.1.0", thenaddRoute
can't possibly be as old as 1.8.0.Pull request for master branch ready: https://github.com/appcelerator/titanium_mobile/pull/2711 If this will end up being needed for 2.1.2, just a) set the merge-2.1.2 label; b) shoot me a little note in case i don't notice the label. :)
2_1_X branch cherry-pick Pull Request ready: https://github.com/appcelerator/titanium_mobile/pull/2714
Tested with 3.0.0.v20121121161553