Compiling Strobe Media Playback using command line

The developers of Strobe Media Playback are rather vague about how to compile the source code. This article tries to list all the steps needed to get a working SWF on any modern OS.

Here is a list of things you will need to make the magic happen:

  • Java JDK 6
  • Apache Ant
  • Adobe Flex SDK 4
  • FlexUnit 4
  • Ant Contrib

First make sure you have Java (JDK 6) installed on your OS.
Next get Apache Ant from http://ant.apache.org/bindownload.cgi (I used v1.8.2 for this article) or if you are running some OS with central software repositories (Linux, FreeBSD, etc), then install using the tools provided with it (yum, pkg_add, apt-get, etc).
When setting up Apache Ant on a Windows machine make sure you add the bin directory to PATH variable of the system.

Then go and download the Strobe Media Playback source from http://sourceforge.net/projects/smp.adobe/files/ (for this article I used v1.5.1). Uncompress the downloaded file and at the root of the uncompressed source directory create the following subdirectories:

./buildtools/
./buildtools/libs/
./buildtools/sdks/
./buildtools/sdks/4.1.0/

Now lets populate the ./buildtools folder with some… umm build tools obviously… duh…

Go and download Flex 4 SDK from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 (for this article I used v4.1.0.16076). Uncompress the files into the ./buildtools/sdks/4.1.0/ subdirectory.

Now we’ll need something called ANT Contrib. Version 1.0b3 to be precise. Uncompress the archive and move the ant-contrib-1.0b3.jar file to ./buildtools/libs/

Finally something called FlexUnit… from the download page choose the stable release FlexUnit (4.0 SDK). Uncompress the the archive and move flexUnitTasks-4.0.0.jar to ./buildtools/libs/

If using Windows, then now you can execute the “src\build.bat compile.strobe”.

For unix-like OS-es you need to create a shell script ./src/compile.strobe, like:

#!/bin/bash
BUILD_TOOLS=”..\buildtools”
/usr/bin/ant \
-lib ${BUILD_TOOLS}\sdks\4.1.0\lib \
-lib ${BUILD_TOOLS}\sdks\4.1.0\ant\lib \
-lib ${BUILD_TOOLS}\libs \
compile.strobe

If you don’t have bash, then just tweak the script a bit to match the conventions of your favourite shell.

If you look inside ./src/build.xml, you’ll notice that there are many other build targets besides “compile.strobe”. Haven’t yet worked out how to make them all work… will post an update when I do.

Debug build for Flash Player 10.1