flex编译—加入主题参数

阅读更多

    在使用flashbuilder开发flex程序的过程中,有时我们会为了支持某种主题而在flex编译器->附加的编译器参数下加入如下语句:-locale en_US -theme=${flexlib}/themes/Halo/halo.swc但是我们不能直接使用flashbuilder生成出来的swf或者swc(存在版权问题),必须使用ant构建自己的swf或者swc。将语句-locale en_US -theme=${flexlib}/themes/Halo/halo.swc转换成ant中的表示为:

 


    
    	
    	
    	
    	        
    		      
    		   
    		   
    	          
    	        
    	            
    	       		
    	        
    	        
    	       		 
    	       		 
    	        
    	        
		 
    	
    	
    	
    	
			
			
	    
    
 

 

 

 其实这些参数在flex SDK的ant包下的Readme.txt有描述:

 

################################################################################
#                                                                              #
# README - flexTasks                                                           #
#                                                                              #
################################################################################

Contents
  I.    Installation
  II.   Using flexTasks
    A.  mxmlc

###################


  I.    Installation

Place flexTasks.jar into the lib directory of your Ant installation.
Alternatively, you can specify the location of the JAR file as an
argument to Ant, as the follow example shows:

  ant -lib /flexTasks.jar .

In addition to this, you must include the following line in any build
file that uses the mxmlc or asc tasks:

   .

The build tools that you want to use (such as mxmlc or asc) must be in
your PATH. Unlike Ant, these tasks do not search your current
directory for executables unless the current directory appears in your
PATH (either explicitly or by including ".").

#########

  II.   Using flexTasks

#####

    A.  mxmlc

FlexBuild exposes all of the command-line options of mxmlc through the
attributes and nested elements of an  task. The full name and
abbreviated name of a command line option can be used interchangably
when the option is implemented as an attribute.

The following examples are both acceptable ways to pass the compiler.as3 option 
to mxmlc:

  

and

  

All boolean options are implemented as attributes of the  element.

All options that take a single argument are also implemented as attributes of
the  element. The descriptions of these types of options vary in the 
mxmlc documentation. If an option is documented as taking a ,
, , or some sort of path element, and that option is non-
repeatable, then this option is set by setting an attribute in the 
element.

Options that are repeatable, or take more than one argument (such as 
default-size), are implemented as nested elements with attributes corresponding
to the names given to arguments in the mxmlc documentation. For example, if you
want to pass the option -default-size 800 600 to mxmlc, use the following
syntax:


    


Do not include multiple nested elements corresponding to a non-repeatable option.

The following two nested elements can contain nested elements: 
 - 
 - 

These elements encapsulate all options starting with "compiler.fonts" and "metadata", 
repectively. The same rules that apply to other options apply to nested elements.
The following example includes contributors names and a description of the application:


    
        
        
    
.

There are some exceptions to the rules states above: 

- The compiler.fonts.languages.language-range option is set by
adding a  nested element to , rather than a 
 element.

- The following options (repeatable options that take a path-element) are 
implemented as FileSets:

-compiler.external-library-path
-compiler.include-libraries
-compiler.library-path
-compiler.theme

The following example shows the usage for external-library-path:


    
    




To use these options, append the files that the FileSet chooses to the compiler
defaults and set the append attribute of the FileSet to true.

- The file-spec option is not supported. Instead, use the file attribute of
the mxmlc task.


################################################################################
#                                                                              #
# End of README                                                                #
#                                                                              #
################################################################################
   

 

你可能感兴趣的:(flex编译—加入主题参数)