
Re: Build SWC from FD! "ExportSWC" plugin [beta]
I am having trouble using the ExportSWC plugin with FlashDevelop 4.0.4, so I started searching for an update of the plugin that is compatible with the version I use, however I did not find anything useful.
I do hope that there will be a compatible version of the plugin soon, because I love it, and use it a lot.
In the mean time, I came up with a temporary solution for anybody who has the same problems I am having:
I wrote a batch file that does the trick, however, for every project that I create (and want to export to swc) I need to create a new batch file.
The batch file looks like this:
Code:
cd C:\Program Files\FlashDevelop\Tools\flexsdk\bin\
compc.exe -source-path C:\path\to\your\project\src -include-sources C:\path\to\your\project\src -optimize -output C:\path\to\your\project\bin\theDesiredNameForTheSWC.swc
The first line is a command that navigates to a directory that neets to be the directory in which the FlexSDK's compc.exe file is located.
By default that directory is "C:\Program Files\FlashDevelop\Tools\flexsdk\bin\".
The second line does all the magic:
compc.exe runs the compiler
-source-path is a command that sets the classpath to where the imported original source code is located.
-include-sources is a command that sets the path to were the compiler should set it's root to start from.
-optimize -output is a command that sets the desired path and name of the exported swc.
I hope this helps anyone until there will be a new version of the ExportSWC plugin available.
Cheers.
-------------------------------------
Edit-------------------------------------
I have found a solution that works for every (AS3) project, without having to change the paths in the batch file.
Copy the following lines of code:
Code:
set filename=ExportedSWC
set location=%~dp0
cd C:\Program Files\FlashDevelop\Tools\flexsdk\bin\
compc.exe -source-path "%location%src" -include-sources "%location%src" -optimize -output "%location%bin\%filename%.swc"
and place them in a new .bat file called something like "ExportSWC" or at least something similar to make sure you know what the file is about.
Then copy the .bat file to the C:\Program Files\FlashDevelop\Projects\120 ActionScript 3 - AS3 Project\ folder.
This will make sure that the .bat file is copied to every AS3 project you create.
The only thing you will have to do is edit the filename variable every time you start a new project, so that you get the desired name for the SWC file, or you can just rename the file after exporting it.