What is the best way to distribute as3 classes and packages?

I have a small structure that I would like to place there. I would like to export these classes as a single file.

I know that there is a SWC format, but there is not much recent information on how to export this assembly, and I feel that this format may be deprecated.

+1
source share
1 answer

A SWC file is just a ZIP file (with a renamed extension) that contains at least one SWF movie (compiled bytecode for your library) and an XML file that contains information about the contents of the SWF. However, since the SWC file is just a ZIP file, you can add additional information; the most common of which is including ASDoc output , which can then be parsed using an IDE (such as Flash Builder 4) and displayed as embedded documentation.

SWC files are preferred by developers because they are stand-alone build dependencies. This simplifies management, since you only need to delete one SWC file in the project so that it can be compiled. They are also preferable because they prevent junior developers from trying to make any changes to the source code of the library (after which it ceases to be a third-party library).

SWC files can be compiled using the Adobe COMPC utility; Most Flash IDEs ( Flash Builder , FDT , FlashDevelop ) support compiling SWC from the GUI; but you can also compile SWC from the command line, ANT , or Maven .

One thing to consider when creating your Framework SWC file is to display any build dependencies that are in your project. For example, suppose your Framework uses the GreenSock Library ; Instead of compiling your entire structure, including GreenSock code, into a single SWC file, you should compile your SWC to exclude all the code contained in your project dependencies (i.e.: greensock.swc), and then distribute the SWC file and your greensock.swc file. Thus, developers using your Framework will not be forced to use the version of the GreenSock library with which you compiled. An example of this practice in action can be found in the RobotLegs framework , which distributes both robotlegs.swc and swiftsuspenders.swc.

I wrote a blog post about managing build dependencies , which may contain related readings on this topic.

Finally, I would recommend placing the source code of your libraries in an open SCM solution; such as GitHub or Google Code , that developers can read (and verify) the source code if they require a link - it also provides a good central location for release management and documentation.

+8
source

Source: https://habr.com/ru/post/907622/


All Articles