qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

Add option "defines" to AsDoc #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create the following application named doc.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
        NS::test {
            trace("asdoc -define is funny")
        }
    ]]></mx:Script>
</mx:Application>

2. Run "asdoc.exe -doc-sources doc.mxml" 

What is the expected output? What do you see instead?
- It should render the AsDocs.
- Returns error: 
doc.mxml(4):  Error: Syntax error: extra characters found after end of
program.
NS:test {

- "asdoc.exe -doc-sources doc.mxml define=NS::test,true" works fine

Please provide any additional information below.
- define is afaik not documented by Adobe.

Original issue reported on code.google.com by marcsp...@gmail.com on 13 Jul 2008 at 3:15

GoogleCodeExporter commented 9 years ago
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_9.html

The documentation is a little vague here, as in one location it mentions that 
all the same parameters for 
compc and mxmlc are valid to the asdoc tool, but towards the end it says:
The asdoc command also recognizes the following options from the compc 
component compiler:

-source-path
-library-path
-namespace
-load-config
-actionscript-file-encoding
-help
-advanced
-benchmark
-strict
-warnings
...All other application compiler options are accepted but ignored so that you 
can use the same command-
lines and configuration files for the ASDoc tool that you can use for mxmlc and 
compc.

It does not list -define as a recognized option, implying it would be ignored, 
but clearly it worked for 
marcspeck.

Well, we ran into this issue as well when we added the subversion
build number to our about box. Our temporary solution was this:
In src/main/asdoc, create a file called asdoc-config.xml with these contents:
<?xml version="1.0" encoding="UTF-8"?>
<flex-config >
<compiler>
<define>
<name>BUILD::buildNumber</name>
<value>0</value>
</define>
<define>
<name>BUILD::timestamp</name>
<value>0</value>
</define>
</compiler>
</flex-config>

Then in the pom for this project:
       <reporting>
               <plugins>
                       <plugin>
                               <groupId>info.rvin.mojo</groupId>
                               <artifactId>asdoc</artifactId>
                               <configuration>
                                       <configFile>src/main/asdoc/asdoc-config.xml</configFile>
                               </configuration>
                       </plugin>
               </plugins>
       </reporting>

However, this is not a DRY solution, as the defines are now in 2
places, the flex-mojos pom configuration section as well as the
asdoc-config.xml.

Since asdoc is compiling the code, it would seem that we ought to
re-use some of the flex-mojos configuration options when asdoc is run
as well. I just wasn't sure which ones we could assume would be
necessary for both.

We're going to have the same issue with the flexcover plugin, as it
will recompile the source and needs exactly the same settings as the
compile-swc goal does. We need to think of the best way to share all
of this common configuration.

Original comment by RedB...@gmail.com on 14 Jul 2008 at 12:00

GoogleCodeExporter commented 9 years ago
Fixed at revision 577

Original comment by velo...@gmail.com on 14 Jul 2008 at 6:18

GoogleCodeExporter commented 9 years ago
So what is the solution that was included as the fix?

Can I now include:

<define><name /><value /></define> in the "configuration" section of the 
asdoc-report?

Original comment by codecr...@gmail.com on 31 Jul 2009 at 6:14

GoogleCodeExporter commented 9 years ago
http://svn.sonatype.org/flexmojos/trunk/flexmojos-testing/flexmojos-test-
harness/projects/issues/issue-0068/pom.xml

Original comment by codecr...@gmail.com on 3 Aug 2009 at 10:16

GoogleCodeExporter commented 9 years ago
Is there a particular reason you are using the old deprecated format for 
defines configuration here? The 
current format is:
        <configuration>
          <definesDeclaration>
            <property><name>BUILD::buildNumber</name><value>${buildNumber}</value></property>
            <property><name>BUILD::timestamp</name><value>${timestamp}</value></property>
            <property><name>BUILD::mavenVersion</name><value>"${project.version}"</value></property>
          </definesDeclaration>

Original comment by RedB...@gmail.com on 3 Aug 2009 at 1:10

GoogleCodeExporter commented 9 years ago
I'm unsure if asdoc supports the new format....

VELO

Original comment by velo...@gmail.com on 3 Aug 2009 at 1:12

GoogleCodeExporter commented 9 years ago
I'm talking about the pom.xml configuration format, not what gets passed to the 
asdoc compiler, or is this 
implemented by passing through the values to a flex-config.xml?

Original comment by RedB...@gmail.com on 3 Aug 2009 at 1:26