Schemaphic Systems Blog

Sharing experiences in Flash, Flex and AIR

Building SWC using the Flex 3 SDK and build xml

with 3 comments

Run this xml using mxmlc compiler. 

<?xml version=”1.0″ encoding=”UTF-8″?> 

<!– Define base directory and start up identification –>
<project default=”build-swc-lib” basedir=”.”> 

<!– Define the Flex SDK path of Flex Builder 3 –>
<property value=”C:/Program Files/Adobe/Flex Builder 3/sdks/3.2.0″ /> 

<!– Define the source path of directory which has the *.as files to be compiled to SWC –>
<property value=”${basedir}/src” /> 

<!– Define the path of lib directory where the compiled SWC will be created –>
<property value=”${basedir}/lib” /> 

<!– Define the path of flexTasks.jar for compiling the *.as files –>
<taskdef resource=”flexTasks.tasks” classpath=”${FLEX_HOME}/ant/lib/flexTasks.jar” /> 

<!– SWC Template –>
<echo>Compiles SWC</echo> 

<!– Define the commands to generate a SWC library –>
<target description=”Generates a SWC library from a directory of AS3 classes”> 

<echo>Generating SWC Library</echo>
<exec executable=”${FLEX_HOME}/bin/compc.exe”> 

<!– Define the classes to be compiled –>
<arg line=”-include-sources ${SRC_DIR}/net/ct/widgets/”/> 

<!– Define the name of the SWC along with the path of export –>
<arg line=”-output ${LIB_PATH}/Paypal.swc”/> 





Written by Deepanjan Das

May 27, 2010 at 6:50 PM

3 Responses

Subscribe to comments with RSS.

  1. Thanks dude! How do i add more classes?


    May 28, 2010 at 4:49 PM

    • Hey Ravi…Thanks and congrats for being the first to join the discussion.
      You may provide the class names comma (“,”) separated.



      May 29, 2010 at 9:04 PM

  2. Thanks 🙂


    June 1, 2010 at 2:05 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: