Hi Carlos,

Based on the variation that happens, I'm not sure ${application} is useful
in its current form, although at first glance it appeared to be when I used
it.

Probably we just need
${applicationclass}

The code that handles this is here:
https://github.com/apache/royale-compiler/blob/a9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java#L832

And based on what it seems to be doing I think the ${applicationclass}
token would just need to be substituted with the same value that is passed
as the argument to getTemplateBody call here:
https://github.com/apache/royale-compiler/blob/a9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java#L879

so I'm guessing all it needs is:
if (type.equals("release")) {
            result = input.replaceAll("\\$\\{applicationclass\\}",
projectName );
        } else {
            result = input.replaceAll("\\$\\{applicationclass\\}",
mainClassName );
        }

But I did not check the variation between projectName and mainClassName
between release and debug for that, so I don't fully understand that part
yet. Maybe @aharui can confirm.




On Fri, Sep 6, 2019 at 7:36 PM Carlos Rovira <[email protected]>
wrote:

> Hi Greg,
>
> so the proposal is to end with:
>
> -body
> -application (used for standard Royale apps)
> -AppClassName (for Flex emulated apps that will have
> "_mx_managers_SystemManager" as part of the string. so this is really
> "{application}" + "_mx_managers_SystemManager")
>
> right?
>
> what do you think about
>
> -body
> -application
> -flexapplication
>
> ?
>
> (just trying to have the same style for names and simplifying to something
> more human readable)
>
> thanks!
>
>
> El vie., 6 sept. 2019 a las 5:16, Greg Dove (<[email protected]>)
> escribió:
>
> > This seems like an easy thing to fix (unless I missed something).
> > So I think we just need to decide what the token should be.
> >
> > What does everyone think of:
> > ${AppClassName}
> >
> > Input welcome...
> >
> >
> >
> > On Fri, Sep 6, 2019 at 3:05 PM Greg Dove <[email protected]> wrote:
> >
> > > It looks like that only works for debug builds because it gets '.min'
> > > appended in the release build template.
> > > And it seems that MXRoyale Application builds append the system manager
> > > part as a variation.
> > > So we need a new token probably just for the main class name.
> > >
> > > For now it is possible to do:
> > > ${application}_mx_managers_SystemManager
> > > for debug builds of mx apps.
> > >
> > >
> > >
> > > On Fri, Sep 6, 2019 at 1:17 PM Greg Dove <[email protected]> wrote:
> > >
> > >>
> > >> Just to add to this thread:
> > >>
> > >> this type of thing also works if you need the name of the application
> > >> injected (which seems quite helpful for injecting into customised
> > >> javascript):
> > >>
> > >> <script>
> > >>     // the name of my app is:${application}
> > >> </script>
> > >>
> > >>
> > >> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira <
> [email protected]>
> > >> wrote:
> > >>
> > >>> Hi Chris,
> > >>>
> > >>> ua-parser-js seems very complete. I'll have into account for my own
> > >>> projects :).
> > >>> Thanks for sharing.
> > >>>
> > >>> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
> > >>> [email protected]>) escribió:
> > >>>
> > >>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira <
> [email protected]
> > >
> > >>> > wrote:
> > >>> >
> > >>> > > maybe the actual way compiler deal with this is a bit restricted,
> > >>> and we
> > >>> > > can update that part including the <script> tags in the html
> > >>> template and
> > >>> > > making ${body} only outputs "new App.start();", so people could
> > >>> switch to
> > >>> > > its own "htmlTemplate"
> > >>> >
> > >>> >
> > >>> > Sounds like a good long term solution. Josh's suggestion also good
> as
> > >>> long
> > >>> > as you remember or know the main class name of the app in order to
> > >>> start it
> > >>> > in the customised HTML template.
> > >>> >
> > >>> > As for compatibility testing, writing that test in Royale didn't
> make
> > >>> sense
> > >>> > to me if the browser you are trying to run that code in is
> > >>> incompatible. My
> > >>> > idea was to use https://github.com/faisalman/ua-parser-js as a
> basis
> > >>> for
> > >>> > testing compatibility.
> > >>> >
> > >>> > Chris
> > >>> > --
> > >>> > Chris Velevitch
> > >>> > m: 0415 469 095
> > >>> >
> > >>>
> > >>>
> > >>> --
> > >>> Carlos Rovira
> > >>> http://about.me/carlosrovira
> > >>>
> > >>
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>

Reply via email to