Skip to content


ASDoc and Keith Peters’ FlashDevelop templates

… via Joa Eberts fairwell to AS3Doc

Adobe had release their ASDoc command line tool around the 11th- i was otherwise occupied, but am happy to find a way to figure documentation into Keith Peters’ FlashDevelop templates for Flex2 and As3 projects now that i am back at my computer.

( If you haven’t already, follow that link to Keith’s tutorial on adding project templates if you are interested in creating an excellent dev environment in FD and are curious about what i added to target auto-documentation in the ANT process ).

To sum it up, all i added was a couple properties to the build.properties file and a conditional target to the build.xml. The modified files are here:

build.properties
build.xml

… be aware that these are modified files downloaded from keith’s post, so if you have changed some values in the properties file on your own machine you shouldn’t explicitly replace these with your own.

[Note: it's not really actionscript code below, i'm just being lazy]

The additions to build.properties:

1 – under the project properties header…
[as]#document titles
docbuild=false
doc.maintitle=templatetest
doc.windowtitle=’template test’[/as]

… the docbuild property is a string boolean evaluated in a conditional in the build.xml. The others are command params found here. Remember that anything with spaces needs quotes around it, as is the value for doc.windowtitle.

2 – under the tools header…
[as]# where you installed your documenter:
asdoc.dir=C:/Flex_2_sdk

# most of this shouldn’t need to change

documenter=bin/asdoc.exe

[/as]

… where asdoc.dir and documenter are relative to where you unzipped the ASDoc – in this case i threw it into the directory of the sdk.

the additions to build.xml:

1- conditional added to the compile target:
[as]


[/as]
2 – the document target
[as]




[/as]
3 – antcall added to build target:
[as][/as]

… Changing the doc.build value in build.properties to any string other than ‘true’ will cause this to not rebuild the documentation, which can be handy if you are just doing quick tests or bug finding – otherwise, if set to ‘true’ it will document any AS files recursively found in ${source.dir}.

I had a similar build made up for AS2 projects and BlDoc in FlashDevelop using ANT earlier and thought i’d have a go with it using ASDoc, maybe someone else will find this useful…

Posted in AS3, Flash.


8 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Keith Peters says

    That’s awesome. The way I might do it is to create it either as a separate target or a separate build file, and then maybe make a menu or a button that calls that item by itself. I’ve been playing with the idea of making some different targets for run, debug, documentation, etc. and setting up a build menu with items for each of them.

  2. todd anderson says

    You are right, Keith. A seperate toolbar button probably would be the better solution. As it stands now, the documentation runs prior to the launch of the swf, which means if you have a lot of classes you may not see the movie for some time…

  3. Philippe says

    What about this much shorter solution:
    http://www.flashdevelop.org/community/viewtopic.php?p=4058

  4. todd anderson says

    Excellent. That’s what i was thinking after Keith shed some input… i was just blind-sided by the build . :)

    Thanks, Phillipe.

  5. joa says

    There is a problem regarding ASDoc since you are only able to add the description of a packages by parameters.

    This is why I still use batch files for this process.

  6. mert ustaosmanoğlu says

    thanks posting

  7. nezh says

    thanks

  8. Flash Templates says

    ASDoc still a bit buggy i’d agree with batch files would work better.



Some HTML is OK

or, reply to this post via trackback.