My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
FAQ  

Supports

  • Pure AS3 projects
  • Flex projects
  • NOT Air yet

Current branches

  1. air (medium priority): make AIR support possible
  2. bugs (highest priority): working copy to address known issues of current release
  3. next (high priority): next release work in progress copy
  4. ifac (low priority): ifac support for turkish sweater
  5. zarkov (low priority): zarkov support for turkish sweater
  6. fla (medium priority): fla support using JSFL

Requirements

You should be able to read and understand XML and basic ANT targets.

  • Java 1.4 and higher
  • ANT 1.6 and higher
  • FlashPlayer 9.0 and higher
  • Any other dependency should be solved through the ANT build.

Set your environment variables, so ant and java are known operations to your system.

Note: Currently all wrappers are written for the Flex 3 SDK.

Targets

setup target

Each project should define a setup target in the build.xml, that downloads and moves all need libraries of your project to the lib folder. Who ever has to work with the project should be able to satisfy all project dependencies by running this setup once.

production target

Each project should define a production target in the build.xml, that builds for production deployment. This target can only be run after successful setup.

How To

Turkish Sweater already includes an example code that you should be able to run right away. Download and unzip the project.

  1. Open your terminal and go to the build folder inside the unzipped archive
  2. Type ant setup. You should see Buildfile: build.xml [..] [echo] Setup finished.., this should take some time and each target should build successfully.
  3. Type ant production or simply ant. You should see Buildfile: build.xml [..] [echo] Production build finished.. with each target build successfully.
  4. Open index.html from the bin folder in your browser.

If you get an error of a missing report-xml, try running main-target first. The main target will create that file for you. lib and font target are depending on it. Future release we will fix this.

Individual Project Values

To define host specific settings use the build.properties in the build folder.

 AUTHOR = You
 SOME_OS_SPECIFIC_LIB = somewhere.com

Shared Project Values

Please change the project name in the build file: <project name="XYZ"..

Also in the build.xml you should edit the project values in the upper part of the document look for:

 <!--//////////////////////////////////-->
 <!--// properties  (Edit if needed) //-->
 <!--//////////////////////////////////-->
 <!--// Additional libraries (Extend if needed through repeat defining property LIBS) //-->
 <!--// Example: <property name="LIBS" value="${LIBS} -source-path ${SOME_LIB}" /> //-->
  <property name="LIBS"  value="source-path ${PWD}/lib/toolkit" />
 <!--// Additional swc import //-->
 <!--// Imports only referenced classes, use for sourcecode //-->
 <!--// Example: <property name="IMPORT" value="library-path+=${PWD}/lib/some.swc -library-path+=${PWD}/lib/other.swc" /> //-->
  <property name="IMPORT"  value="-library-path+=${PWD}/lib/lib.swc" />
 <!--// Additional swc include //-->
 <!--// Includes all containing classes, use for assets //-->
 <!--// Example: <property name="INCLUDE" value="-include-libraries=${PWD}/lib/some.swc -include-libraries=${PWD}/lib/other.swc" /> //-->
 <property name="INCLUDE"  value="-include-libraries=${PWD}/lib/some.swc" />
 <!--// Product owner //-->
 <property name="PRODUCT.release"   value="0" />
 <property name="PRODUCT.sprint"    value="0" />
 <property name="PRODUCT.copyright" value="Copyright(c) Your Company or Client(TM)" />
 <property name="PRODUCT.owner"     value="http://www.somewhere.com" />
 <property name="DEBUG_PASSWORD"    value="1234abcd" />

Product Details

Turkish Sweater already compiles a Product class for you, that helps you verifying which version, build, by whom and when created you are actually looking at. Just add two line of codes to your project (in a class that extends Sprite).

 import product.Product;		

 Product.register(this);

And you will find in the trace, context-menu and by pressing the ~ product information.

Defining Dependencies

Common Interface

Turkish Sweater tries to formalize the interface of different methods to retrieve libraries from a server.

  • from: defines the actual path of a file on the server
  • server: defines the server itself without any protocol like "ftp://"
  • to: defines where the remote file should be locally stored

Next to these three, others are mostly common shared as well.

  • username: if a username is needed and you do not want to promp the user for it
  • password: if a password is needed and you do not want to promp the user for it
  • protocol: if the protocol to use is different from the default

Supported Methods

Turkish Sweater currently supports cvs, svn, http, https, secure copy and ftp.

 GET-CVS
 GET-FTP
 GET-HTTP
 GET-SVN
 GET-SCP

XYZ-AUTHORIZE

Methods that require a username and password define mostly two versions of them self:

  • Passive: Fix defined or default username/password, e.g GET-SVN
  • Interactive: The ant build executing user has to provide username/password, e.g. GET-SVN-AUTHORIZE

Properties

Use ANT properties to define where your third party library lives

 <!--//////////////////-->
 <!--// Dependencies //-->
 <!--//////////////////-->
	
 <!--// Flex SDK //-->
  <property name="SDK-SERVER" value="download.macromedia.com" />
  <property name="SDK-FILE"   value="pub/flex/sdk/flex_sdk_3.zip" />

Target

Define your own target to download the libraries, like in the given example of setup-as-libs

 <GET-HTTP 
  from="${SDK-SERVER}" 
  server="${SDK-FILE}" 
  to="${PWD}/temp/SDK.zip" 
 />

${PWD}

You will have noticed that Turkish Sweater uses the property PWD a lot. The name comes from 'print working directory' and holds the root folder of your project, to enable you relative path definitions.

MARCOS

TODO: explain all marcos

SWF Settings

Turkish Sweater tries to minimize settings inside the build.xml. Use compiler directives to set swf specific settings like framerate and size:

 [ SWF( backgroundColor="0xFFFFFF", frameRate="100", width="950", height="500") ]
 public class Main extends Sprite {

SVN ignore

Since you want to exclude the lib folder from version control, you can use provided svn ignore files. Please type in your working folder:

 $ svn propset svn:ignore -R -F .svn-ignore-general .
 $ svn propset svn:ignore -F .svn-ignore-project .

To see also the ignored files in your status view type:

 $ svn status --no-ignore

TIP

Look into the source code of files, most of them should be well documented. If you miss documentation or find outdated one, please let me know.


Sign in to add a comment
Powered by Google Project Hosting