Hi,

so I implemented this functionality. There is now a plugin goal that goes 
through the dependencies of the current module and creates manifest/namespace 
files for each uri it finds and automatically adds this to the compiler 
configuration. With this in place I got most of the examples to compile. I will 
definitely need some more tweaking, cause I haven't managed to get a single 
example to run in the Flashplayer (I am getting the following error for all of 
them: VerifyError: Error #1079: Native methods are not allowed in loaded code.) 
But at least the compiler seems to be producing not-empty SWF files.

The cool thing is, with the current auto-generating of configuration the 
complete build config for an example is as simple as this:

<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.flex.flexjs.examples</groupId>
        <artifactId>examples-flexjs</artifactId>
        <version>0.7.0-SNAPSHOT</version>
    </parent>

    <artifactId>DesktopMap</artifactId>
    <version>0.7.0-SNAPSHOT</version>
    <packaging>swf</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.flex.flexjs.compiler</groupId>
                <artifactId>flexjs-maven-plugin</artifactId>
                <version>0.7.0-SNAPSHOT</version>
                <extensions>true</extensions>
                <configuration>
                    <mainClass>DesktopMap.mxml</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.flex.flexjs.framework</groupId>
            <artifactId>GoogleMaps</artifactId>
            <version>0.7.0-SNAPSHOT</version>
            <type>swc</type>
        </dependency>
    </dependencies>

</project>

No hand-written config files are needed. I think this will make a lot of things 
a lot easier in the future ... especially for new people.

I did have to comment out some modules as I was getting the following errors:

Ambiguous "MouseEvent" in:
- FlexJSStore
- FlexJSStore_jquery
- FlexWebsiteStatsViewer

Ambiguous reference to IDataInput:
- StorageExample

Implicit coercion of a value with static type Event to a possibly unrelated 
type Event. in:
- MobileTrader

But I think we're looking better every day. Can just keep my fingers crossed, 
that my customers will keep postponing project starts so I will have another 
few days to work on this full-time :-)

Chris


________________________________________
Von: Christofer Dutz <christofer.d...@c-ware.de>
Gesendet: Mittwoch, 18. Mai 2016 10:58:50
An: dev@flex.apache.org
Betreff: AW: AW: [DISCUSS] Handling of namespaces and xml

Hi Alex,

I just had a look at the content of the catalog.xml and I agree actually the 
information should be available automatically without packing anything in the 
SWC.
How much work would it be to make the compiler use this? I am currently working 
on the compilation of the examples using Maven and I manually had to add a 
manifest.xml file listing all components that were referenced by MXML files in 
the examples.

I guess that there is currently none here that would probably be wanting to 
change the compiler to support this, so as a workaround I'll implement 
something that generates manifests on the fly by inspecting the classpath. But 
I'll make it super-easy to remove.

Chris

________________________________________
Von: Alex Harui <aha...@adobe.com>
Gesendet: Dienstag, 17. Mai 2016 20:23:16
An: dev@flex.apache.org
Betreff: Re: AW: [DISCUSS] Handling of namespaces and xml

On 5/17/16, 11:09 AM, "Christofer Dutz" <christofer.d...@c-ware.de> wrote:

>The Manifest files seem to allow making a set of mxml tags be available
>using one prefix. The classes referenced by the "js" prefix fire example
>contain classes from different packages. You should have to import all
>packages individually. And you would be importing all sorts of helper
>classes you might not way to have.

I'm not sure what you mean by importing all packages.  Anyway, it appears
the manifest files are used in at least two ways:


1) In -include-namespaces. This is one way we figure out which classes go
in a SWC.
2) in -namespaces.  And that builds the mapping for MXML as you say.


>I guess the manifests are solely used by the mxml compiler.

It occurred to me that the manifests might be used by an IDE for
code-assist so they don't have to parse the SWC.  But I have no proof
either way.  Do you?


>
>I guess I shouldn't break anything, if I pack in the manifests in swcs
>built by Maven. So I'll give that a try.

True, but in the SWC already, there is a catalog.xml file, and in there
there is a set of <component> tags and the information there looks
identical to what is in the -manifest.xml file, so that's why I'm
wondering whether it is worth making the changes to pack the -manifest.xml
file into the SWC. Why not just have the compiler read the catalog.xml
instead?  Why put duplicate information in the SWC?


-Alex

Reply via email to