Hi all

We've got an annoying situation with an application class that derives from the 
spark.components.Application class...
If we have an MXML file that defines a class that derives directly from this 
(or from mx.core.Application) then we get an extra class auto-generated (below) 
which derives from mx.managers.SystemManager.

The issue is, when our MXML file derives from another class, which itself 
extends the Spark (or MX) Application class, then this extra class isn't 
generated, the HTML just tries to call our application.start() method, and this 
doesn't add in the right glue code.

>From what I can see, there's a decision happening within the compiler:
org.apache.royale.compiler.internal.targets.RoyaleApplicationFrame1Info
where it's got a function:
ApplicationAndModuleDefinitions.isApplicationOrModule()
where the class definition is checked to see if it inherits from one of the 
Spark/MX/Halo application classes.

The change seems simple: we just recurse here to walk up the inheritance of the 
given class definition, until we reach the top or find that we do derive from 
one of these...

So I have a proposed change (and have pushed it to my github fork below)
https://github.com/ajwfrost/royale-compiler/commit/1c4ca15a05bd822a379e9f6fc2d3d03280806132

The issue here is that I can't work out how to test this change! I've compiled 
the compiler (at least, run 'ant' within the royale-compiler folder) and have 
also compiled the royale-asjs project after this ('ant all'), and have manually 
copied the jar files from royale-compiler\compiler\lib to royale-asjs\lib, but 
I'm not getting my new code being hit at all. So is anyone able to confirm 
whether this is actually the right place for the change, and how I can get the 
updated compiler code so that it's actually in use? I've tried running the 
compiler via Eclipse - I used to have this working but doing 'git pull' and 
getting all the recent updates has broken this somehow so I no longer have the 
compiler working for debugging it either..

thanks

   Andrew


Generated class below - this is what I want to generate even if we derive from 
spark.components.Application via an intermediary class:


/**
* @constructor
* @extends {mx.managers.SystemManager}
*/
test_mx_managers_SystemManager = function() {
  test_mx_managers_SystemManager.base(this, 'constructor');
   this.mainClassName = test;
};
goog.inherits(test_mx_managers_SystemManager, mx.managers.SystemManager);
goog.exportSymbol('test_mx_managers_SystemManager', 
test_mx_managers_SystemManager);
/**
* @type {Object.<string, Array.<Object>>}
*/
test_mx_managers_SystemManager.prototype.ROYALE_CLASS_INFO = { names: [{ name: 
'test_mx_managers_SystemManager', qName: 'test_mx_managers_SystemManager', 
kind: 'class' }]};


Reply via email to