Without considering whether that’s the right place to change the code, I would 
not be in favor of adding more variables to the template unless they cannot be 
specified some other way.  If you have to add a compiler option to specify a 
variable that goes in the output, I think it would be better to just use some 
build tool to do the string substitution.  The goal of the compiler output in a 
template is to have the compiler specify things that are not easily determined, 
like a width/height which is in an MXML file, or must already be specified like 
the appname.

Of course, this is open source so folks can decide differently, but just wanted 
to share my 2 cents,
-Alex

From: Harbs <harbs.li...@gmail.com>
Reply-To: "users@royale.apache.org" <users@royale.apache.org>
Date: Tuesday, January 12, 2021 at 5:02 AM
To: "users@royale.apache.org" <users@royale.apache.org>
Subject: Re: CSS & JS file versioning

I don’t think we have that yet, but I believe the place to add it would be in 
MXMLRoyalePublisher.java and MXMLApplicationNode.java

Note specifically the following commented lines in MXMLRoyalePublisher.java:

        //result = result.replaceAll("\\$\\{version_major\\}", versionMajor);
        //result = result.replaceAll("\\$\\{version_minor\\}", versionMinor);
        //result = result.replaceAll("\\$\\{version_revision\\}", 
versionRevision);

You’d want to parse out the specific tags and enable the above lines.


On Jan 12, 2021, at 2:27 PM, lol lol <massc...@gmx.de<mailto:massc...@gmx.de>> 
wrote:

Indeed, it was more about whether the "html-template" supports own placeholders 
and versioning per se.


Gesendet: Dienstag, 12. Januar 2021 um 13:14 Uhr
Von: "Harbs" <harbs.li...@gmail.com<mailto:harbs.li...@gmail.com>>
An: users@royale.apache.org<mailto:users@royale.apache.org>
Betreff: Re: CSS & JS file versioning
I think the question was how to automatically insert the build number into the 
html (i.e.?v=12345678)

On Jan 12, 2021, at 1:41 PM, Carlos Rovira 
<carlosrov...@apache.org<mailto:carlosrov...@apache.org>> wrote:

Hi,

I think you need "htmlTemplate" compiler option. This is how to use in Maven:

<htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>

in command line:

-html-template=src/main/resources/jewel-example-index-template.html

or in asconfig:

"html-template": "src/main/resources/jewel-example-index-template.html"

HTH

Carlos



El mar, 12 ene 2021 a las 10:47, lol lol 
(<massc...@gmx.de<mailto:massc...@gmx.de>>) escribió:
Hi All,

Is there any possibility defined that lets me define my own placeholders in the 
html-template?
For example im using an html template with the following line

    <link rel="stylesheet" type="text/css" href="${application}.css">

Is there anything helpful already existing in the compiler so I can add a 
version to my css like so:


href="${application}?v=12345678" />

Thank!


--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=04%7C01%7Caharui%40adobe.com%7C06589b8a71b24216bc1d08d8b6fa5441%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637460533562500040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2B29PeZk8r8taAFrgoFogTC3BZ6NGZjxqLO6TA4j2c1w%3D&reserved=0>


Reply via email to