You can actually add it to a library project too. You need to tell the compiler to include it in the library somehow. There are a number of different ways that you can tell the compiler to include a class in a library.
- If you have a *Classes.as file at the root of the library that is already included, you may reference it there. This is how the Royale and Flex frameworks typically include classes. - If you are using the include-namespaces compiler option, you can add it to your manifest XML file. However, this should generally be done only if you want to use the class in MXML. - If you are using the include-sources compiler option, you can simply include the file somewhere in the specified source path, similar to an application. This is typically what I do for my own projects. I never really understood why Royale and Flex didn't do it this way, since using a *Classes.as file requires more frequent manual editing, but include-sources will always automatically discover new files that are added without requiring a separate *Classes.as file. - There is also the include-classes option. You can add the file to your source path, and then specify it like -include-classes+=com.example.MyClass. I don't think that include-classes is used very often, but it's available. Once you've included the class in your library, that's where my memory isn't very clear. I don't recall how the compiler chooses between versions of a duplicate class that is two or more SWC files. It could be the order that the SWC files are specified in the library path compiler options. That would be ideal because your application project will always add custom SWC files after the framework's SWC files. However, it could be based on when each SWC file was last modified instead. If it's the modification date, then I think that the newer SWC file takes precedence. In that case, you need to be careful because if you rebuild Royale with the latest commits, you will also need to rebuild your library to ensure that its modification date is always newer than the Royale framework SWCs. -- Josh Tynjala Bowler Hat LLC https://bowlerhat.dev/ On Wed, May 7, 2025 at 9:44 AM Maria José Esteve <[email protected]> wrote: > [en] > > Yes, I placed it in the main application folder and everything worked as > expected. > > I wanted to put it in the library project where I have the components, but > it's fine — everything works well, and I'll stick with this. > > Thanks again for the quick help. > > > > [es] > > Sí, lo he puesto en la carpeta de la aplicación principal y todo ha > funcionado como se esperaba. > > Quería ponerlo en el proyecto de librería dónde tengo los componentes, > pero no importa, todo funciona bien y “así me quedo”. > > De nuevo, gracias por la ayuda tan rápida. > > > > Hiedra > > > > *De:* Josh Tynjala <[email protected]> > *Enviado el:* miércoles, 7 de mayo de 2025 18:35 > *Para:* [email protected] > *Asunto:* Re: FontAwesomeIcon: change faStyle property defaultsto SOLID > instead of REGULAR > > > > In an application project, you should not need to do anything except to > copy it into your source path. The compiler will give your application's > source path precedence over the pre-compiled version in the .swc file. > > > > -- > > Josh Tynjala > > Bowler Hat LLC > > https://bowlerhat.dev/ > > > > > > On Wed, May 7, 2025 at 9:22 AM Maria José Esteve <[email protected]> > wrote: > > [en] > > Thanks, Josh. Do I need to add it to "*Classes.as" or to > "components-manifest.xml"? > > > > [es] > > Gracias Josh. ¿tengo que añadirlo a “*Classes.as” o a > “components-manifest.xml”? > > > > Hiedra > > > > *De:* Josh Tynjala <[email protected]> > *Enviado el:* miércoles, 7 de mayo de 2025 17:34 > *Para:* [email protected] > *Asunto:* Re: FontAwesomeIcon: change faStyle property defaultsto SOLID > instead of REGULAR > > > > Hi Maria, > > > > This is what the Flex and Royale communities call "monkey patching". > > > > When you copy the file FontAwesomeIcon.as into your project, it should > have the same package structure as it had in the original library. > > > > If your source-path contains src, your copy would go into > src/org/apache/royale/icons/FontAwesomeIcon.as. > > > > Alternatively, if your source-path is src/main/royale, your copy would go > into src/main/royale/org/apache/royale/icons/FontAwesomeIcon.as. > > > > -- > > Josh Tynjala > > Bowler Hat LLC > > https://bowlerhat.dev/ > > > > > > On Wed, May 7, 2025 at 5:02 AM Maria José Esteve <[email protected]> > wrote: > > [en] > > Hello, > > After the changes made to the SDK, my application has completely changed > its appearance ☹ > > I'm not against it, because I understand the reasons and they seem valid, > but I can't go through and change all the FontAwesomeIcon instances just to > add the faStyle attribute set to REGULAR. > > > > I've thought of a short- and medium-term workaround to avoid having to > modify everything: I believe I once read in the mailing lists that I can > activate a class from the SDK in my project by placing it in the same path, > but I'm not exactly sure what that means... I can copy FontAwesomeIcon.as > into a subfolder within my project, but I assume I’ll also need to define > the namespace… > > > > Could someone explain the steps I need to follow to do this? > > > > [es] > > Hola, > > Tras las modificaciones realizadas en el SDK mi aplicación ha cambiado > totalmente de apariencia ☹ > > No estoy en contra, porque los motivos los veo correctos, pero no puedo > ahora cambiar todos los FontAwesomeIcon para añadirle el atributo faStyle a > REGULAR. > > He pensado en una solución intermedia, a corto y medio plazo, para no > tener que modificarlo todo: en alguna ocasión creo haber leído en las > listas que puedo hacer activa una clase del SDK en mi proyecto poniéndola > en la misma ruta pero esto no sé lo que quiere decir exactamente… Puedo > copiar FontAwesomeIcon.as en una subcarpeta, dentro de mi proyecto pero > imagino que tendré que indicar el namespace también… > > ¿alguien puede indicarme los pasos que debo seguir para hacer esto? > > > > Gracias. > > > > Hiedra > > > >
