How to user asDoc generation support

cwocwo's Avatar

cwocwo

06 Jun, 2012 01:08 AM

I want to generate docs. How to user asDoc generation support?

  1. Support Staff 1 Posted by Yennick Trevels on 06 Jun, 2012 06:30 AM

    Yennick Trevels's Avatar

    normally it should work by executing the "gradle asdoc" command. This will create a "doc" folder in your project.

  2. 2 Posted by cwocwo on 06 Jun, 2012 07:05 AM

    cwocwo's Avatar

    Z:\flex\ark>gradle asdoc
    FAILURE: Could not determine which tasks to execute.

    • What went wrong: Task 'asdoc' not found in root project 'ark'.

    • Try: Run gradle tasks to get a list of available tasks.

    BUILD FAILED

    Total time: 2.786 secs

    Z:\flex\ark>

    ------------------------------------------------------------------------------------ Z:\flex\ark>gradle tasks
    Dynamic properties are deprecated: http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraProp...
    Deprecated dynamic property: "userName" on "Credentials [username: null]", value: "deployment".
    Deprecated dynamic property "userName" created in multiple locations.
    :tasks


    All tasks runnable from root project

    Build tasks

    assemble - Assembles all Jar, War, Zip, and Tar archives.
    clean - Deletes the build directory.

    Help tasks

    dependencies - Displays the dependencies of root project 'ark'.
    help - Displays a help message
    projects - Displays the sub-projects of root project 'ark'.
    properties - Displays the properties of root project 'ark'.
    tasks - Displays the tasks runnable from root project 'ark' (some of the displayed tasks may belong to subprojects).

    Other tasks

    build - Assembles and tests this project.
    copyresources - copies the resources to the build directory
    publish - Publish build artifacts to specified directory.

    Rules

    Pattern: build: Assembles the artifacts of a configuration.
    Pattern: upload: Assembles and uploads the artifacts belonging to a configuration.
    Pattern: clean: Cleans the output files of a task.

    To see all tasks and more detail, run with --all.

    BUILD SUCCESSFUL

    Total time: 2.935 secs

  3. Support Staff 3 Posted by Yennick Trevels on 06 Jun, 2012 07:14 AM

    Yennick Trevels's Avatar

    Can you run "gradle tasks --all", then it should give all the tasks (including those of the subprojects). The asdoc task only works on swc projects (or on their parent projects which should delegate the execution).

  4. 4 Posted by cwocwo on 06 Jun, 2012 07:17 AM

    cwocwo's Avatar

    Z:\flex\ark>gradle tasks --all
    Dynamic properties are deprecated: http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraProp...
    Deprecated dynamic property: "userName" on "Credentials [username: null]", value: "deployment".
    Deprecated dynamic property "userName" created in multiple locations.
    :tasks


    All tasks runnable from root project

    Build tasks

    assemble - Assembles all Jar, War, Zip, and Tar archives.
    clean - Deletes the build directory.

    Help tasks

    dependencies - Displays the dependencies of root project 'ark'.
    help - Displays a help message
    projects - Displays the sub-projects of root project 'ark'.
    properties - Displays the properties of root project 'ark'.
    tasks - Displays the tasks runnable from root project 'ark' (some of the displayed tasks may belong to subprojects).

    Other tasks

    build - Assembles and tests this project.

    compile - Compiles Flex component (*.swc) using the compc compiler
    test - Run the FlexUnit tests.
    testCompile - Compile the test runner SWF.
    

    copyresources - copies the resources to the build directory
    publish - Publish build artifacts to specified directory.

    Rules

    Pattern: build: Assembles the artifacts of a configuration.
    Pattern: upload: Assembles and uploads the artifacts belonging to a configuration.
    Pattern: clean: Cleans the output files of a task.

    BUILD SUCCESSFUL

    Total time: 3.076 secs
    Z:\flex\ark>

    And the build.gradle file :

    buildscript {

    repositories {
        maven {
            credentials {
                userName = nexusUsername
                password = nexusPassword
            }
            url repositoriesUrl
        }
    }
    dependencies {
        classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.5-beta'
    }
    

    }

    apply plugin: 'gradlefx'

    version = '1.0-SNAPSHOT'
    type = 'swc'
    locales = ['en_US', 'zh_CN']
    additionalCompilerOptions = [

     '-strict=false',
     '-verbose-stacktraces=false',
     '-debug=false',
     '-compress=true'
    

    ]

    repositories {

    maven {
        credentials {
            userName = nexusUsername
            password = nexusPassword
        }
        url repositoriesUrl
    }
    

    }

    dependencies {

    //external group: 'com.inspur.healthframework', name: 'E_Jumanji', version: '1.0', ext: 'swc'
    external group: 'org.httpclient', name: 'as3httpclientlib', version: '1_0_6', ext: 'swc'
    
    external group: 'com.adobe', name: 'as3corelib', version: '0.93', ext: 'swc'
    
    external files("${flexHome}/frameworks/libs/spark.swc",
           "${flexHome}/frameworks/libs/framework.swc",
           "${flexHome}/frameworks/libs/mx/mx.swc",
           "${flexHome}/frameworks/libs/advancedgrids.swc",
           "${flexHome}/frameworks/libs/textLayout.swc",
           "${flexHome}/frameworks/libs/core.swc",
           "${flexHome}/frameworks/libs/rpc.swc",
           "${flexHome}/frameworks/libs/sparkskins.swc",
           "${flexHome}/frameworks/libs/flash-integration.swc",
           "${flexHome}/frameworks/libs/osmf.swc"
    
           )
    

    }

  5. 5 Posted by cwocwo on 06 Jun, 2012 07:30 AM

    cwocwo's Avatar
  6. Support Staff 6 Posted by Yennick Trevels on 06 Jun, 2012 07:57 AM

    Yennick Trevels's Avatar

    Oww sorry, looks like I build from the wrong branch. I've attached a new build to this message.

  7. 7 Posted by cwocwo on 06 Jun, 2012 09:31 AM

    cwocwo's Avatar

    Z:\flex\ark>gradle tasks --all --stacktrace
    Dynamic properties are deprecated: http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraProp...
    Deprecated dynamic property: "userName" on "Credentials [username: null]", value: "deployment".
    Deprecated dynamic property "userName" created in multiple locations.

    FAILURE: Build failed with an exception.

    • What went wrong: java.lang.NoClassDefFoundError: org.apache.commons.lang.StringUtils

      org.apache.commons.lang.StringUtils

    • Try: Run with --info or --debug option to get more log output.

    • Exception is: org.gradle.listener.ListenerNotificationException: Failed to notify project evaluation listener.

        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97)
        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32)
        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at $Proxy9.afterEvaluate(Unknown Source)
        at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:47)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:462)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:74)
        at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
        at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
        at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
        at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
        at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:438)
        at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:433)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
        at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
        at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31)
        at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20)
        at org.gradle.launcher.Main.doAction(Main.java:48)
        at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:39)
        at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
      
      Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org.apache.commons.lang.StringUtils
        at org.gradle.messaging.dispatch.BroadcastDispatch$ClosureInvocationHandler.dispatch(BroadcastDispatch.java:119)
        at org.gradle.messaging.dispatch.BroadcastDispatch$ClosureInvocationHandler.dispatch(BroadcastDispatch.java:104)
        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88)
        ... 30 more
      
      Caused by: java.lang.NoClassDefFoundError: org.apache.commons.lang.StringUtils
        at org.gradlefx.validators.FlexSDKSpecifiedValidator.class$(FlexSDKSpecifiedValidator.groovy)
        at org.gradlefx.validators.FlexSDKSpecifiedValidator.$get$$class$org$apache$commons$lang$StringUtils(FlexSDKSpecifiedValidator.groovy)
        at org.gradlefx.validators.FlexSDKSpecifiedValidator.isFlexSDKHomeEmpty(FlexSDKSpecifiedValidator.groovy:47)
        at org.gradlefx.validators.FlexSDKSpecifiedValidator.execute(FlexSDKSpecifiedValidator.groovy:28)
        at org.gradlefx.validators.ProjectPropertyValidator$execute.call(Unknown Source)
        at org.gradlefx.validators.runner.FailOnErrorValidatorRunner$_run_closure1.doCall(FailOnErrorValidatorRunner.groovy:45)
        at org.gradlefx.validators.runner.FailOnErrorValidatorRunner.run(FailOnErrorValidatorRunner.groovy:44)
        at java_lang_Runnable$run.call(Unknown Source)
        at org.gradlefx.configuration.FlexAntTasksConfigurator.configure(FlexAntTasksConfigurator.groovy:33)
        at org.gradlefx.configuration.FlexAntTasksConfigurator$configure.call(Unknown Source)
        at org.gradlefx.GradleFxPlugin.configureAntWithFlex(GradleFxPlugin.groovy:69)
        at org.gradlefx.GradleFxPlugin.this$2$configureAntWithFlex(GradleFxPlugin.groovy)
        at org.gradlefx.GradleFxPlugin$_apply_closure1.doCall(GradleFxPlugin.groovy:58)
        ... 33 more
      

    BUILD FAILED

    Total time: 2.579 secs

    ====================================================== I need add common-lang to buildscript's repositories.

  8. Support Staff 8 Posted by Yennick Trevels on 06 Jun, 2012 04:56 PM

    Yennick Trevels's Avatar

    k, apparently I have to provide you the pom for the GradleFx artifact, this contains the dependency to commons-lang. So deploy the GradleFx jar on your maven repository with the pom in attachment.

  9. 9 Posted by cwocwo on 07 Jun, 2012 12:56 AM

    cwocwo's Avatar

    It works.


    But, how to set asdoc's additionalASDocOptions property?
    And, what options could be set?

  10. 10 Posted by cwocwo on 07 Jun, 2012 01:04 AM

    cwocwo's Avatar

    I use it in this way :

    asdoc.additionalASDocOptions = ['-keep-xml=true', '-skip-xsl=true']

  11. Support Staff 11 Posted by Yennick Trevels on 07 Jun, 2012 05:49 AM

    Yennick Trevels's Avatar

    normally you shouldn't have to use these options because they will keep the intermediate xml, which is only useful when you want to embed the asdoc information into your swc (can be achieved by setting the fatSwc property to true which will automatically set these options and package the asdoc information into the swc).

  12. 12 Posted by cwocwo on 07 Jun, 2012 05:57 AM

    cwocwo's Avatar

    Yes, it's easy to use.

    Thanks.

  13. Support Staff 13 Posted by Yennick Trevels on 07 Jun, 2012 06:27 AM

    Yennick Trevels's Avatar

    To answer your question on how to use the additionalASDocOptions property and what options can be set:

  14. Support Staff 14 Posted by Yennick Trevels on 11 Jun, 2012 06:12 AM

    Yennick Trevels's Avatar

    GradleFx v0.5 is now officially released, so it's now available on Maven Central.

  15. 15 Posted by cwocwo on 11 Jun, 2012 09:26 AM

    cwocwo's Avatar

    I will try it.

  16. Yennick Trevels closed this discussion on 15 Aug, 2012 02:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac